/* ==========================================================
   TopupHero - Global Stylesheet (Pure CSS, No Build Tools)
   Theme: Dark Gaming Obsidian with Emerald / Neon Accents
   ========================================================== */

:root {
  --bg-main: #0b0f19;
  --bg-card: #111827;
  --bg-card-hover: #1f293d;
  --border-color: #1f2937;
  --border-highlight: #374151;
  --accent: #10b981;
  --accent-hover: #059669;
  --accent-glow: rgba(16, 185, 129, 0.25);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --info: #38bdf8;
  --font-body: 'Hind Siliguri', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Chakra Petch', 'Outfit', 'Hind Siliguri', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6, .brand-title {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header & Navigation */
.site-header {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.notice-bar {
  background: linear-gradient(90deg, #064e3b, #047857);
  color: #ecfdf5;
  font-size: 13px;
  padding: 6px 12px;
  text-align: center;
  font-weight: 500;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.logo-img { height: 40px; width: auto; max-width: 180px; object-fit: contain; border-radius: 8px; display: block; }
.logo-badge {
  background: linear-gradient(135deg, #10b981, #065f46);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
  padding: 6px 10px;
  border-radius: 6px;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--accent);
  background: rgba(16, 185, 129, 0.08);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-toggle {
  background: #1f2937;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.cart-btn {
  background: #1e293b;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  position: relative;
}

.cart-count {
  background: var(--accent);
  color: #000;
  font-size: 12px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 10px;
}

/* Hero Section */
.hero-section {
  padding: 40px 0 30px;
  background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.12), transparent 40%),
              radial-gradient(circle at bottom left, rgba(6, 78, 59, 0.2), transparent 50%);
  border-bottom: 1px solid var(--border-color);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: center;
}

.hero-title {
  font-size: 38px;
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.hero-banner-card {
  background: linear-gradient(135deg, #134e4a, #064e3b);
  border: 1px solid #10b981;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* Game Grid */
.section-title {
  font-size: 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(0,0,0,0.5), 0 0 16px var(--accent-glow);
}

.game-card-banner {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-size: cover;
  background-position: center;
}

.game-card-content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.game-name {
  font-size: 18px;
  margin-bottom: 4px;
}

.game-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex: 1;
}

.game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  font-size: 12px;
}

.badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-site { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-whatsapp { background: rgba(37, 211, 102, 0.15); color: #25d366; border: 1px solid rgba(37, 211, 102, 0.3); }
.badge-uid { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.badge-login { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: #FF6B35;
  color: #0b0f19;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.25);
  transition: filter 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-primary:active {
  filter: brightness(0.95);
  transform: scale(0.98);
}

/* Buy Now: a gentle continuous pulse so the button draws the eye */
@keyframes th-buy-pulse {
  0%   { box-shadow: 0 4px 14px rgba(255, 107, 53, 0.25), 0 0 0 0 rgba(255, 107, 53, 0.55); }
  70%  { box-shadow: 0 4px 14px rgba(255, 107, 53, 0.25), 0 0 0 10px rgba(255, 107, 53, 0); }
  100% { box-shadow: 0 4px 14px rgba(255, 107, 53, 0.25), 0 0 0 0 rgba(255, 107, 53, 0); }
}
.btn-buy-pulse {
  animation: th-buy-pulse 2s ease-out infinite;
}
.btn-buy-pulse:hover {
  animation-play-state: paused;
  transform: translateY(-1px);
}
@media (prefers-reduced-motion: reduce) {
  .btn-buy-pulse { animation: none; }
}

.btn-secondary {
  background: #1f2937;
  color: #fff;
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #374151;
}

.btn-whatsapp {
  background: #25d366;
  color: #000;
  font-weight: 700;
}

.btn-whatsapp:hover {
  background: #1ebd5a;
}

.btn-block {
  width: 100%;
}

/* Package Selection Grid */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.package-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  position: relative;
}

.package-card:hover {
  border-color: var(--accent);
  background: #172033;
}

.package-card.selected {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.12);
  box-shadow: 0 0 12px var(--accent-glow);
}

.package-card.sold-out {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(80%);
}

.package-label {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.package-price {
  font-size: 16px;
  color: var(--accent);
  font-weight: 700;
}

.package-old-price {
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: line-through;
  margin-left: 6px;
}

/* Form Controls */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: #131b2e;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Payment Method Selectors */
.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.payment-method-card {
  background: #131b2e;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s;
}

.payment-method-card.active {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.15);
}

.payment-instructions-box {
  background: #111827;
  border: 1px dashed var(--border-highlight);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 18px;
}

.copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1a2234;
  padding: 8px 12px;
  border-radius: 6px;
  margin: 10px 0;
}

.copy-number {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: 1px;
  color: #facc15;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: #162032;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.data-table tr:hover {
  background: #131c2d;
}

/* Status Badges */
.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-pending { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.status-processing { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.status-completed { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-cancelled { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* Footer */
.site-footer {
  background: #090d16;
  border-top: 1px solid var(--border-color);
  padding: 36px 0 20px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 28px;
  margin-bottom: 24px;
}

.footer-bottom {
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

/* Responsive */
.mobile-menu-btn {
  display: none;
  background: #1e293b;
  border: 1px solid var(--border-color);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.mobile-menu-btn .bar {
  width: 100%;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: all 0.2s ease-in-out;
}

.mobile-menu-btn.active .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-menu-btn.active .bar:nth-child(2) {
  opacity: 0;
}
.mobile-menu-btn.active .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav-drawer {
  display: none;
  background: rgba(11, 15, 25, 0.98);
  border-top: 1px solid var(--border-color);
  padding: 12px 0 16px;
  backdrop-filter: blur(10px);
}

.mobile-nav-drawer.open {
  display: block;
}

.mobile-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
}

.mobile-nav-list a:hover {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent);
}

@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .nav-links {
    display: none;
  }
  .mobile-menu-btn {
    display: flex;
  }
}

/* ==========================================================
   Layout polish (cart, admin helpers, mobile fixes)
   ========================================================== */

/* Cart */
.cart-list { display: block; }
.cart-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  grid-template-areas: "main qty sub rm";
  align-items: center;
  gap: 12px 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
}
.cart-item:last-child { border-bottom: 0; }
.cart-item-main { grid-area: main; display: flex; align-items: center; gap: 12px; min-width: 0; }
.cart-item-img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid #334155; background: #0f172a; flex-shrink: 0; }
.cart-item-label { font-weight: 700; font-size: 15px; word-break: break-word; }
.cart-item-price { font-size: 13px; color: var(--accent); font-weight: 600; }
.cart-item-qty {
  grid-area: qty;
  display: inline-flex; align-items: center; gap: 4px;
  background: #131b2e; border: 1px solid var(--border-color); border-radius: 8px; padding: 2px 4px;
}
.cart-item-qty form { margin: 0; }
.cart-item-qty button {
  width: 32px; height: 32px; background: none; border: 0; color: #fff; font-size: 18px; cursor: pointer; border-radius: 6px;
}
.cart-item-qty button:active { background: rgba(255,255,255,0.08); }
.cart-item-qty span { min-width: 24px; text-align: center; font-weight: 700; }
.cart-item-sub { grid-area: sub; font-weight: 800; color: #fff; text-align: right; min-width: 70px; }
.cart-item-remove { grid-area: rm; margin: 0; }
.cart-item-remove button {
  width: 32px; height: 32px; background: rgba(239,68,68,0.1); border: 0; border-radius: 8px; color: var(--danger); cursor: pointer; font-size: 14px;
}
.cart-actions { display: flex; gap: 12px; }

/* Small helper buttons used in checkout / admin orders */
.btn-copy {
  background: #334155; color: #fff; border: 0; border-radius: 6px;
  padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-copy:active { background: #475569; }
.toggle-pass-btn {
  background: none; border: 1px solid var(--border-highlight); color: var(--text-muted);
  border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; font-family: inherit;
}

/* Tables never break the page width */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { min-width: 560px; }
img { max-width: 100%; }

.game-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Global overflow guards ---------- */
html { -webkit-text-size-adjust: 100%; }
html, body { max-width: 100%; }
body { overflow-x: hidden; }
main, .container { min-width: 0; }
input, select, textarea, button { max-width: 100%; }

/* ---------- Checkout layout ---------- */
.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 28px;
  align-items: start;
}
.checkout-grid > div { min-width: 0; }

/* Checkout step indicator */
.th-step-dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #1f2937; color: var(--text-muted);
  flex-shrink: 0; transition: background 0.2s ease, color 0.2s ease;
}
.th-step-dot.th-step-active { background: var(--accent); color: #0b0f19; }
.th-step-dot.th-step-done { background: #10b981; color: #0b0f19; }
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 22px;
  position: sticky;
  top: 90px;
}

/* ---------- Tablets & phones ---------- */
@media (max-width: 768px) {
  .checkout-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .summary-card { position: static; padding: 18px; }

  /* Header: compact so logo, language, cart and menu fit on one line */
  .nav-wrapper { height: 60px; gap: 8px; }
  .logo { font-size: 18px; gap: 8px; min-width: 0; }
  .logo-badge { display: none; }
  .logo-img { height: 34px; max-width: 130px; }
  .nav-actions { gap: 8px; }
  .lang-toggle { padding: 6px 10px; font-size: 12px; white-space: nowrap; }
  .cart-btn { padding: 6px 10px; gap: 6px; white-space: nowrap; }
  .cart-label { display: none; }
  .notice-bar { font-size: 12px; padding: 6px 10px; line-height: 1.4; }

  /* Page containers: less padding on phones */
  [style*="padding: 36px 16px"] { padding: 20px 14px !important; }

  /* Game cards: compact 2-column grid */
  .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 32px; }
  .game-card-banner { height: 84px; }
  .game-card-content { padding: 12px; }
  .game-name { font-size: 15px; }
  .game-desc { font-size: 12px; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .game-meta { flex-wrap: wrap; gap: 6px; }

  /* Package cards: 2 per row */
  .packages-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .package-card { padding: 12px 8px; }
  .package-label { font-size: 14px; }
  .package-price { font-size: 15px; }
  .package-old-price { display: block; margin-left: 0; }

  /* Game page header card */
  [style*="padding: 24px; margin-bottom: 28px; display: flex"] { padding: 16px !important; flex-wrap: wrap; gap: 12px !important; }

  /* Payment method choices: 3 per row */
  .payment-methods-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .payment-method-card { padding: 10px 4px; font-size: 13px; }

  /* Any leftover multi-column inline layouts stack on phones */
  [style*="1fr 1fr"],
  [style*="1.2fr 0.8fr"],
  [style*="1.3fr 0.7fr"],
  [style*="280px 1fr"],
  [style*="minmax(260px"],
  [style*="minmax(320px"] { grid-template-columns: minmax(0, 1fr) !important; }
  [style*="minmax(200px, 1fr)"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

  /* Type and touch targets */
  h1 { font-size: 22px !important; }
  .section-title { font-size: 20px; }
  .hero-title { font-size: 28px; }
  .hero-section { padding: 28px 0 22px; }
  .form-control { font-size: 16px; padding: 12px 14px; }
  .btn { min-height: 44px; }
  .copy-row { flex-wrap: wrap; gap: 8px; }
  .copy-number { font-size: 16px; word-break: break-all; }
  .data-table th, .data-table td { padding: 10px 12px; }

  /* Cart becomes stacked cards */
  .cart-item {
    grid-template-columns: 1fr auto auto;
    grid-template-areas:
      "main main rm"
      "qty  sub  sub";
    padding: 14px 16px;
  }
  .cart-actions { width: 100%; }
  .cart-actions .btn { flex: 1; justify-content: center; text-align: center; }
}

/* ---------- Small phones ---------- */
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .hero-title { font-size: 24px; }
}
