/* ══════════════════════════════════════════════════════════════
   FACEBOOK GIVEAWAY ANALYZER — DASHBOARD STYLES
   ══════════════════════════════════════════════════════════════ */

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

:root {
  --bg:        #080B14;
  --bg-2:      #0D1120;
  --bg-3:      #121828;
  --border:    rgba(255,255,255,0.07);
  --border-2:  rgba(255,255,255,0.12);

  --primary:   #6C63FF;
  --primary-2: #9B94FF;
  --accent:    #00D4AA;
  --gold:      #FFB800;
  --red:       #FF5E6C;
  --blue:      #38BDF8;

  --text-1:  #F1F5FF;
  --text-2:  #A3ADBF;
  --text-3:  #58647A;

  --radius:    14px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  --shadow:  0 4px 24px rgba(0,0,0,0.4);
  --glow:    0 0 40px rgba(108,99,255,0.25);
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

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

/* ─── Container ─── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ══════════════════════════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════════════════════════ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  background: rgba(8,11,20,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}
.navbar.scrolled { background: rgba(8,11,20,0.95); }

.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.nav-title { font-weight: 700; font-size: 16px; color: var(--text-1); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: all 0.2s;
}
.nav-link:hover { color: var(--text-1); background: var(--border); }
.nav-link--github {
  display: flex; align-items: center; gap: 6px;
  background: var(--border);
  color: var(--text-1);
  margin-left: 8px;
}
.nav-link--github:hover { background: var(--primary); color: #fff; }

/* ══════════════════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 100px 24px 60px;
}

.hero-bg { position: absolute; inset: 0; z-index: 0; }

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: float 8s ease-in-out infinite;
}
.hero-orb--1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(108,99,255,0.3), transparent 70%);
  top: -150px; left: -100px;
}
.hero-orb--2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0,212,170,0.2), transparent 70%);
  bottom: -100px; right: -100px;
  animation-delay: -3s;
}
.hero-orb--3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,184,0,0.15), transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  animation-delay: -5s;
}
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

.hero-content { position: relative; z-index: 1; max-width: 760px; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px;
  background: rgba(108,99,255,0.15);
  border: 1px solid rgba(108,99,255,0.35);
  border-radius: 100px;
  font-size: 13px; font-weight: 500;
  color: var(--primary-2);
  margin-bottom: 28px;
}
.badge-dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.hero-title {
  font-size: clamp(42px, 7vw, 80px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 24px;
  color: var(--text-1);
}
.hero-title--gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 17px;
  color: var(--text-2);
  max-width: 580px;
  margin: 0 auto 32px;
  line-height: 1.8;
}
.hero-desc strong { color: var(--text-1); }

.hero-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tag {
  padding: 6px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 100px;
  font-size: 13px; font-weight: 500;
  color: var(--text-2);
  transition: all 0.2s;
}
.tag:hover { border-color: var(--primary); color: var(--primary-2); }

/* ══════════════════════════════════════════════════════════════
   SECTIONS
══════════════════════════════════════════════════════════════ */
.section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.section-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  margin-bottom: 40px;
}
.section-title {
  font-size: 28px; font-weight: 800; letter-spacing: -0.5px;
  color: var(--text-1);
}
.section-subtitle { font-size: 15px; color: var(--text-2); margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════
   STAT CARDS
══════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  opacity: 0; transform: translateY(20px);
}
.stat-card.visible { opacity: 1; transform: translateY(0); transition-duration: 0.5s; }
.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-2);
  box-shadow: var(--shadow);
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.stat-card:hover::after { opacity: 1; }

.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.stat-icon--blue  { background: rgba(56,189,248,0.15);  color: var(--blue); }
.stat-icon--purple{ background: rgba(108,99,255,0.15); color: var(--primary-2); }
.stat-icon--gold  { background: rgba(255,184,0,0.15);   color: var(--gold); }
.stat-icon--green { background: rgba(0,212,170,0.15);   color: var(--accent); }

.stat-value {
  font-size: 42px; font-weight: 900;
  letter-spacing: -2px;
  color: var(--text-1);
  line-height: 1;
  margin-bottom: 8px;
}
.stat-label { font-size: 14px; color: var(--text-2); font-weight: 500; }

/* ══════════════════════════════════════════════════════════════
   LEADERBOARD TABLE
══════════════════════════════════════════════════════════════ */
.leaderboard-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.search-input {
  padding: 10px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 14px; font-family: inherit;
  outline: none;
  width: 260px;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--primary); }
