/* ========================================================================= */
/* UI/UX Pro Max - High-End Component Stylesheet                             */
/* Standard: Apple / Stripe / ShopBack Tier-1 Clean Aesthetics                */
/* ========================================================================= */

/* ========================================================================= */
/* 1. Header & Navigation Bar                                                */
/* ========================================================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  height: 68px;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--slate-900);
  text-decoration: none;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary-gradient);
  color: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.brand-logo span span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  background: #f1f5f9;
  padding: 5px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--slate-600);
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--slate-900);
}

.nav-link.active {
  color: var(--primary);
  background: white;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  font-weight: 800;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-header-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1.5px solid var(--border-color);
  padding: 5px 14px 5px 6px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.user-header-pill:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--primary-glow);
}

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

.user-header-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
}

.user-header-name {
  font-weight: 800;
  color: var(--slate-900);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========================================================================= */
/* 2. Hero & Master Converter Bar                                            */
/* ========================================================================= */
.hero-section {
  padding: 36px 0 20px 0;
  position: relative;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: white;
  border: 1.5px solid var(--primary-border);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--primary);
  box-shadow: 0 4px 14px var(--primary-glow);
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}

.hero-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cash-green);
  box-shadow: 0 0 8px var(--cash-green);
  display: inline-block;
  animation: pulseLive 2s infinite ease-in-out;
}

@keyframes pulseLive {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.hero-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.2;
  margin-bottom: 12px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--slate-900);
}

.hero-title .highlight {
  background: linear-gradient(135deg, #2563EB 0%, #7C3AED 45%, #FF5722 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--slate-600);
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto 28px;
}

/* High-Converting Master Search Bar */
.master-converter {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 8px 10px 8px 18px;
  box-shadow: 0 20px 48px -12px rgba(15, 23, 42, 0.09), 0 0 0 1px rgba(0, 0, 0, 0.02);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}

.master-converter:focus-within {
  border-color: var(--primary);
  box-shadow: 0 20px 48px -10px var(--primary-glow), 0 0 0 4px var(--primary-light);
}

.master-converter-icon {
  color: var(--primary);
  display: flex;
  align-items: center;
}

.master-converter-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-900);
  padding: 12px 0;
}

.master-converter-input::placeholder {
  color: var(--slate-400);
  font-weight: 400;
}

.converter-paste-btn {
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  color: var(--slate-700);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.875rem;
  transition: var(--transition);
  white-space: nowrap;
}

.converter-paste-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

/* Converted Result Card */
.converter-result {
  display: none;
  margin-top: 20px;
  padding: 20px;
  background: white;
  border-radius: var(--radius-lg);
  border: 2px solid var(--primary);
  box-shadow: 0 16px 40px rgba(255, 67, 56, 0.12);
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.converter-result.show {
  display: block !important;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-grid {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 18px;
  align-items: center;
}

.result-image {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.result-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-cashback-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px dashed var(--primary);
}

/* Quick Platform Pills (Cyber Interactive Nodes) */
.platform-pill-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.platform-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--slate-800);
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.platform-pill:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 10px 25px -5px var(--primary-glow);
}

.platform-pill:active {
  transform: scale(0.98);
}

.platform-pill span {
  color: var(--primary);
  font-weight: 800;
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
}

/* ========================================================================= */
/* 3. Section Titles & Filter Bars                                           */
/* ========================================================================= */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.02em;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--slate-600);
  transition: var(--transition);
  cursor: pointer;
}

.filter-btn:hover {
  border-color: var(--slate-400);
  color: var(--slate-900);
}

.filter-btn.active {
  background: var(--slate-900);
  border-color: var(--slate-900);
  color: white;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

/* ========================================================================= */
/* 4. Deals Grid & Product Cards                                             */
/* ========================================================================= */
.deals-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.deal-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-color);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
}

.deal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-border);
}

.deal-thumb-wrap {
  position: relative;
  height: 190px;
  background: #f8fafc;
  overflow: hidden;
}

.deal-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.deal-card:hover .deal-thumb {
  transform: scale(1.06);
}

