/* =========================================================
   GAME TOP-UP WEBSITE — STYLESHEET
   ========================================================= */

:root {
  --bg: #0b0e17;
  --bg-alt: #10131f;
  --surface: #161a2b;
  --surface-2: #1d2236;
  --border: #262c45;
  --text: #e8eaf5;
  --text-muted: #8992b3;
  --primary: #7c5cff;
  --primary-2: #22d3ee;
  --primary-grad: linear-gradient(135deg, #7c5cff 0%, #22d3ee 100%);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3, h4 { font-weight: 700; margin: 0 0 10px; }
p { margin: 0 0 12px; color: var(--text-muted); }

/* =========================== BUTTONS =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--primary-grad);
  color: #fff;
  box-shadow: 0 6px 20px rgba(124,92,255,0.35);
}
.btn-primary:hover { opacity: 0.92; }
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); }
.btn-danger {
  background: rgba(239,68,68,0.12);
  color: var(--danger);
  border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.22); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

/* =========================== HEADER / NAV =========================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11,14,23,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--primary-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.logo-icon { -webkit-text-fill-color: initial; }
.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  flex: 1;
  justify-content: center;
}
.main-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 15px;
  transition: color .15s;
}
.main-nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.user-menu { position: relative; }
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 190px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
  flex-direction: column;
  z-index: 200;
}
.user-menu-dropdown.open { display: flex; }
.user-menu-dropdown a {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
}
.user-menu-dropdown a:hover { background: var(--surface-2); }
.text-danger { color: var(--danger) !important; }

/* =========================== HERO =========================== */
.hero {
  padding: 80px 20px 60px;
  text-align: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(124,92,255,0.25), transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(34,211,238,0.18), transparent 45%);
}
.hero-content { max-width: 780px; margin: 0 auto; }
.hero-badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--primary-2);
  margin-bottom: 20px;
}
.hero h1 {
  font-size: 44px;
  line-height: 1.15;
  margin-bottom: 18px;
  letter-spacing: -1px;
}
.hero p { font-size: 17px; max-width: 600px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 50px;
  flex-wrap: wrap;
}
.hero-stats div { display: flex; flex-direction: column; align-items: center; }
.hero-stats strong { font-size: 26px; background: var(--primary-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-stats span { font-size: 13px; color: var(--text-muted); }

/* =========================== SECTIONS =========================== */
.section { padding: 60px 20px; max-width: 1200px; margin: 0 auto; }
.section-alt { background: var(--bg-alt); border-radius: var(--radius); }
.section-heading { text-align: center; margin-bottom: 36px; }
.section-heading h2 { font-size: 30px; }
.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  margin-bottom: 20px;
}
.section-heading-row h2 { font-size: 22px; margin: 0; }
.link-more { color: var(--primary-2); font-weight: 600; font-size: 14px; }
.page-sub { margin-top: -6px; margin-bottom: 24px; }

/* =========================== GAME GRID =========================== */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}
.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  position: relative;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.game-card-img { aspect-ratio: 16/10; background: var(--surface-2); overflow: hidden; }
.game-card-img img { width: 100%; height: 100%; object-fit: cover; }
.game-card-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  background: var(--surface-2);
}
.game-card-body { padding: 16px; flex: 1; }
.game-card-body h3 { font-size: 17px; margin-bottom: 4px; }
.game-card-meta { font-size: 13px; margin-bottom: 6px; }
.game-card-price { color: var(--primary-2); font-weight: 700; font-size: 15px; margin: 0; }
.game-card-cta {
  display: block;
  padding: 12px 16px;
  background: var(--surface-2);
  color: var(--primary-2);
  font-weight: 600;
  font-size: 14px;
  border-top: 1px solid var(--border);
}

/* =========================== FEATURES =========================== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  padding: 0 20px 40px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
}
.feature-icon { font-size: 32px; margin-bottom: 12px; }

/* =========================== BREADCRUMB =========================== */
.breadcrumb { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--primary-2); }

/* =========================== GAME DETAIL / ORDER FORM =========================== */
.game-detail { max-width: 760px; margin: 0 auto; }
.game-detail-header { display: flex; gap: 20px; align-items: center; margin-bottom: 30px; flex-wrap: wrap; }
.game-detail-img {
  width: 110px; height: 110px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  flex-shrink: 0;
}
.game-detail-img img { width: 100%; height: 100%; object-fit: cover; }
.game-detail-desc { max-width: 500px; }

.order-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}
.form-block { margin-bottom: 22px; }
.form-label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.form-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
.form-input:focus { outline: none; border-color: var(--primary); }
.form-hint { font-size: 13px; margin-top: 6px; margin-bottom: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-check label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }

.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.package-option input { position: absolute; opacity: 0; pointer-events: none; }
.package-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg-alt);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.package-option input:checked + .package-card {
  border-color: var(--primary);
  background: rgba(124,92,255,0.1);
}
.package-name { font-weight: 600; font-size: 14px; }
.package-desc { font-size: 12px; color: var(--text-muted); }
.package-price { color: var(--primary-2); font-weight: 700; font-size: 15px; margin-top: 4px; }

