/* ═══════════════════════════════════════════════════════
   Auto-Tok  –  Shared Stylesheet
   Modern dark theme with TikTok-inspired accents
   ═══════════════════════════════════════════════════════ */

/* ── Reset & Base ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Brand (shared) ── */
  --accent:     #25f4ee;        /* TikTok cyan  */
  --accent2:    #fe2c55;        /* TikTok red   */
  --accent3:    #8b5cf6;        /* Purple       */
  --success:    #10b981;
  --warning:    #f59e0b;
  --radius:     12px;
  --radius-sm:  8px;
  --transition: .25s cubic-bezier(.4,0,.2,1);
  --font:       'Inter', "Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",system-ui,sans-serif;
  --money-color: #31e501;

  /* ── Dark theme (default) ── */
  --bg-body:    #0a0e1a;
  --bg-card:    #111827;
  --bg-nav:     #0d1117;
  --bg-input:   #1a2236;
  --bg-hover:   #1c2740;
  --border:     #1e293b;
  --text:       #e2e8f0;
  --text-dim:   #94a3b8;
  --shadow:     0 4px 24px rgba(0,0,0,.35);
  --scrollbar-bg:   #0a0e1a;
  --scrollbar-thumb: #334155;
  --table-row-odd:  #131b2e;
  --table-row-even: #0a0e1a;
  --table-row-live-odd:  #0c2744;
  --table-row-live-even: #0a213a;
  --table-row-hover:     #12203a;
  --table-row-live-hover:#153051;
  --table-head-bg:  #1a2236;
  --admin-log-bg:   #0a0e1a;
  --nav-bg-mobile:  rgba(10,14,26,.97);
}

/* ── Light theme ── */
[data-theme="light"] {
  --bg-body:    #f0f2f5;
  --bg-card:    #ffffff;
  --bg-nav:     #ffffff;
  --money-color: #268f0a;
  --bg-input:   #f1f3f5;
  --bg-hover:   #e9ecef;
  --border:     #dee2e6;
  --text:       #1a1a2e;
  --text-dim:   #6c757d;
  --shadow:     0 4px 24px rgba(0,0,0,.08);
  --scrollbar-bg:   #f0f2f5;
  --scrollbar-thumb: #ced4da;
  --table-row-odd:  #f3f4f6;
  --table-row-even: #ffffff;
  --table-row-live-odd:  #e8f4fd;
  --table-row-live-even: #f0f8ff;
  --table-row-hover:     #e2e8f0;
  --table-row-live-hover:#d6eaf8;
  --table-head-bg:  #e2e8f0;
  --admin-log-bg:   #f8f9fa;
  --nav-bg-mobile:  rgba(255,255,255,.97);
}

html { scroll-behavior: smooth; overflow-x: hidden; width: 100%; }

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }

button, input, select, textarea {
  font-family: inherit;
}
a:hover { color: #5ff7f0; }

img { max-width: 100%; display: block; }

/* ── Navbar ─────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 64px;
  background: var(--bg-nav);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}

.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 22px; font-weight: 800;
  letter-spacing: -.5px;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-brand img {  width: 50px; flex-shrink: 0; }
.nav-brand span { white-space: nowrap; }

.nav-links {
  display: flex; align-items: center; gap: 10px;
  list-style: none;
}
.nav-links a {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px; font-weight: 600;
  color: var(--text-dim);
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  background: rgba(37,244,238,.08);
}
.nav-links a.active {
  color: var(--accent);
  background: rgba(37,244,238,.12);
}
.nav-links a .nav-icon { font-size: 16px; }
.nav-new-gif {
  width: 80px;
  vertical-align: middle;
  margin-inline-start: 4px;
  right: -17px;
  top: -1px;
  position: relative;
  z-index: 10;
  

}

/* ── Hamburger toggle button ── */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: all .25s ease;
  z-index: 1002;
  position: relative;
  align-items: center;
  justify-content: center;
  order: 3;
  margin-inline-start: 10px;
}
/* JS adds .hamburger-mode on the navbar when sidebar layout is active */
.navbar.hamburger-mode .nav-toggle {
  display: flex;
  order: 0;
  margin-inline-start: 0;
  margin-inline-end: 8px;
  flex-shrink: 0;
  min-width: 40px;
  min-height: 40px;
}
.navbar.hamburger-mode > div:last-child {
  order: 2;
  margin-inline-start: auto;
  flex-shrink: 0;
}
.navbar.hamburger-mode .nav-brand {
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
}

