/* Viewer Companion - Dark Theme */
:root {
  --bg-primary: #0e0e10;
  --bg-secondary: #18181b;
  --bg-card: #1f1f23;
  --bg-hover: #26262c;
  --text-primary: #efeff1;
  --text-secondary: #adadb8;
  --text-muted: #71717a;
  --accent: #9147ff;
  --accent-hover: #772ce8;
  --accent-glow: rgba(145, 71, 255, 0.3);
  --gold: #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  --positive: #00c853;
  --negative: #ff5252;
  --border: rgba(255, 255, 255, 0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.login-btn {
  background: var(--accent);
  color: white !important;
  padding: 8px 16px;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.login-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* Main Content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  min-height: calc(100vh - 160px);
}

/* Hero */
.hero {
  text-align: center;
  padding: 48px 0;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-card.highlight {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border: none;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-card.highlight .stat-value {
  color: white;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Features */
.features {
  margin: 48px 0;
}

.features h2 {
  text-align: center;
  margin-bottom: 32px;
  color: var(--text-secondary);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
}

.feature h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.feature p {
  color: var(--text-secondary);
}

/* CTA */
.cta {
  text-align: center;
  margin: 48px 0;
}

.cta-btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 16px 32px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
  transition: all 0.2s;
}

.cta-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

/* Dashboard */
.dashboard {
  max-width: 800px;
  margin: 0 auto;
}

.user-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--accent);
}

.user-info h1 {
  font-size: 2rem;
}

.user-rank {
  color: var(--text-secondary);
}

/* History */
.history-section {
  margin-top: 32px;
}

.history-section h2 {
  margin-bottom: 16px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.history-table th,
.history-table td {
  padding: 12px 16px;
  text-align: left;
}

.history-table th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
}

.history-table td {
  border-bottom: 1px solid var(--border);
}

.history-table tr:last-child td {
  border-bottom: none;
}

.amount.positive {
  color: var(--positive);
  font-weight: 600;
}

.amount.negative {
  color: var(--negative);
  font-weight: 600;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 0;
}

/* Leaderboard */
.leaderboard-page {
  max-width: 900px;
  margin: 0 auto;
}

.leaderboard-page h1 {
  text-align: center;
  margin-bottom: 8px;
}

.leaderboard-page .subtitle {
  text-align: center;
  margin-bottom: 32px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 16px;
  text-align: left;
}

.leaderboard-table th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.leaderboard-table td {
  border-bottom: 1px solid var(--border);
}

.leaderboard-table tr:last-child td {
  border-bottom: none;
}

.leaderboard-table tr:hover td {
  background: var(--bg-hover);
}

.leaderboard-table tr.current-user td {
  background: rgba(145, 71, 255, 0.1);
  border-left: 3px solid var(--accent);
}

.rank-col {
  width: 60px;
  text-align: center;
  font-size: 1.25rem;
}

.viewer-col {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.points-col {
  text-align: right;
  font-weight: 600;
  color: var(--gold);
}

.time-col,
.msgs-col {
  text-align: right;
  color: var(--text-secondary);
}

.your-rank {
  text-align: center;
  margin-top: 24px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
}

/* Actions */
.actions {
  margin-top: 32px;
  text-align: center;
}

.btn {
  display: inline-block;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

/* Footer */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  text-align: center;
}

.footer-content p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.points-name {
  color: var(--accent);
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 16px;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .user-header {
    flex-direction: column;
    text-align: center;
  }
}