.order-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 15px;
}
.order-summary strong { color: var(--primary-2); font-size: 20px; }

/* =========================== AUTH FORMS =========================== */
.auth-section { display: flex; justify-content: center; padding-top: 40px; }
.auth-box {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px;
}
.auth-box h1 { font-size: 24px; text-align: center; }
.auth-sub { text-align: center; margin-bottom: 24px; }
.auth-switch { text-align: center; margin-top: 18px; margin-bottom: 0; font-size: 14px; }
.auth-switch a { color: var(--primary-2); font-weight: 600; }
.admin-login-section { min-height: 100vh; align-items: center; }

/* =========================== ALERTS =========================== */
.alert {
  padding: 13px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid transparent;
}
.alert-success { background: rgba(34,197,94,0.12); color: #4ade80; border-color: rgba(34,197,94,0.3); }
.alert-error { background: rgba(239,68,68,0.12); color: #f87171; border-color: rgba(239,68,68,0.3); }
.alert-info { background: rgba(56,189,248,0.12); color: #38bdf8; border-color: rgba(56,189,248,0.3); }

/* =========================== STATS =========================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 34px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.stat-number { display: block; font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.stat-label { font-size: 13px; color: var(--text-muted); }
.stat-pending .stat-number { color: var(--warning); }
.stat-processing .stat-number { color: var(--info); }
.stat-completed .stat-number { color: var(--success); }
.stat-cancelled .stat-number { color: var(--danger); }
.stat-revenue .stat-number { color: var(--primary-2); font-size: 20px; }

/* =========================== TABLES =========================== */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th, .data-table td {
  padding: 14px 16px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.data-table tbody tr:hover { background: rgba(124,92,255,0.05); }
.data-table td.admin-actions, .data-table th:last-child { white-space: nowrap; }
.text-muted { color: var(--text-muted); }

/* =========================== BADGES =========================== */
.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-pending { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-processing { background: rgba(56,189,248,0.15); color: var(--info); }
.badge-completed { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-cancelled { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* =========================== EMPTY / FILTER =========================== */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.filter-tab {
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.filter-tab.active { background: var(--primary-grad); color: #fff; border-color: transparent; }
.filter-form { display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.filter-form .form-input { max-width: 320px; }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 24px; }
.page-link {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}
.page-link.active { background: var(--primary-grad); color: #fff; border-color: transparent; }

/* =========================== PROFILE / CARD =========================== */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
}
.card h2 { font-size: 19px; margin-bottom: 18px; }

/* =========================== FOOTER =========================== */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
  padding: 50px 20px;
}
.footer-logo { margin-bottom: 10px; }
.footer-col h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 14px; }
.footer-col a { display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 14px; }
.footer-col a:hover { color: var(--primary-2); }
.footer-bottom { text-align: center; padding: 18px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }

/* =========================== ADMIN LAYOUT =========================== */
.admin-body { background: var(--bg-alt); }
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 250px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-logo { padding: 0 8px 20px; display: block; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav a {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}
.admin-nav a:hover { background: var(--surface-2); color: var(--text); }
.admin-nav a.active { background: var(--primary-grad); color: #fff; }

.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 26px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  position: sticky;
  top: 0;
  z-index: 10;
}
.admin-topbar-title { font-size: 18px; font-weight: 700; flex: 1; }
.admin-topbar-user { font-size: 14px; color: var(--text-muted); white-space: nowrap; }
.admin-nav-toggle { display: none; }
.admin-content { padding: 26px; max-width: 1300px; }

.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.admin-thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.admin-thumb-placeholder { display: flex; align-items: center; justify-content: center; background: var(--surface-2); font-size: 20px; }
.admin-thumb-preview { width: 90px; height: 90px; object-fit: cover; border-radius: 10px; margin-top: 10px; }

.inline-form { display: inline-block; }
.inline-edit-form {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin: 8px 0;
  max-width: 560px;
  white-space: normal;
}
.inline-edit-actions { display: flex; gap: 10px; }
.edit-row td { white-space: normal; }

/* =========================== RESPONSIVE =========================== */
@media (max-width: 900px) {
  .form-row { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    z-index: 300;
    transition: left .2s ease;
    box-shadow: var(--shadow);
  }
  .admin-sidebar.open { left: 0; }
  .admin-nav-toggle { display: flex; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
    display: none;
    gap: 6px;
  }
  .main-nav.open { display: flex; }
  .hero h1 { font-size: 32px; }
  .hero-stats { gap: 24px; }
  .header-actions .btn span { display: none; }
}

@media (max-width: 480px) {
  .header-actions .btn-ghost { display: none; }
  .hero { padding: 50px 16px 40px; }
  .section { padding: 40px 16px; }
}