.navbar.hamburger-mode {
  padding: 0 12px;
  gap: 8px;
}

.navbar.hamburger-mode .nav-brand img {
  width: 44px;
}

.navbar.hamburger-mode .nav-brand span {
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}
/* Animate hamburger icon → X */
.nav-toggle .hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 20px;
  height: 18px;
  position: relative;
}
.nav-toggle .hamburger-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .3s ease;
  position: absolute;
}
.nav-toggle .hamburger-icon span:nth-child(1) { top: 0; }
.nav-toggle .hamburger-icon span:nth-child(2) { top: 8px; }
.nav-toggle .hamburger-icon span:nth-child(3) { top: 16px; }
/* Open state → X */
.nav-toggle.active .hamburger-icon span:nth-child(1) {
  top: 8px;
  transform: rotate(45deg);
}
.nav-toggle.active .hamburger-icon span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active .hamburger-icon span:nth-child(3) {
  top: 8px;
  transform: rotate(-45deg);
}

.user-dropdown-menu {
  right: 0;
  left: auto;
}
[dir="rtl"] .user-dropdown-menu {
  right: auto;
  left: 0;
}

/* ── Sidebar overlay (backdrop) ── */
.nav-overlay {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,.45);
  z-index: 999;
  opacity: 0;
  transition: opacity .3s ease;
}
.nav-overlay.show {
  display: block;
  opacity: 1;
}
[data-theme="light"] .nav-overlay {
  background: rgba(0,0,0,.25);
}

/* ── Sidebar panel (hidden by default, shown via JS) ── */
.nav-links.sidebar-mode {
  display: none;
  position: fixed;
  top: 64px;
  bottom: 0;
  right: 0;
  left: auto;
  height: calc(100vh - 64px);
  width: 260px;
  flex-direction: column;
  align-items: flex-start;
  background: var(--bg-card);
  padding: 20px;
  gap: 6px;
  z-index: 1001;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0,0,0,.15);
  animation: sidebarSlideIn .3s ease forwards;
}
[dir="rtl"] .nav-links.sidebar-mode {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 20px rgba(0,0,0,.15);
  animation: sidebarSlideInRTL .3s ease forwards;
}
/* When open: display flex */
.nav-links.sidebar-mode.open {
  display: flex;
}
.nav-links.sidebar-mode li { width: 100%; display: block; }
.nav-links.sidebar-mode li a {
  width: 100%;
  display: flex;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
}
.nav-links.sidebar-mode li a:hover {
  background: var(--bg-hover);
}

@media (max-width: 640px) {
  .navbar.hamburger-mode > div:last-child {
    gap: 6px !important;
  }

  .navbar.hamburger-mode #viewportToggle {
    display: none;
  }

  .navbar.hamburger-mode .user-nav-dropdown #userNavBtn {
    padding: 4px 8px !important;
    max-width: 110px;
    overflow: hidden;
  }

  .navbar.hamburger-mode .user-nav-dropdown #userNavBtn > span:first-of-type {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 56px;
    display: inline-block;
  }

  .navbar.hamburger-mode .btn.btn-sm.btn-primary[data-i18n="nav.login"] {
    padding: 6px 10px !important;
    font-size: 11px !important;
  }
}

