/* ═══════════════════════════════════════════
   LULU VOTE DASHBOARD — Multi-Page Dark Theme
   v2: Full data + pagination + search
   ═══════════════════════════════════════════ */

:root {
  --bg: #07090f;
  --surface: #111;
  --surface-2: #161616;
  --border: #1f1f1f;
  --text: #ededed;
  --text-dim: #888;
  --accent: #00ffaa;
  --accent2: #a78bfa;
  --red: #ff6b6b;
  --yellow: #ffd93d;
  --blue: #60a5fa;
  --radius: 12px;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(124, 92, 255, 0.15), transparent 60%),
    radial-gradient(ellipse 60% 70% at 100% 80%, rgba(167, 139, 250, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

/* ─── Global Starfield (V3 Background) ─── */
.bg-starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-starfield .star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: bg-twinkle var(--dur, 3s) ease-in-out infinite alternate;
}
@keyframes bg-twinkle {
  0% { opacity: 0.05; transform: scale(0.8); }
  100% { opacity: 0.7; transform: scale(1.3); }
}

/* ─── Moon Glow (top-right) ─── */
.bg-moon-glow {
  position: fixed;
  top: 6%;
  right: 6%;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.07), transparent 70%);
  border-radius: 50%;
  filter: blur(24px);
  pointer-events: none;
  z-index: 0;
}

/* Bring real content above bg layers */
.navbar, .page-header, .container, .footer { position: relative; z-index: 2; }

/* ─── Scroll Reveal ─── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s cubic-bezier(.4, 0, .2, 1), transform 1.2s cubic-bezier(.4, 0, .2, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ─── Navbar (Variant C — Top Glow Border + Pill) ─── */
.navbar {
  background: rgba(17, 17, 17, 0.72);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-top: 1px solid;
  border-image: linear-gradient(90deg, transparent, var(--accent), transparent) 1;
  border-bottom: 1px solid rgba(167, 139, 250, 0.08);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 0.9rem; color: var(--accent); text-decoration: none; display: flex; align-items: center; gap: 6px; }
.brand-sub { color: var(--text-dim); font-size: 0.8rem; font-weight: 400; }
.nav-links {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 3px;
}
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav-links a.active {
  color: #fff;
  background: rgba(167, 139, 250, 0.15);
  box-shadow: 0 0 16px rgba(167, 139, 250, 0.25), inset 0 0 0 1px rgba(167, 139, 250, 0.2);
}

/* ─── Page Header ─── */
.page-header {
  max-width: 1200px;
  margin: 32px auto 24px;
  padding: 0 24px;
  position: relative;
  overflow: hidden;
}
.page-header h1 { font-size: 1.75rem; margin-bottom: 4px; position: relative; z-index: 1; }
.page-header p { color: var(--text-dim); font-size: 0.95rem; position: relative; z-index: 1; }

/* ─── Starfield (header strip) ─── */
.stars-strip{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:0;overflow:hidden}
.stars-strip .star{position:absolute;width:2px;height:2px;background:#fff;border-radius:50%;animation:twinkle-strip var(--dur) ease-in-out infinite alternate}
@keyframes twinkle-strip{0%{opacity:.05;transform:scale(.8)}100%{opacity:.6;transform:scale(1.2)}}

/* ─── Starfield (full page - Terima Kasih) ─── */
.stars-full{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:0}
.stars-full .star{position:absolute;width:2px;height:2px;background:#fff;border-radius:50%;animation:twinkle-full var(--dur) ease-in-out infinite alternate}
@keyframes twinkle-full{0%{opacity:.08;transform:scale(.8)}100%{opacity:.7;transform:scale(1.2)}}

/* ─── Container ─── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px 32px; }
.section { margin-bottom: 28px; }
.section h2 { color: var(--text); font-size: 1.1rem; margin-bottom: 16px; }

/* ─── Overview Cards ─── */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-icon { font-size: 1.6rem; margin-bottom: 8px; }
.card-value { font-size: 1.2rem; font-weight: 700; font-family: 'Geist Mono', monospace; margin-bottom: 4px; word-break: break-word; }
.card-label { color: var(--text-dim); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* ─── Chart Cards ─── */
.chart-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.chart-card.wide { grid-column: span 2; }
.chart-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 16px; color: var(--text-dim); text-align: center; }
.chart-wrap { position: relative; height: 280px; }

/* ─── Hub Page Cards ─── */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.hub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  display: block;
}
.hub-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,255,170,0.08);
}
.hub-icon { font-size: 2.5rem; margin-bottom: 12px; }
.hub-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.hub-desc { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 12px; }
.hub-stats { color: var(--accent); font-family: 'Geist Mono', monospace; font-size: 0.85rem; }

