@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  background-color: #f8f8f8;
}

.container {
  max-width: 414px;
  margin: 0 auto;
  background-color: white;
  height: 100vh;
  position: relative;
}

.header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
  background-color: white;
  border-bottom: 1px solid #f1f1f1;
}

.header-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.header-tiktok-logo {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
}

.header-recharge-text {
  font-size: 16px;
  font-weight: 700;
  color: #161823;
}

.header-coin-balance {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.header-coin-icon {
  width: 16px;
  height: 16px;
}

.header-coin-balance span {
  font-size: 14px;
  color: #121211;
  font-weight: 600;
}

.header-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  font-weight: bold;
  padding-bottom: 8px;
}

.header-title h2 {
  font-size: 18px;
}

.transaction-history {
  font-size: 14px;
  color: #666;
}

.username-input {
  margin: 0px 16px 10px 16px;
  padding: 12px 10px;
  background-color: #f1f1f1;
  border-radius: 4px;
  font-size: 16px;
  border: none;
  color: #333;
  width: calc(100% - 32px);
}

.user-preview {
  display: flex;
  align-items: center;
  margin: 0 16px 10px 16px;
  padding: 10px 12px;
  background-color: #f8f8f8;
  border-radius: 8px;
  gap: 12px;
}

.preview-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.preview-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.preview-name {
  font-weight: 600;
  font-size: 15px;
  color: #161823;
}

.preview-username {
  font-size: 13px;
  color: #999;
}

/* Skeleton loading */
.preview-skeleton,
.preview-data {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.skeleton-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  flex-shrink: 0;
}

.skeleton-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-name {
  width: 50%;
}

.skeleton-user {
  width: 35%;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Fade in data */
.preview-data {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.coin-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px;
}

.coin-option {
  border: 1px solid #f1f1f1;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.coin-option.selected {
  border: 1px solid #ffc107;
  background-color: #fffbeb;
}

.coin-amount {
  display: flex;
  align-items: center;
  font-weight: bold;
  margin-bottom: 4px;
}

.coin-amount span {
  font-size: 18px;
  font-weight: 800;
}

.coin-icon {
  width: 20px;
  height: 20px;
  background-color: #ffc107;
  border-radius: 50%;
  margin-right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
}

.coin-icon>img {
  width: 20px;
}

.coin-price {
  color: #666;
  font-size: 13px;
}

.payment-section {
  padding: 10px 16px 10px;
  width: 100%;
}

.payment-method {
  font-size: 14px;
  color: #666;
}

.payment-icons {
  display: flex;
  gap: 5px;
  margin-bottom: 15px;
}

.payment-icon {
  width: 30px;
  height: 20px;
  background-color: #f1f1f1;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #333;
}

.recharge-btn {
  background-color: #ff4d4f;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 12px;
  width: 40%;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
}

.recharge-btn-modal {
  background-color: #ff4d4f;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 12px;
  width: 100%;
  font-weight: bold;
  cursor: pointer;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background-color: white;
  border-radius: 8px;
  width: 90%;
  max-width: 360px;
  padding: 20px;
}

.modal-title {
  text-align: center;
  font-weight: bold;
  margin-bottom: 15px;
  position: relative;
}

.close-btn {
  position: absolute;
  right: 0;
  top: 0;
  cursor: pointer;
  font-size: 16px;
  color: #999;
}

.custom-amount {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #f1f1f1;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.custom-amount .coin-icon {
  margin-right: 10px;
}

.custom-amount input {
  border: none;
  outline: none;
  font-size: 20px;
  width: 100%;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 15px;
}

.key {
  background-color: #f8f8f8;
  border: none;
  border-radius: 4px;
  padding: 15px;
  font-size: 18px;
  text-align: center;
  cursor: pointer;
}

.total-section {
  margin-bottom: 15px;
  font-weight: bold;
}

.success-modal {
  text-align: center;
  padding: 20px;
}

.success-icon {
  width: 50px;
  height: 50px;
  background-color: #52c41a;
  border-radius: 50%;
  margin: 0 auto 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
}

.success-message {
  margin-bottom: 20px;
  color: #666;
}

.go-back-btn {
  background-color: #ff4d4f;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 12px;
  width: 100%;
  font-weight: bold;
  cursor: pointer;
}

.navbar {
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  background-color: white;
  border-top: 1px solid #f1f1f1;
  position: absolute;
  bottom: 0;
  width: 100%;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 24px;
  color: #999;
}

.nav-text {
  font-size: 12px;
  margin-top: 5px;
}

/* Loading animation styles */
.loading-modal-container {
  padding: 30px 20px;
  border-radius: 12px;
}

.loading-modal {
  text-align: center;
  padding: 10px 0;
}

.loading-username {
  font-size: 13px;
  color: #999;
  margin-bottom: 24px;
}

.loading-dots-wrapper {
  position: relative;
  width: 32px;
  height: 14px;
  margin: 0 auto 20px;
  perspective: 80px;
  transform-style: preserve-3d;
  animation: dotsRotate 1.2s linear infinite;
}

.loading-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  position: absolute;
  top: 0;
}