/* Slide-in animations */
@keyframes sidebarSlideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes sidebarSlideInRTL {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

/* ── Page Container ─────────────────────────────────── */
.page-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* ── Cards ──────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

/* ── Section title ──────────────────────────────────── */
.section-title {
  font-size: 20px; font-weight: 700;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.section-title .badge {
  background: rgba(37,244,238,.12);
  color: var(--accent);
  font-size: 12px; font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── Dashboard Table ────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table thead th {
  background: var(--table-head-bg);
  padding: 14px 12px;
  text-align: center;
  font-weight: 700;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
.data-table thead th:hover { background: var(--bg-hover); }
.data-table th.sort-asc::after  { content: " ▲"; font-size: 10px; color: var(--accent); }
.data-table th.sort-desc::after { content: " ▼"; font-size: 10px; color: var(--accent); }

.data-table tbody td {
  padding: 12px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  transition: background var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.data-table tbody tr:nth-child(odd)  td { background: var(--table-row-odd); }
.data-table tbody tr:nth-child(even) td { background: var(--table-row-even); }
.data-table tbody tr.live:nth-child(odd)  td { background: var(--table-row-live-odd); }
.data-table tbody tr.live:nth-child(even) td { background: var(--table-row-live-even); }
.data-table tbody tr:hover td {
  background: var(--table-row-hover);
  box-shadow: inset 0 1px 0 rgba(37,244,238,.22), inset 0 -1px 0 rgba(37,244,238,.22);
}
.data-table tbody tr.live:hover td  {
  background: var(--table-row-live-hover);
  box-shadow: inset 0 1px 0 rgba(37,244,238,.30), inset 0 -1px 0 rgba(37,244,238,.30);
}

[data-theme="light"] .data-table .streamer-link {
    color: #6b21a8;
    text-decoration: none;
    cursor: pointer;
    font-size: large;
}

[data-theme="dark"] .data-table .streamer-link {
    color: #25f4ee;
    text-decoration: none;
    cursor: pointer;
    font-size: large;
}

[data-theme="light"] .data-table .play-icon {
    content: url("../img/go_live.png");
}

[data-theme="light"] .data-table .head-play-icon {
    content: url("../img/show_live.png");
    width: 33px !important;
}

[data-theme="dark"] .data-table .head-play-icon {
    content: url("../img/go_live.png");
}

/* Flip only play-column icons in English */
html[lang="en"] .data-table th[data-key="view"] .play-icon,
html[lang="en"] .data-table .view-btn .play-icon {
  transform: scaleX(-1);
}

/* Keep Arabic/default orientation */
html[lang="ar"] .data-table th[data-key="view"] .play-icon,
html[lang="ar"] .data-table .view-btn .play-icon {
  transform: scaleX(1);
}

/* Status pills */
.pill { display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.pill-live { background: var(--success); color: #001e0c; }
.pill-off  { background: #334155; color: #94a3b8; }

/* Numeric */
.num { font-variant-numeric: tabular-nums; font-family: var(--font); }

/* Avatar */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; background: var(--bg-input);
  border: 21px solid var(--border);
}
.avatar.avatar-live {
  border: 1.8px solid #ef4444;
  box-shadow: 0 0 0 2.5px rgba(239,68,68,.35);
  animation: avatar-live-pulse 2s ease-in-out infinite;
}
@keyframes avatar-live-pulse {
  0%, 100% { box-shadow: 0 0 0 2.5px rgba(239,68,68,.35); }
  50%      { box-shadow: 0 0 0 5px rgba(239,68,68,.15); }
}

/* Gift cell */
.gift-cell { display: flex; align-items: center; gap: 8px; justify-content: center; }
.gift-thumb {
  width: 50px; height: 50px; object-fit: contain;
  border-radius: 6px; background: var(--bg-input);
  padding: 2px; border: 1px solid var(--border);
}
.gift-name  { font-size: 2px; color: var(--text-dim);display: none; }
.gift-count {
  min-width: 24px; text-align: center; padding: 2px 8px;
  border-radius: 12px; font-size: 14px; font-weight: 700;
  background: rgba(37,244,238,.1); border: 1px solid var(--border);
}

[data-theme="light"] .gift-count {
  color: #6b21a8;
}

[data-theme="dark"] .gift-count {
  color: #25f4ee;
}

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.btn-primary   { background: var(--accent); color: #0a0e1a; }
.btn-primary:hover { background: #5ff7f0; box-shadow: 0 0 20px rgba(37,244,238,.3); }
.btn-danger    { background: var(--accent2); color: #fff; }
.btn-danger:hover  { background: #ff4d73; box-shadow: 0 0 20px rgba(254,44,85,.3); }
.btn-secondary { background: var(--bg-input); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #12d495; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-icon { padding: 8px 12px; font-size: 18px; }

/* ── Forms / Inputs ─────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--text-dim); }
.form-input, .form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,244,238,.15);
}
.form-input::placeholder { color: #475569; }

/* ── Pricing Cards ──────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 20px;
}
.price-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
}
.price-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
.price-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 30px rgba(37,244,238,.1);
}
.price-card.featured::before {
  content: none;
}
.price-name  { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.price-amount {
  font-size: 48px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 16px 0 4px;
}
.price-period { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }
.price-features {
  list-style: none; text-align: right;
  margin-bottom: 28px;
}
.price-features li {
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-dim);
  display: flex; align-items: center; gap: 8px;
}
.price-features li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
}

/* ── Admin Panel ────────────────────────────────────── */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.admin-card-title {
  font-size: 14px; font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 16px;
}
.status-indicator {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600;
}
.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  animation: pulse 2s infinite;
}
.status-dot.online  { background: var(--success); }
.status-dot.offline { background: var(--accent2); animation: none; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
  50%      { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}

.admin-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 12px;
}
.admin-log {
  background: var(--admin-log-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: 12px;
  color: var(--success);
  max-height: 280px;
  overflow-y: auto;
  line-height: 1.8;
}
.admin-log .log-time  { color: #475569; }
.admin-log .log-warn  { color: var(--warning); }
.admin-log .log-error { color: var(--accent2); }

/* ── Login Box ──────────────────────────────────────── */
.login-wrapper {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 64px);
}
.login-box {
  width: 100%; max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-box h2 { margin-bottom: 8px; }
.login-box p  { color: var(--text-dim); font-size: 14px; margin-bottom: 28px; }
.login-error {
  background: rgba(254,44,85,.1);
  border: 1px solid rgba(254,44,85,.3);
  color: var(--accent2);
  padding: 10px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px;
  display: none;
}

/* ── Coming Soon ────────────────────────────────────── */
.coming-soon {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: calc(100vh - 180px);
  text-align: center;
}
.coming-soon h1 {
  font-size: 56px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}
.coming-soon p { color: var(--text-dim); font-size: 18px; max-width: 500px; }

/* ── Subscribe Page ─────────────────────────────────── */
.subscribe-wrapper {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 180px);
}
.subscribe-box {
  width: 100%; max-width: 460px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow);
}
.subscribe-box h2 { text-align: center; margin-bottom: 8px; }
.subscribe-box .sub-desc { text-align: center; color: var(--text-dim); font-size: 14px; margin-bottom: 28px; }

.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  margin-bottom: 12px;
}
.social-btn:hover { background: var(--bg-hover); border-color: var(--accent); }
.social-btn svg { width: 20px; height: 20px; }

.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
  color: var(--text-dim); font-size: 13px;
}
.divider::before, .divider::after {
  content: ''; flex: 1;
  height: 1px; background: var(--border);
}

/* ── Help Page ──────────────────────────────────────── */
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
}
.faq-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.faq-q { font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.faq-a { color: var(--text-dim); font-size: 14px; line-height: 1.7; }

.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 600px;
}

/* ── Theme Toggle ───────────────────────────────────── */
.theme-toggle {
  width: 44px;
  height: 24px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
  flex-shrink: 0;
}
.theme-toggle::after {
  content: '🌙';
  font-size: 12px;
  position: absolute;
  top: 2px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--accent2);
  border-radius: 50%;
  transition: all .3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme="light"] .theme-toggle::after {
  content: '☀️';
  left: 21px;
}
.theme-toggle:hover { border-color: var(--accent2); }

/* ── Light theme color overrides for specific elements ── */
[data-theme="light"] .nav-brand span { color: #1a1a2e; }

[data-theme="light"] a { color: #6b21a8; }
[data-theme="light"] a:hover { color: #8b5cf6; }

[data-theme="light"] .nav-links a:hover,
[data-theme="light"] .nav-links a.active {
  color: #6b21a8;
  background: rgba(107, 33, 168, 0.08);
}
[data-theme="light"] .nav-links a.active {
  background: rgba(107, 33, 168, 0.12);
}

[data-theme="dark"] .nav-brand span {
  background: linear-gradient(90deg, #ff3b5c, #ff904f, #d5a46e, #9fc29a, #47dfd6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  font-weight: 800;
}

[data-theme="light"] .pill-off { background: #dee2e6; color: #6c757d; }
[data-theme="light"] .admin-log { color: #198754; }
[data-theme="light"] .card { box-shadow: 0 2px 12px rgba(0,0,0,.06); }
[data-theme="light"] .stat-card { box-shadow: 0 2px 8px rgba(0,0,0,.04); }

/* ── Footer ─────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 24px;
  color: var(--text-dim);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

/* ── Utilities ──────────────────────────────────────── */
.text-center { text-align: center; }
.text-dim    { color: var(--text-dim); }
.mt-1 { margin-top:  8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 16px; }
.flex  { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-bg); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent2); }

/* ── Stats bar (dashboard header) ───────────────────── */
.stats-bar {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  flex: 1; min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.stat-icon.cyan   { background: rgba(37,244,238,.1); color: var(--accent); }
.stat-icon.red    { background: rgba(254,44,85,.1);  color: var(--accent2); }
.stat-icon.purple { background: rgba(139,92,246,.1); color: var(--accent3); }
.stat-icon.green  { background: rgba(16,185,129,.1); color: var(--success); }
.stat-value { font-size: 22px; font-weight: 800; }
.stat-label { font-size: 12px; color: var(--text-dim); }

/* Pro badge */
.pro-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, var(--accent3), var(--accent2));
  color: #fff;
  font-size: 11px; font-weight: 800;
  padding: 2px 10px; border-radius: 20px;
}

/* ══ RTL (Arabic) overrides ════════════════════════════ */
[dir="rtl"] {
  --font: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
}
[dir="rtl"] body { font-family: var(--font); }
[dir="rtl"] .data-table th,
[dir="rtl"] .data-table td,
[dir="rtl"] .data-table .num { text-align: center; }
  /* Navbar RTL support handles automatically now */
[dir="rtl"] .gift-cell { direction: ltr; }
[dir="rtl"] .admin-log { direction: ltr; text-align: left; }
[dir="rtl"] .price-period { direction: ltr; }
[dir="rtl"] pre { direction: ltr; text-align: left; }
[dir="rtl"] input[dir="ltr"] { direction: ltr; text-align: left; }

/* ══════════════════════════════════════════════════════════
   STORE PAGE — Balance Top-up (TikTok-style)
   ══════════════════════════════════════════════════════════ */

.store-balance-card {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, rgba(255,215,0,.08), rgba(255,215,0,.02));
  border: 1px solid rgba(255,215,0,.2);
  border-radius: var(--radius); padding: 20px 24px;
}
.store-balance-icon { flex-shrink: 0; }
.store-balance-info { flex: 1; }
.store-balance-label { font-size: 13px; color: var(--text-dim); margin-bottom: 4px; }
.store-balance-amount { font-size: 32px; font-weight: 800; color: #FFD700; display: flex; align-items: baseline; gap: 6px; }
.store-coin-label { font-size: 14px; color: var(--text-dim); font-weight: 500; }

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.coin-card {
  background: var(--bg-card); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 24px 16px;
  text-align: center; cursor: pointer;
  transition: var(--transition); position: relative;
}
.coin-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,244,238,.1); }
.coin-card.popular { border-color: var(--accent2); }
.coin-card.popular:hover { border-color: var(--accent2); box-shadow: 0 8px 24px rgba(254,44,85,.15); }
.coin-card-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--accent2); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 12px; border-radius: 12px;
}
.coin-card-coins { display: flex; align-items: center; justify-content: center; gap: 8px; }
.coin-icon { font-size: 28px; }
.coin-amount { font-size: 28px; font-weight: 800; color: var(--text-primary); }
.coin-card-label { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.coin-card-price { font-size: 15px; font-weight: 700; color: var(--accent); margin-top: 8px; }

.payment-method-card {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 20px;
  font-size: 14px; font-weight: 600;
}

/* Store Modal */
.store-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; backdrop-filter: blur(8px);
}
.store-modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; width: 90%; max-width: 440px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.store-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.store-modal-header h3 { margin: 0; font-size: 16px; }
.store-modal-close {
  background: none; border: none; color: var(--text-dim);
  font-size: 22px; cursor: pointer; line-height: 1;
}
.store-modal-body { padding: 24px 28px; }
.store-modal-summary { text-align: center; margin-bottom: 20px; }
.store-modal-coins { display: flex; align-items: center; justify-content: center; gap: 8px; }
.store-paypal-btn {
  display: flex; align-items: center; justify-content: center;
  background: #0070BA; border: none; color: #fff;
  font-weight: 700; padding: 14px;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: var(--transition);
}
.store-paypal-btn:hover { background: #005ea6; }

.store-history-table { overflow-x: auto; border-radius: 8px; margin-top: 8px; }
.store-history-table .data-table { margin: 0; font-size: 12px; }

@media (max-width: 600px) {
  .store-balance-card { flex-direction: column; text-align: center; }
  .store-balance-amount { justify-content: center; font-size: 26px; }
  .store-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .coin-card { padding: 16px 10px; }
  .coin-amount { font-size: 22px; }
}
@media (max-width: 600px) {
  .stat-card { padding: 12px 10px; gap: 8px; min-width: 140px; }
  .stat-value { font-size: clamp(14px, 4.5vw, 18px); word-break: break-all; }
  .stat-icon { width: 36px; height: 36px; font-size: 16px; }
}

/* ═══════════════════════════════════════════════════════
   Stripe Integration Styles
   ═══════════════════════════════════════════════════════ */

.stripe-checkout-modal {
  max-width: 460px;
}

/* Stripe Buttons */
.stripe-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  line-height: 1.4;
}
.stripe-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}
.stripe-btn-primary {
  background: linear-gradient(135deg, #635BFF, #7B73FF);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 91, 255, 0.25);
}
.stripe-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #7B73FF, #8F89FF);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 91, 255, 0.35);
}
.stripe-btn-paypal {
  background: #FFC439;
  color: #003087;
  box-shadow: 0 2px 8px rgba(255, 196, 57, 0.2);
}
.stripe-btn-paypal:hover {
  background: #FFD060;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 196, 57, 0.3);
}

/* Payment Methods Divider */
.payment-methods-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.payment-methods-divider::before,
.payment-methods-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Accepted Card Logos */
.stripe-accepted-cards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 0;
  flex-wrap: wrap;
}
.stripe-card-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  line-height: 1.4;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.stripe-card-badge:hover {
  opacity: 1;
}

/* Currency Selector */
.stripe-currency-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.stripe-currency-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.stripe-currency-btn:hover {
  border-color: rgba(99, 91, 255, 0.4);
  color: var(--text);
  background: rgba(255,255,255,0.02);
}
.stripe-currency-btn.active {
  border-color: #635BFF;
  background: rgba(99, 91, 255, 0.08);
  color: #635BFF;
  box-shadow: 0 0 0 1px rgba(99, 91, 255, 0.2);
}
.stripe-currency-flag {
  font-size: 18px;
  line-height: 1;
}

/* Summary Card (in modal) */
.stripe-summary-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
[data-theme="light"] .stripe-summary-card {
  background: rgba(99, 91, 255, 0.04);
  border-color: rgba(99, 91, 255, 0.15);
}

/* Powered by Stripe Badge */
.stripe-powered-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.7;
}

/* Stripe Success Page */
.stripe-success-container {
  max-width: 520px;
  margin: 60px auto;
  text-align: center;
  padding: 48px 36px;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.stripe-success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: rgba(16, 185, 129, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive */
@media (max-width: 480px) {
  .stripe-checkout-modal { max-width: 95vw; }
  .stripe-success-container { margin: 30px 12px; padding: 32px 20px; }
  .stripe-btn { padding: 12px 16px; font-size: 14px; }
}
