/* assets/css/style.css — Traffic Swarm Dark Theme */

@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Cinzel:wght@400;600;700&family=Poppins:wght@400;500;600;700&display=swap');

/* ── Variables ── */
:root {
  --black:   #050814;
  --dark:    #070d1c;
  --navy:    #0f172a;
  --navy2:   #1e293b;
  --gold:    #f5b700;
  --amber:   #ff9f1c;
  --lgold:   #ffd166;
  --cream:   #f8fafc;
  --muted:   #94a3b8;
  --line:    rgba(245,183,0,.22);
  --shadow:  0 0 35px rgba(245,183,0,.14), 0 24px 60px rgba(0,0,0,.55);
  --radius:  16px;
  --radius-lg: 26px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: var(--lgold); text-decoration: none; }
a:hover { color: var(--cream); }
img { max-width: 100%; }

/* ── Body ── */
body {
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 15px;
  color: var(--cream);
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, rgba(245,183,0,.16), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(255,159,28,.18), transparent 30%),
    linear-gradient(135deg, #050814 0%, #0a1222 42%, #0f1a2e 100%);
}

/* ── Page wrapper honeycomb ── */
.magic-bg {
  min-height: 100vh;
  padding: 18px;
  background-image:
    linear-gradient(30deg, transparent 24%, rgba(245,183,0,.05) 25%, rgba(245,183,0,.05) 26%, transparent 27%, transparent 74%, rgba(245,183,0,.05) 75%, rgba(245,183,0,.05) 76%, transparent 77%),
    linear-gradient(150deg, transparent 24%, rgba(245,183,0,.05) 25%, rgba(245,183,0,.05) 26%, transparent 27%, transparent 74%, rgba(245,183,0,.05) 75%, rgba(245,183,0,.05) 76%, transparent 77%);
  background-size: 72px 40px;
}

/* ── Site wrap ── */
.site-wrap {
  max-width: 1400px;
  margin: 0 auto;
  border-radius: 28px;
  overflow: visible;
  background: rgba(5,8,20,.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
}

/* ── Typography ── */
h1, h2, h3, h4 { font-family: 'Great Vibes', cursive; font-weight: 400; letter-spacing: .4px; color: var(--cream); }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }
p { line-height: 1.7; color: var(--muted); }