.loading-dot-red {
  background-color: #FE2C55;
  right: 0;
}

.loading-dot-teal {
  background-color: #25F4EE;
  left: 0;
}

@keyframes dotsRotate {
  0% {
    transform: rotateY(0deg);
  }

  100% {
    transform: rotateY(360deg);
  }
}

.loading-title {
  font-size: 16px;
  font-weight: 600;
  color: #161823;
  margin-bottom: 6px;
}

.loading-subtitle {
  font-size: 14px;
  color: #999;
  margin-bottom: 20px;
}

.loading-timer {
  font-size: 16px;
  font-weight: 600;
  color: #161823;
  letter-spacing: 1px;
}

/* Payment card logo */
.payment-card-logo {
  width: 36px;
  height: 24px;
  object-fit: contain;
  margin-right: 10px;
}

/* Payment Modal Container */
.payment-modal-container {
  padding: 20px;
  border-radius: 12px 12px 0 0;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 414px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Account Row */
.order-account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}

.order-account-label {
  font-size: 15px;
  color: #161823;
}

.order-account-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

#summaryUsername {
  font-size: 15px;
  color: #161823;
}

.order-summary-divider {
  height: 1px;
  background-color: #e8e8e8;
  margin: 4px 0;
}

/* Order Summary Styles */
.order-summary {
  padding: 10px 0;
  margin-bottom: 8px;
}

.order-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 15px;
  color: #161823;
}

.order-item-total {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #e8e8e8;
  font-weight: 700;
  font-size: 15px;
  color: #161823;
}

/* Payment Methods Styles */
.payment-methods {
  margin-bottom: 16px;
}

.payment-method-title {
  font-size: 15px;
  color: #161823;
  margin-bottom: 10px;
}

.payment-method-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
}

.payment-method-item.selected {
  border-color: #161823;
  background-color: #fff;
}

.payment-method-details {
  flex: 1;
}

.payment-card-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: #161823;
}