.search-input option { background: var(--bg-2); }

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-2);
}

.leaderboard-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
.leaderboard-table thead tr {
  border-bottom: 1px solid var(--border);
}
.leaderboard-table th {
  padding: 14px 20px;
  text-align: left;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-3);
}
.leaderboard-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.leaderboard-table tbody tr:last-child td { border-bottom: none; }
.leaderboard-table tbody tr {
  transition: background 0.15s;
}
.leaderboard-table tbody tr:hover { background: rgba(255,255,255,0.03); }

/* Rank badges */
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-weight: 700; font-size: 13px;
}
.rank-badge--gold   { background: rgba(255,184,0,0.2);   color: var(--gold); border: 1.5px solid rgba(255,184,0,0.4); }
.rank-badge--silver { background: rgba(160,170,190,0.2); color: #A0AABE; border: 1.5px solid rgba(160,170,190,0.4); }
.rank-badge--bronze { background: rgba(205,127,50,0.2);  color: #CD7F32; border: 1.5px solid rgba(205,127,50,0.4); }
.rank-badge--default{ background: var(--bg-3); color: var(--text-3); border: 1.5px solid var(--border-2); }

/* Commenter cell */
.commenter-name { font-weight: 600; color: var(--text-1); }
.commenter-profile { font-size: 12px; color: var(--primary-2); text-decoration: none; }
.commenter-profile:hover { text-decoration: underline; }

/* User ID */
.user-id { font-family: monospace; font-size: 12px; color: var(--text-3); }

/* Entries */
.entries-cell { display: flex; align-items: center; gap: 10px; }
.entries-num { font-weight: 700; font-size: 16px; color: var(--text-1); min-width: 30px; }

/* Share bar */
.share-bar-wrapper { display: flex; align-items: center; gap: 8px; }
.share-bar-track {
  flex: 1; min-width: 80px; height: 6px;
  background: var(--bg-3);
  border-radius: 100px;
  overflow: hidden;
}
.share-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 100px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.share-pct { font-size: 13px; font-weight: 600; color: var(--text-2); min-width: 42px; text-align: right; }

/* ══════════════════════════════════════════════════════════════
   CHARTS
══════════════════════════════════════════════════════════════ */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
}
@media (max-width: 900px) { .charts-grid { grid-template-columns: 1fr; } }

.chart-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.chart-title { font-size: 16px; font-weight: 700; margin-bottom: 24px; color: var(--text-1); }
.chart-wrapper { position: relative; height: 320px; }
.chart-wrapper--doughnut { height: 300px; display: flex; align-items: center; justify-content: center; }

/* ══════════════════════════════════════════════════════════════
   COMMENTS FEED
══════════════════════════════════════════════════════════════ */
.comments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.comment-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s, transform 0.2s;
}
.comment-card:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
}
.comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.comment-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.comment-author { font-weight: 600; font-size: 14px; color: var(--text-1); }
.comment-date { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.comment-text {
  font-size: 14px; color: var(--text-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.comment-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--primary-2);
  text-decoration: none;
  margin-top: 10px;
}
.comment-link:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; border: none; transition: all 0.2s;
  text-decoration: none;
}
.btn--outline {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-1);
}
.btn--outline:hover { background: var(--border); border-color: var(--primary); }

.btn--ghost {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  padding: 12px 32px;
}
.btn--ghost:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.load-more-wrapper { display: flex; justify-content: center; }

/* ══════════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: 40px;
}
.footer-content {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 24px;
  margin-bottom: 32px;
}
.footer-brand p { font-size: 14px; color: var(--text-3); margin-top: 4px; }
.footer-links { display: flex; gap: 16px; }
.footer-link {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500;
  color: var(--text-2); text-decoration: none;
  transition: color 0.2s;
}
.footer-link:hover { color: var(--primary-2); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; }
.footer-bottom p { font-size: 13px; color: var(--text-3); }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .nav-links .nav-link:not(.nav-link--github) { display: none; }
  .section-header { flex-direction: column; }
  .leaderboard-controls { width: 100%; }
  .search-input { width: 100%; }
}

/* Avatar colors */
.avatar-0 { background: rgba(108,99,255,0.2); color: var(--primary-2); }
.avatar-1 { background: rgba(0,212,170,0.2);  color: var(--accent); }
.avatar-2 { background: rgba(255,184,0,0.2);  color: var(--gold); }
.avatar-3 { background: rgba(56,189,248,0.2); color: var(--blue); }
.avatar-4 { background: rgba(255,94,108,0.2); color: var(--red); }