/* ── REFERRER POPUP CARD ── */
.ref-popup-card {
  position: fixed;
  top: 120px;
  right: 0;
  z-index: 1000;
  background: linear-gradient(145deg, rgba(14,26,50,.98), rgba(5,8,20,.99));
  border: 1px solid var(--gold);
  border-right: none;
  border-radius: 16px 0 0 16px;
  padding: 14px 16px 14px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: -6px 0 32px rgba(245,183,0,.18), 0 8px 24px rgba(0,0,0,.5);
  min-width: 220px;
  max-width: 260px;
  transition: transform .3s ease;
}
.ref-popup-card:hover { transform: translateX(-4px); }
.ref-popup-close {
  position: absolute;
  top: 6px; right: 8px;
  background: none; border: none;
  color: var(--muted); font-size: 12px;
  cursor: pointer; line-height: 1;
  padding: 2px 4px;
  transition: color .15s;
}
.ref-popup-close:hover { color: var(--lgold); }
.ref-popup-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(245,183,0,.35);
}
.ref-popup-info { display: flex; flex-direction: column; gap: 3px; }
.ref-popup-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.2px; }
.ref-popup-name  { font-weight: 700; font-size: 17px; color: var(--cream); line-height: 1.2; }
.ref-popup-level { font-size: 13px; color: var(--lgold); }
.ref-popup-credits { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── SITE HEADER - full width 1400x350 ── */
.site-header {
  width: 100%;
  display: block;
  border-radius: 28px 28px 0 0;
  overflow: hidden;
  border-bottom: 2px solid var(--gold);
  position: relative;
}
.site-header-img {
  display: block;
  width: 100%;
  height: 350px;
  object-fit: cover;
  object-position: center center;
  border-radius: 0;
}

/* Shine sweep on header */
.site-header::after {
  content: "";
  position: absolute;
  inset: -80% auto auto -40%;
  width: 42%; height: 260%;
  background: linear-gradient(90deg, transparent, rgba(245,200,100,.3), transparent);
  transform: rotate(25deg);
  animation: shine 6s infinite;
  pointer-events: none;
}
@keyframes shine {
  0%, 65% { left: -55%; }
  100% { left: 130%; }
}

/* ── NAVIGATION ── */
.site-nav {
  background: linear-gradient(90deg, rgba(5,8,20,.96), rgba(10,18,34,.96));
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
  display: flex;
  align-items: stretch;
  gap: 2px;
  flex-wrap: nowrap;
  overflow: visible;
  min-height: 52px;
  position: relative;
  z-index: 400;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  padding: 14px 13px;
  color: var(--cream);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .01em;
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color .2s, border-color .2s, background .2s;
  cursor: pointer;
  background: none;
  border-top: 0; border-left: 0; border-right: 0;
}
.nav-item:hover, .nav-item.active {
  color: var(--lgold);
  border-bottom-color: var(--gold);
}
.nav-item.nav-surf {
  background: linear-gradient(135deg, var(--gold), var(--amber)) !important;
  color: #1b1200 !important;
  border-radius: 999px;
  margin: 9px 6px;
  padding: 6px 20px !important;
  border: none !important;
  box-shadow: 0 0 14px rgba(245,183,0,.4);
  font-size: 13px;
}
.nav-item.nav-surf:hover { box-shadow: 0 0 24px rgba(245,183,0,.65); transform: translateY(-1px); color: #1b1200 !important; }
.nav-item.nav-admin {
  color: var(--lgold) !important;
  border-bottom-color: var(--gold);
}
.nav-item.nav-logout {
  color: #fca5a5 !important;
  border-bottom-color: rgba(239,68,68,.4);
}
.nav-item.nav-logout:hover { background: rgba(239,68,68,.1) !important; }
.nav-right-group {
  display: flex; align-items: center; gap: 10px; margin-left: auto;
}
.nav-credits-badge {
  color: var(--lgold); font-weight: 700; font-size: 13px;
  white-space: nowrap; padding: 0 6px;
}

/* ── DROPDOWN MENUS ── */
.nav-dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}
.nav-drop-btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 13px;
  color: var(--cream);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .01em;
  white-space: nowrap;
  border: none;
  border-bottom: 3px solid transparent;
  background: none;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.nav-drop-btn:hover, .nav-drop-btn.active {
  color: var(--lgold);
  border-bottom-color: var(--gold);
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 220px;
  background: linear-gradient(180deg, rgba(10,18,34,.99), rgba(5,8,20,.99));
  border: 1px solid var(--gold);
  border-top: 2px solid var(--gold);
  border-radius: 0 0 14px 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,.7), 0 0 24px rgba(245,183,0,.12);
  z-index: 600;
  overflow: hidden;
  padding: 6px 0;
}
.nav-dropdown-menu.open {
  display: block !important;
  animation: dropIn .15s ease-out;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: var(--muted);
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.nav-dropdown-menu a:hover {
  background: rgba(245,183,0,.10);
  color: var(--lgold);
  border-left-color: var(--gold);
}

/* ── Wide nav buttons (public) ── */
.nav-wide { flex: 1; max-width: 200px; justify-content: center; font-size: 14px; }

/* ── PAGE BODY ── */
.page-body {
  display: grid;
  grid-template-columns: 155px 1fr 155px;
  gap: 20px;
  padding: 22px;
  background:
    radial-gradient(circle at center, rgba(245,183,0,.04), transparent 45%),
    linear-gradient(180deg, #060a18, #0a1525 56%, #070d1c);
  min-height: 500px;
}
.page-content { min-width: 0; }
.sidebar { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.sidebar-left, .sidebar-right { display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* ── Banner slots ── */
.banner-slot-468 {
  width: 468px; height: 60px; flex-shrink: 0;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
  border: 1px solid rgba(245,183,0,.28);
  background: linear-gradient(90deg, #0a1830, #070d1c, #0f2040);
  color: var(--lgold); font-size: 12px;
}
.banner-slot-468 img { width: 468px; max-width: 100%; height: 60px; object-fit: cover; display: block; }

.banner-slot-125 {
  width: 125px; height: 125px;
  border-radius: 18px;
  border: 1px solid rgba(245,183,0,.28);
  background:
    radial-gradient(circle at 30% 20%, rgba(245,183,0,.10), transparent 30%),
    linear-gradient(145deg, #0f1e35, #070d1c 55%, #0a1830);
  color: var(--lgold);
  display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 11px; font-weight: 600;
  overflow: hidden; position: relative;
}
.banner-slot-125 img { width: 125px; height: 125px; object-fit: cover; display: block; }
.banner-slot-125::before,
.banner-slot-468::before {
  content: "";
  position: absolute; inset: -80% auto auto -40%;
  width: 42%; height: 260%;
  background: linear-gradient(90deg, transparent, rgba(245,200,100,.3), transparent);
  transform: rotate(25deg);
  animation: shine 5.8s infinite;
  pointer-events: none; z-index: 1;
}

/* ── Cards ── */
.card {
  background: linear-gradient(145deg, rgba(14,26,50,.96), rgba(5,8,20,.96));
  border: 1px solid rgba(245,183,0,.18);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 16px 34px rgba(0,0,0,.38), inset 0 0 30px rgba(245,183,0,.02);
  position: relative; overflow: hidden;
}
.card > * { position: relative; z-index: 1; }
.card-title {
  font-family: 'Cinzel', serif; font-size: 1.2rem; color: var(--lgold);
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}

/* ── Tables ── */
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data-table th {
  background: rgba(245,183,0,.12); color: var(--lgold);
  padding: 10px 12px; text-align: left; font-weight: 600;
  border-bottom: 1px solid var(--line);
}
table.data-table td { padding: 10px 12px; border-bottom: 1px solid rgba(245,183,0,.07); color: var(--muted); vertical-align: middle; }
table.data-table tr:hover td { background: rgba(245,183,0,.05); }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--lgold); margin-bottom: 6px; }
.form-group small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=url], input[type=date], textarea, select {
  width: 100%; padding: 10px 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(245,183,0,.22);
  border-radius: 10px; color: var(--cream);
  font-family: 'Poppins', Arial, sans-serif; font-size: 14px;
  transition: border-color .2s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245,183,0,.12);
}
select option { background: #0a1222; color: var(--cream); }
textarea { min-height: 120px; resize: vertical; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 999px;
  font-family: 'Poppins', Arial, sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; border: 0; transition: .2s; text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--amber));
  color: #1b1200; box-shadow: 0 8px 22px rgba(245,183,0,.25);
}
.btn-primary:hover { box-shadow: 0 10px 28px rgba(245,183,0,.45); transform: translateY(-1px); color: #1b1200; }
.btn-secondary {
  background: rgba(245,183,0,.10); border: 1px solid rgba(245,183,0,.25); color: var(--lgold);
}
.btn-secondary:hover { background: rgba(245,183,0,.20); color: var(--cream); }
.btn-danger { background: linear-gradient(135deg, #6b0f0f, #c0392b); color: white; }
.btn-success { background: linear-gradient(135deg, #1a5c1a, #27ae60); color: white; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 11px; }

/* ── Flash ── */
.flash { padding: 12px 18px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.flash-success { background: rgba(39,174,96,.15); border: 1px solid rgba(39,174,96,.4); color: #7dff9b; }
.flash-error   { background: rgba(192,57,43,.18); border: 1px solid rgba(192,57,43,.5); color: #ff9b9b; }

/* ── Badges ── */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-free      { background: rgba(148,163,184,.15); color: var(--muted);  border: 1px solid rgba(148,163,184,.3); }
.badge-bronze    { background: rgba(205,127,50,.2);   color: #cd7f32;       border: 1px solid rgba(205,127,50,.4); }
.badge-silver    { background: rgba(192,192,192,.15); color: #c0c0c0;       border: 1px solid rgba(192,192,192,.3); }
.badge-gold      { background: rgba(245,183,0,.18);   color: var(--lgold);  border: 1px solid rgba(245,183,0,.4); }
.badge-active    { background: rgba(39,174,96,.15);   color: #7dff9b;       border: 1px solid rgba(39,174,96,.3); }
.badge-pending   { background: rgba(241,196,15,.15);  color: #f1c40f;       border: 1px solid rgba(241,196,15,.3); }
.badge-paused    { background: rgba(127,140,141,.15); color: #95a5a6;       border: 1px solid rgba(127,140,141,.3); }
.badge-suspended { background: rgba(192,57,43,.15);   color: #e74c3c;       border: 1px solid rgba(192,57,43,.3); }

/* ── Stats ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; margin-bottom: 22px; }
.stat-box {
  background: linear-gradient(145deg, rgba(14,26,50,.96), rgba(5,8,20,.96));
  border: 1px solid rgba(245,183,0,.18); border-radius: var(--radius);
  padding: 18px; text-align: center; position: relative; overflow: hidden;
}
.stat-box .stat-num   { font-family: 'Cinzel', serif; font-size: 2rem; color: var(--lgold); line-height: 1; }
.stat-box .stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── FOOTER ── */
.site-footer {
  border-top: 2px solid var(--gold);
  border-radius: 0 0 28px 28px;
  overflow: hidden;
  background: linear-gradient(135deg, #040710, #0a1222, #040710);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
  min-height: 400px;
}
.footer-left {
  padding: 48px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}
.footer-logo-text {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--lgold);
  text-shadow: 0 0 20px rgba(245,183,0,.3);
}
.footer-tagline {
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links a {
  color: var(--muted);
  font-size: 14px;
  transition: color .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
/* footer link bullets handled in HTML */
.footer-links a:hover { color: var(--lgold); }
.footer-copy {
  color: rgba(148,163,184,.5);
  font-size: 13px;
  margin-top: 8px;
}
.footer-copy a { color: rgba(245,183,0,.5); }
.footer-powered { font-size: 12px; color: rgba(148,163,184,.3); }
.footer-powered a { color: rgba(245,183,0,.3); }
.footer-powered a:hover { color: var(--gold); }
.footer-right {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}
.footer-right img {
  display: block;
  max-height: 400px;
  width: auto;
  object-fit: contain;
  object-position: bottom right;
}

/* ── Pagination ── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: 8px; font-size: 13px; background: rgba(245,183,0,.08); border: 1px solid rgba(245,183,0,.18); color: var(--lgold); }
.pagination .current { background: var(--gold); color: #1b1200; border-color: var(--gold); }
.pagination a:hover { background: rgba(245,183,0,.22); color: var(--cream); }

/* ── Modal ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 9999; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal-box {
  background: linear-gradient(145deg, #0f1e35, #070d1c);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 30px; max-width: 540px; width: 100%; box-shadow: var(--shadow);
}
.modal-title { font-family: 'Cinzel', serif; font-size: 1.4rem; color: var(--lgold); margin-bottom: 16px; }

/* ── Eyebrow ── */
.eyebrow { color: var(--gold); font-weight: 700; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 8px; }

/* ── Inner grid ── */
.inner-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; width: 100%; }
@media (max-width: 900px) { .inner-grid { grid-template-columns: 1fr; } }

/* ── Surf bar ── */
.surfbar {
  background: linear-gradient(135deg, #040710, #0d1a30, #0f2040);
  border-bottom: 2px solid var(--gold);
  padding: 10px 18px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.surfbar-advertiser { display: flex; align-items: center; gap: 10px; }
.surfbar-advertiser img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--gold); }
.surfbar-advertiser .adv-name { font-size: 13px; font-weight: 700; color: var(--lgold); }
.surfbar-stats { font-size: 13px; color: var(--muted); }
.surfbar-stats strong { color: var(--lgold); }
.surfbar-actions { display: flex; gap: 8px; margin-left: auto; }
.timer-wrap { display: flex; align-items: center; gap: 10px; }
.timer-circle {
  width: 48px; height: 48px; border-radius: 50%;
  background: conic-gradient(var(--gold) var(--prog, 0%), rgba(245,183,0,.15) 0%);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: var(--lgold); position: relative;
}

/* ── Dice ── */
.dice { display: inline-block; font-size: 3rem; cursor: pointer; transition: transform .3s; user-select: none; }
.dice.rolling { animation: roll .4s ease-in-out; }
@keyframes roll { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-20deg) scale(1.2); } 75% { transform: rotate(20deg) scale(1.2); } }

/* ── Admin ── */
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; min-height: 100vh; flex-shrink: 0;
  background: linear-gradient(180deg, #040710, #0a1222);
  border-right: 1px solid var(--line); padding: 0 0 30px;
}
.admin-sidebar .admin-logo {
  padding: 20px; border-bottom: 1px solid var(--line);
  font-family: 'Cinzel', serif; font-size: 1.2rem; color: var(--lgold);
}
.admin-sidebar .admin-logo span { color: var(--muted); font-family: 'Poppins', sans-serif; font-size: 11px; display: block; margin-top: 2px; }
.admin-nav-section { padding: 14px 16px 4px; font-size: 10px; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; color: var(--muted); font-size: 13px;
  border-left: 3px solid transparent; transition: .2s; text-decoration: none;
}
.admin-nav a:hover, .admin-nav a.active {
  color: var(--lgold); background: rgba(245,183,0,.10); border-left-color: var(--gold);
}
.admin-content {
  flex: 1; padding: 28px;
  background: linear-gradient(180deg, #060a18, #0a1525 60%, #070d1c);
  min-height: 100vh;
}
.admin-page-title {
  font-family: 'Cinzel', serif; font-size: 1.8rem; color: var(--cream);
  margin-bottom: 22px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .page-body { grid-template-columns: 145px 1fr; }
  .sidebar-right { display: none; }
}
@media (max-width: 850px) {
  .page-body { grid-template-columns: 1fr; }
  .sidebar-left { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .site-nav { flex-wrap: wrap; }
  .ref-popup-card { position: fixed; top: auto; bottom: 20px; right: 20px; border-radius: 16px; border: 1px solid var(--gold); }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-right { justify-content: center; }
  .footer-right img { max-height: 250px; }
}
@media (max-width: 600px) {
  .magic-bg { padding: 8px; }
  .site-header-img { height: 200px; }
  .footer-left { padding: 28px 20px; }
}