.payment-card-row b {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.card-dots {
  color: #161823;
  letter-spacing: 1px;
  font-size: 12px;
}

.card-last4 {
  font-weight: 600;
}

/* Terms */
.order-terms {
  font-size: 12px;
  color: #999;
  line-height: 1.5;
  margin-bottom: 12px;
}

.order-terms b {
  color: #161823;
  font-weight: 600;
}

/* Location */
.order-location {
  font-size: 13px;
  color: #161823;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Pay Now Button */
.pay-now-btn {
  background-color: #FE2C55;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 14px;
  width: 100%;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  margin-bottom: 8px;
}

.pay-now-btn:active {
  opacity: 0.9;
}

/* Recharge Bottom Button */
.recharge-btn-bottom {
  background-color: #FE2C55;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 14px;
  width: 100%;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
}

.recharge-btn-bottom:active {
  opacity: 0.9;
}

@media screen and (min-width: 768px) {
  body {
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif;
  }

  .container {
    width: 100%;
    max-width: 1400px;
    height: 100vh;
    margin: 0 auto;
    background-color: white;
    box-shadow: none;
    display: flex;
    flex-direction: column;
  }

  .header {
    padding: 20px;
    background-color: white;
    border-bottom: 1px solid #f1f1f1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  .header-tiktok-logo {
    width: 52px;
    height: 52px;
  }

  .header-recharge-text {
    font-size: 22px;
  }

  .header-coin-balance span {
    font-size: 16px;
  }

  .header-title {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .username-input {
    margin: 0 20px 20px;
    width: calc(100% - 40px);
  }

  .coin-options {
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    padding: 20px;
  }

  .coin-option {
    border: 1px solid rgb(0 0 0 / 17%);
    padding: 40px;
    transition: transform 0.3s ease;
  }

  .coin-option:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  }

  .payment-section {
    padding: 20px;
    display: block;
    align-items: center;
    border-top: 1px solid #f1f1f1;
  }

  .payment-icons {
    display: flex;
    align-items: center;
    gap: 15px;
  }

  .recharge-btn {
    padding: 12px 30px;
    font-size: 16px;
  }
}



/* Add these styles to your existing style.css */

/* Login Modal Styles */
.login-modal {
  max-width: 320px;
  text-align: center;
}

.login-form {
  margin-bottom: 15px;
}

.login-form input {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.login-btn {
  background-color: #ff4d4f;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px;
  width: 100%;
  cursor: pointer;
}

.login-note {
  font-size: 12px;
  color: #666;
  text-align: left;
  margin-top: 10px;
}

.header .login-section {
  display: none !important;
}

.header .login-btn {
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.06)), rgb(254, 44, 85);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 40px;
  cursor: pointer;
}

/* Add to existing style.css */
.user-profile-section {
  padding: 16px;
  background-color: #f8f8f8;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.user-profile {
  display: flex;
  align-items: center;
  flex-grow: 1;
}

.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-right: 15px;
  object-fit: cover;
}

.user-stats {
  display: flex;
  flex-direction: column;
}

.username {
  font-weight: bold;
  font-size: 20px;
  margin-bottom: 5px;
}

.user-metrics {
  display: flex;
  gap: 10px;
  font-size: 18px;
  color: #666;
}

.logout-btn {
  background-color: #ff4d4f;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 40px;
  cursor: pointer;
  margin-left: auto;
}

.noti-login {
  padding: 3px 5px;
  color: #FE2C55;
  font-size: 13px;
  font-style: italic;
}

.tiktok-link {
  display: inline-block;
  padding: 10px;
  background-color: #ff0050;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
}

.tiktok-link:hover {
  background-color: #e00045;
}

@media screen and (min-width: 768px) {

  /* Tăng font size cho các phần tử chính */
  .container {
    font-size: 20px;
    /* Tăng font size cơ bản */
  }

  .header-title h2 {
    font-size: 28px;
    /* Tăng size tiêu đề */
  }

  .coin-option {
    font-size: 20px;
    /* Tăng size chữ trong các option coin */
  }

  .coin-amount span {
    font-size: 24px;
    /* Tăng size chữ số lượng coin */
  }

  .coin-price {
    font-size: 20px;
    /* Tăng size giá coin */
  }

  .payment-method {
    font-size: 20px;
    /* Tăng size chữ phương thức thanh toán */
  }

  .modal-title {
    font-size: 22px;
    /* Tăng size tiêu đề modal */
  }

  .payment-method-details {
    font-size: 20px;
    /* Tăng size chữ chi tiết phương thức */
  }

  .order-summary {
    font-size: 18px;
    /* Tăng size chữ phần tổng quan đơn hàng */
  }

  .recharge-btn,
  .recharge-btn-modal {
    font-size: 20px;
    /* Tăng size chữ nút nạp tiền */
  }

  .login-form input,
  .username-input {
    font-size: 18px;
    /* Tăng size input */
  }

  .discount-info {
    font-size: 20px !important;
  }

  .header-tiktok-logo {
    width: 48px !important;
    height: 48px !important;
  }

  .coin-icon {
    width: 24px;
    height: 24px;
  }

  .login-modal {
    max-width: 400px;
  }

  .header .login-btn,
  .logout-btn {
    min-height: 36px;
    font-size: 16px;
    font-weight: bold;
  }

}