/* ─── Table ─── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  max-height: 600px;
  overflow-y: auto;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th {
  background: var(--surface-2);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  white-space: nowrap;
}
.data-table tbody tr:hover { background: rgba(0,255,170,0.03); }
.data-table .right { text-align: right; }
.data-table .badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-valid { background: rgba(0,255,170,0.15); color: var(--accent); }
.badge-invalid { background: rgba(255,107,107,0.15); color: var(--red); }

.table-info { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 12px; }

/* ─── Footer ─── */
.footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}
.footer code { color: var(--accent); background: var(--surface); padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-row { grid-template-columns: 1fr; }
  .chart-card.wide { grid-column: span 1; }
  .nav-links { width: 100%; justify-content: center; flex-wrap: wrap; }
  .nav-inner { flex-direction: column; gap: 10px; }
  .page-header h1 { font-size: 1.4rem; }
  .card-value { font-size: 1rem; }
}

@media (max-width: 480px) {
  .overview-grid { grid-template-columns: 1fr; }
  .container { padding: 0 16px 24px; }
}

/* ═══════════ SEARCH + PAGINATION (v2) ═══════════ */
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}
.search-input {
  flex: 1;
  min-width: 200px;
  background: #0f0f0f;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
}
.search-input::placeholder { color: #555; }

.page-size-select {
  background: #0f0f0f;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
}

.kode-cell {
  font-family: 'Geist Mono', 'Courier New', monospace;
  color: #00ffaa;
  font-size: 0.78rem;
  background: rgba(0, 255, 170, 0.06);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-dim);
}
.page-info { color: var(--text-dim); }
.page-controls {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.page-btn {
  background: #0f0f0f;
  border: 1px solid #2a2a2a;
  color: var(--text);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  transition: all 0.15s;
  min-width: 36px;
}
.page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 600;
}
.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ═══════════ SELESAI BUTTON + REVEAL OVERLAY ═══════════ */
.selesai-wrap {
  display: flex;
  justify-content: center;
  margin: 3rem 0 1rem;
}
.btn-selesai {
  background: linear-gradient(135deg, #7c5cff, #a78bfa);
  border: none;
  color: #fff;
  padding: 0.9rem 2.5rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 20px rgba(124, 92, 255, 0.25);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-selesai:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(124, 92, 255, 0.45);
}
.btn-selesai:active { transform: translateY(0); }

.reveal-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, #1a1e3a 0%, #07090f 80%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.reveal-overlay.show { opacity: 1; pointer-events: auto; }
.reveal-overlay .reveal-stars { position: absolute; inset: 0; pointer-events: none; }
.reveal-overlay .reveal-stars .star {
  position: absolute;
  width: 2px; height: 2px;
  background: #fff;
  border-radius: 50%;
  animation: twinkle-full var(--dur, 3s) ease-in-out infinite alternate;
}
.reveal-content {
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 2rem;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.8s ease 0.3s;
}
.reveal-overlay.show .reveal-content {
  transform: translateY(0);
  opacity: 1;
}
.reveal-title {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #7c5cff, #fff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
  letter-spacing: 1px;
}
.reveal-sub {
  color: #cdd5e3;
  font-size: 1.05rem;
  font-style: italic;
  max-width: 480px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}
.reveal-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #a78bfa;
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.reveal-loading-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #a78bfa;
  animation: reveal-pulse 1.4s ease-in-out infinite;
}
.reveal-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.reveal-loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes reveal-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}
@media (max-width: 480px) {
  .reveal-title { font-size: 1.8rem; }
  .reveal-sub { font-size: 0.95rem; }
}

/* ═══════════ LEADERBOARD PAGE FADE-IN ═══════════ */
body.lb-fade-in { animation: lb-fade 1s ease 0.1s both; }
@keyframes lb-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════ FOOTER SOCIAL (v3) ═══════════ */
.footer { text-align: center; padding: 2.5rem 1rem; }
.footer p {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}
.footer-social { margin-top: 0.5rem; }
.footer-social-label {
  display: block;
  color: var(--text-dim);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
}
.footer-social-icons {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  align-items: center;
}
.footer-social-icons a {
  color: #888;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.2s ease;
}
.footer-social-icons a:hover {
  color: #00ffaa;
  background: rgba(0,255,170,0.08);
  border-color: rgba(0,255,170,0.3);
  transform: translateY(-2px);
}
.footer-social-icons svg { display: block; }

/* ═══════════ HASHTAG CHIPS (v3) ═══════════ */
.page-header-sub {
  color: var(--text-dim);
  font-size: 1rem;
  margin-top: -0.2rem;
}
.hashtags {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}
.hashtags a {
  font-family: 'Geist Mono', 'Courier New', monospace;
  font-size: 0.82rem;
  color: #00ffaa;
  background: rgba(0, 255, 170, 0.07);
  border: 1px solid rgba(0, 255, 170, 0.18);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
}
.hashtags a:hover {
  background: rgba(0, 255, 170, 0.15);
  border-color: #00ffaa;
  transform: translateY(-1px);
}