.deal-cashback-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  background: var(--primary);
  color: white;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.deal-platform-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  font-weight: 800;
  font-size: 0.6875rem;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-shopee { background: #ee4d2d; color: white; }
.badge-tiktok { background: #000000; color: white; }
.badge-lazada { background: #0f146d; color: white; }
.badge-tiki { background: #1a94ff; color: white; }

.deal-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.deal-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8em;
}

.deal-pricing {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.deal-sale-price {
  font-weight: 800;
  font-size: 1.0625rem;
  color: #ee4d2d;
}

.deal-original-price {
  font-size: 0.75rem;
  color: var(--slate-400);
  text-decoration: line-through;
}

.deal-progress-wrap {
  margin-bottom: 10px;
}

.deal-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--slate-600);
  margin-bottom: 4px;
  font-weight: 600;
}

.deal-progress-track {
  background: #f1f5f9;
  height: 5px;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.deal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b 0%, #ea580c 100%);
  border-radius: var(--radius-full);
}

.deal-coupon-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 5px 8px 5px 10px;
  margin-bottom: 12px;
}

.deal-coupon-code {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.8125rem;
  color: var(--slate-800);
  letter-spacing: 0.02em;
}

.deal-copy-btn {
  background: white;
  border: 1px solid #cbd5e1;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.6875rem;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.deal-copy-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 20px 0 28px;
}

.step-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.04);
}

.step-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-border);
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.08);
}

.step-num {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 12px;
  background: var(--primary-gradient);
  color: white;
  font-size: 1rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.step-content {
  flex: 1;
  min-width: 0;
}

.step-title {
  font-weight: 800;
  font-size: 0.9375rem;
  margin-bottom: 3px;
  color: var(--slate-900);
}

.step-desc {
  font-size: 0.75rem;
  color: var(--slate-500);
  line-height: 1.4;
}

/* ========================================================================= */
/* 6. Wallet Dashboard & Financial Analytics (Next-Gen FinTech Matrix)       */
/* ========================================================================= */
.wallet-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.wallet-stat-card {
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.06);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.wallet-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.1);
  border-color: var(--slate-300);
}

.wallet-stat-card:nth-child(1) {
  border-top: 4px solid var(--primary);
}

.wallet-stat-card:nth-child(2) {
  border-top: 4px solid var(--coin-gold);
}

.wallet-stat-card:nth-child(3) {
  border-top: 4px solid var(--cyber-indigo);
}

.wallet-stat-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--slate-500);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wallet-stat-amount {
  font-size: 1.875rem;
  font-weight: 900;
  color: var(--slate-900);
  letter-spacing: -0.03em;
}

.wallet-stat-amount.emerald {
  color: var(--primary);
  background: linear-gradient(135deg, #FF442B 0%, #FF8C00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wallet-stat-amount.amber {
  color: #D97706;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
  margin-bottom: 28px;
}

.analytics-card {
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.06);
}

.analytics-title {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 18px;
  letter-spacing: -0.02em;
}

/* ========================================================================= */
/* 7. Tables & Modals                                                        */
/* ========================================================================= */
.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.custom-table th {
  background: var(--slate-50);
  padding: 12px 16px;
  font-weight: 700;
  color: var(--slate-600);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--slate-700);
}

.custom-table tr:hover td {
  background: #fbfcfe;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.show {
  display: flex !important;
}

.modal-dialog {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 100%;
  overflow: hidden;
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--slate-900);
}

.modal-close-btn {
  color: var(--slate-400);
  font-size: 1.25rem;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--slate-700);
}

.modal-body {
  padding: 24px;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--slate-900);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Footer */
.footer {
  background: white;
  border-top: 1px solid var(--border-color);
  padding: 40px 0 24px;
  margin-top: 60px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--slate-100);
  padding-top: 20px;
  font-size: 0.8125rem;
  color: var(--slate-500);
  flex-wrap: wrap;
  gap: 12px;
}

/* ========================================================================= */
/* Social Proof Toast Notifications (Real-Time Live Feed)                    */
/* ========================================================================= */
.social-proof-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}

.social-proof-toast {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  box-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
  display: none;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  animation: socialProofIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.social-proof-toast.show {
  display: flex !important;
}

.social-proof-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-light);
  border: 1.5px solid var(--primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.social-proof-body {
  flex: 1;
  min-width: 0;
}

.social-proof-title {
  font-weight: 800;
  font-size: 0.8125rem;
  color: var(--slate-900);
  margin-bottom: 2px;
}

.social-proof-desc {
  font-size: 0.75rem;
  color: var(--slate-600);
  line-height: 1.35;
}

.social-proof-close {
  background: none;
  border: none;
  color: var(--slate-400);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.social-proof-close:hover {
  color: var(--slate-700);
}

@keyframes socialProofIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  .social-proof-container {
    bottom: 74px; /* Tránh đè lên mobile bottom nav */
    left: 12px;
    right: 12px;
    max-width: calc(100% - 24px);
  }
}
