/* ============================================
   Daily Debate - Styles
   A clean, modern design with dark theme
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  /* Colors */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-elevated: #334155;
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-primary: #6366f1;
  --accent-hover: #818cf8;
  
  --side-a: #10b981;
  --side-a-bg: rgba(16, 185, 129, 0.15);
  --side-a-border: rgba(16, 185, 129, 0.4);
  
  --side-b: #f43f5e;
  --side-b-bg: rgba(244, 63, 94, 0.15);
  --side-b-border: rgba(244, 63, 94, 0.4);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  
  /* Shorthand */
  --accent: var(--accent-primary);
}

/* Light Mode */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --border-color: rgba(0, 0, 0, 0.1);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.15);
}

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

/* Ensure hidden attribute always works */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Background gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60vh;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent);
  pointer-events: none;
  z-index: -1;
}

/* ---------- Layout ---------- */
.container {
  width: min(1100px, 92%);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.logo:hover {
  opacity: 0.85;
}

.logo-icon {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--side-a) 0%, var(--accent-primary) 50%, var(--side-b) 100%);
  border-radius: 6px;
  position: relative;
}

.logo-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border: 2px solid rgba(255,255,255,0.9);
  border-radius: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color var(--transition-fast);
}

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

.admin-link {
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
}

/* ---------- Footer ---------- */
footer {
  margin-top: var(--space-2xl);
  padding: var(--space-xl) 0;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Debate Hero Section ---------- */
.debate-hero {
  margin: var(--space-xl) 0;
  text-align: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.status-badge.live {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.status-badge.scheduled {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.status-badge.closed {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.pulse {
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

/* ---------- Debate Card ---------- */
.debate-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
}

.debate-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.debate-question {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

/* ---------- Timer ---------- */
.timer-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.timer-countdown {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-elevated);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
}

/* ---------- Vote Buttons ---------- */
.vote-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.vote-btn {
  flex: 1;
  max-width: 200px;
  min-width: 140px;
  padding: var(--space-lg);
  border: 2px solid;
  border-radius: var(--radius-lg);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: center;
}

.vote-btn.side-a {
  border-color: var(--side-a-border);
  color: var(--side-a);
}

.vote-btn.side-a:hover:not(:disabled),
.vote-btn.side-a.voted {
  background: var(--side-a-bg);
  border-color: var(--side-a);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
}

.vote-btn.side-b {
  border-color: var(--side-b-border);
  color: var(--side-b);
}

.vote-btn.side-b:hover:not(:disabled),
.vote-btn.side-b.voted {
  background: var(--side-b-bg);
  border-color: var(--side-b);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.2);
}

.vote-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.vote-label {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.vote-count {
  display: block;
  font-size: 0.85rem;
  opacity: 0.8;
}

.vs-badge {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: var(--space-sm);
}

/* ---------- Demographics Section ---------- */
.demographics-section {
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.demographics-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  text-align: center;
}

.demographics-inputs {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
}

.demographics-inputs select,
.demographics-inputs input {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  min-width: 100px;
}

.demographics-inputs select:focus,
.demographics-inputs input:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* ---------- Vote Bar ---------- */
.vote-bar-container {
  margin-bottom: var(--space-lg);
}

.vote-bar {
  display: flex;
  height: 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.vote-bar-a {
  background: linear-gradient(90deg, var(--side-a), rgba(16, 185, 129, 0.7));
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vote-bar-b {
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.7), var(--side-b));
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Vote count animation */
.vote-count {
  transition: transform 0.2s ease;
}

.vote-btn:active .vote-count {
  transform: scale(1.1);
}

/* Percentage number animations */
.vote-percentages span {
  transition: transform 0.3s ease, color 0.3s ease;
}

.vote-percentages span.updated {
  animation: percentPop 0.4s ease;
}

@keyframes percentPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ---------- Category Badges ---------- */
.debate-category-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
}

.category-politics { background: #ef4444; color: white; }
.category-technology { background: #3b82f6; color: white; }
.category-sports { background: #22c55e; color: white; }
.category-entertainment { background: #f59e0b; color: white; }
.category-science { background: #8b5cf6; color: white; }
.category-lifestyle { background: #ec4899; color: white; }
.category-business { background: #14b8a6; color: white; }
.category-philosophy { background: #6366f1; color: white; }
.category-other { background: var(--text-muted); color: white; }

/* ---------- Theme Toggle ---------- */
.theme-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

/* Dark mode (default): show sun, hide moon */
.theme-toggle .sun-icon {
  display: block;
}

.theme-toggle .moon-icon {
  display: none;
}

/* Light mode: show moon, hide sun */
[data-theme="light"] .theme-toggle .sun-icon {
  display: none;
}

[data-theme="light"] .theme-toggle .moon-icon {
  display: block;
}

/* ---------- Suggest a Debate Section ---------- */
.suggest-section {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.suggest-section h2 {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
}

.suggest-intro {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
}

.suggest-form .form-group {
  position: relative;
  margin-bottom: var(--space-md);
}

.suggest-form textarea {
  width: 100%;
  padding: var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  resize: none;
}

.suggest-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.suggest-form .char-count {
  position: absolute;
  bottom: var(--space-sm);
  right: var(--space-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.suggest-form .form-row {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.suggest-form select {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.suggest-form select:focus {
  outline: none;
  border-color: var(--accent);
}

@media (max-width: 480px) {
  .suggest-form .form-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---------- Admin Suggestions ---------- */
.admin-suggestions {
  margin-bottom: var(--space-xl);
}

.admin-suggestions h2 {
  margin-bottom: var(--space-md);
}

.suggestion-count {
  font-size: 0.85rem;
  font-weight: normal;
  color: var(--accent);
}

.suggestions-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-height: 300px;
  overflow-y: auto;
}

.suggestion-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: var(--space-md);
}

.suggestion-item.dismissed {
  opacity: 0.5;
}

.suggestion-item.used {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.05);
}

.suggestion-content {
  flex: 1;
  min-width: 0;
}

.suggestion-category {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
}

.suggestion-question {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.suggestion-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.suggestion-actions {
  display: flex;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.suggestion-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.suggestion-score {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  margin-left: var(--space-sm);
}

.action-btn.success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.action-btn.success:hover {
  background: #0d9668;
}

/* ---------- Ideas Page ---------- */
.ideas-hero {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.ideas-hero h1 {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.ideas-intro {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.ideas-intro strong {
  color: var(--accent);
}

.ideas-sort {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.ideas-sort span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.ideas-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.idea-card {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: border-color 0.2s;
}

.idea-card:hover {
  border-color: var(--accent);
}

.idea-votes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 50px;
}

.idea-votes .vote-arrow {
  padding: 8px;
}

.idea-votes .vote-score {
  font-size: 1.25rem;
  font-weight: 700;
}

.idea-content {
  flex: 1;
  min-width: 0;
}

.idea-category {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.idea-question {
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0 0 var(--space-md) 0;
  color: var(--text-primary);
}

.idea-progress {
  margin-bottom: var(--space-sm);
}

.idea-progress-bar {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.idea-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: var(--radius-full);
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.idea-progress-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.idea-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.no-ideas {
  text-align: center;
  padding: var(--space-2xl);
}

.no-ideas h2 {
  margin-bottom: var(--space-sm);
}

.no-ideas p {
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.error-state {
  text-align: center;
  color: var(--error);
  padding: var(--space-xl);
}

@media (max-width: 480px) {
  .idea-card {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .idea-votes {
    flex-direction: row;
    justify-content: flex-start;
  }
}

/* ---------- Mobile Bottom Navigation ---------- */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-sm) 0;
  padding-bottom: max(var(--space-sm), env(safe-area-inset-bottom));
  z-index: 1000;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-xs);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.7rem;
  transition: color 0.2s;
}

.mobile-nav-item svg {
  width: 22px;
  height: 22px;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
  color: var(--accent);
}

.mobile-nav-item.active svg {
  stroke-width: 2.5;
}

/* Show mobile nav, hide desktop nav links on mobile */
@media (max-width: 768px) {
  .mobile-nav {
    display: flex;
    justify-content: space-around;
  }
  
  /* Hide desktop nav links but keep logo and theme toggle */
  .nav-links .nav-link:not(.admin-link) {
    display: none;
  }
  
  /* Add padding to body for bottom nav */
  body {
    padding-bottom: 70px;
  }
  
  /* Adjust footer */
  footer {
    margin-bottom: 0;
  }
}

.vote-percentages {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-sm);
  font-size: 0.9rem;
  font-weight: 600;
}

.vote-percentages span:first-child {
  color: var(--side-a);
}

.vote-percentages span:last-child {
  color: var(--side-b);
}

/* ---------- User Vote Indicator ---------- */
.user-vote-indicator {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  color: var(--success);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ---------- Bring Back Section ---------- */
.bring-back-section {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.closed-message {
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.bring-back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.bring-back-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.bring-back-count {
  background: var(--accent-primary);
  color: white;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
}

.bring-back-info {
  margin-top: var(--space-md);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- Reopen Banner ---------- */
.reopen-banner {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

/* ---------- No Debate State ---------- */
.no-debate {
  padding: var(--space-2xl);
  text-align: center;
}

.no-debate h2 {
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

.no-debate p {
  color: var(--text-muted);
}

/* ---------- Comments Section ---------- */
.comments-section {
  margin: var(--space-xl) 0;
}

.comments-section h2 {
  margin-bottom: var(--space-lg);
}

/* ---------- Comment Form ---------- */
.comment-form {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.comment-form textarea {
  width: 100%;
  min-height: 100px;
  padding: var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  margin-bottom: var(--space-md);
  transition: border-color var(--transition-fast);
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

.comment-form textarea::placeholder {
  color: var(--text-muted);
}

.comment-meta-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.comment-meta-inputs select,
.comment-meta-inputs input {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
}

.comment-meta-inputs select:focus,
.comment-meta-inputs input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.comment-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.char-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.submit-comment-btn {
  padding: var(--space-sm) var(--space-lg);
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.submit-comment-btn:hover {
  background: var(--accent-hover);
}

.submit-comment-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Vote First Message ---------- */
.vote-first-message {
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

/* ---------- Comments Closed ---------- */
.comments-closed {
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

/* ---------- Commenter Side Text ---------- */
.comment-prompt {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

.side-a-text {
  color: var(--side-a);
  font-weight: 600;
}

.side-b-text {
  color: var(--side-b);
  font-weight: 600;
}

/* ---------- Comments List ---------- */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.no-comments {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-muted);
}

.comment-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.comment-meta {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.comment-tag {
  padding: 2px 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.comment-tag.side-a {
  background: var(--side-a-bg);
  color: var(--side-a);
}

.comment-tag.side-b {
  background: var(--side-b-bg);
  color: var(--side-b);
}

/* Voted side badge on comments */
.comment-voted-side {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.comment-voted-side.side-a {
  background: var(--side-a-bg);
  color: var(--side-a);
  border: 1px solid var(--side-a-border);
}

.comment-voted-side.side-b {
  background: var(--side-b-bg);
  color: var(--side-b);
  border: 1px solid var(--side-b-border);
}

.comment-voted-side.unvoted {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  font-style: italic;
}

/* Unvoted badge in comment prompt */
.unvoted-badge {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

.comment-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.comment-text {
  color: var(--text-primary);
  line-height: 1.5;
}

/* ---------- Upcoming & History Sections ---------- */
.upcoming-section,
.history-section {
  margin: var(--space-2xl) 0;
}

.upcoming-section h2,
.history-section h2 {
  margin-bottom: var(--space-lg);
}

.debates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
}

.debate-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.debate-preview-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.debate-preview-card h3 {
  font-size: 1rem;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.debate-preview-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.debate-preview-status {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.debate-preview-status.scheduled {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.debate-preview-status.closed {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.empty-state {
  padding: var(--space-xl);
  text-align: center;
  color: var(--text-muted);
}

/* ---------- Toast Notifications ---------- */
#toast-container {
  position: fixed;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  max-width: 400px;
  text-align: center;
}

.toast.success {
  border-color: var(--success);
}

.toast.error {
  border-color: var(--error);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Admin Page Styles
   ============================================ */

.admin-page .container {
  max-width: 1200px;
}

/* ---------- Login ---------- */
.admin-login {
  display: none;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.admin-login:not([hidden]) {
  display: flex;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  width: min(400px, 100%);
  text-align: center;
}

.login-card h1 {
  margin-bottom: var(--space-sm);
}

.login-card > p {
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

#login-form input {
  padding: var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
}

#login-form input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.login-error {
  margin-top: var(--space-md);
  padding: var(--space-sm);
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 0.9rem;
}

/* ---------- Admin Dashboard ---------- */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: var(--space-xl) 0;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal:not([hidden]) {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  width: min(600px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  margin-bottom: var(--space-lg);
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.form-group small {
  display: block;
  margin-top: var(--space-xs);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

/* ---------- Debates Table ---------- */
.admin-debates h2 {
  margin-bottom: var(--space-md);
}

.debates-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.tab-btn {
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  background: var(--bg-elevated);
}

.tab-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.debates-table-container {
  overflow-x: auto;
}

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

.debates-table th,
.debates-table td {
  padding: var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.debates-table th {
  background: var(--bg-elevated);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.debates-table td {
  font-size: 0.9rem;
}

.debates-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.debates-table .question-cell {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.debates-table .status-cell {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.debates-table .status-cell.live {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.debates-table .status-cell.scheduled {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.debates-table .status-cell.closed {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.debates-table .actions-cell {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.debates-table .action-btn {
  padding: 4px 8px;
  font-size: 0.8rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.debates-table .action-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.debates-table .action-btn.danger:hover {
  background: var(--error);
  border-color: var(--error);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .debate-question {
    font-size: 1.35rem;
  }
  
  .vote-buttons {
    flex-direction: column;
  }
  
  .vote-btn {
    max-width: 100%;
    width: 100%;
  }
  
  .vs-badge {
    display: none;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .admin-stats {
    grid-template-columns: 1fr;
  }
  
  .debates-table th:nth-child(4),
  .debates-table td:nth-child(4),
  .debates-table th:nth-child(5),
  .debates-table td:nth-child(5) {
    display: none;
  }
  
  .nav-links {
    gap: var(--space-md);
  }
  
  .nav-link:not(.admin-link):not(.active) {
    display: none;
  }
}

/* ============================================
   Upcoming & History Pages
   ============================================ */

/* ---------- Active Nav Link ---------- */
.nav-link.active {
  color: var(--text-primary);
  font-weight: 600;
}

/* ---------- Page Header ---------- */
.page-header {
  margin: var(--space-xl) 0;
  text-align: center;
}

.page-header h1 {
  margin-bottom: var(--space-sm);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* ---------- Calendar ---------- */
.calendar-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.calendar-header h2 {
  font-size: 1.25rem;
  margin: 0;
}

.calendar-nav {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1rem;
}

.calendar-nav:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.calendar-grid {
  margin-bottom: var(--space-md);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: var(--space-sm);
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: var(--space-sm);
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: default;
  transition: all var(--transition-fast);
  position: relative;
  min-height: 40px;
}

.calendar-day.empty {
  background: transparent;
}

.calendar-day.today {
  border-color: var(--accent-primary);
}

.calendar-day.has-scheduled,
.calendar-day.has-live {
  cursor: pointer;
}

.calendar-day.has-scheduled:hover,
.calendar-day.has-live:hover {
  background: var(--bg-elevated);
  transform: scale(1.05);
}

.calendar-day .day-number {
  font-size: 0.9rem;
  font-weight: 500;
}

.calendar-day .day-dot {
  position: absolute;
  bottom: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.calendar-day .day-dot.scheduled {
  background: var(--warning);
}

.calendar-day .day-dot.live {
  background: var(--success);
  animation: pulse 2s infinite;
}

.calendar-legend {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.scheduled {
  background: var(--warning);
}

.legend-dot.live {
  background: var(--success);
}

/* ---------- Debates List (Upcoming/History) ---------- */
.upcoming-list-section,
.history-list-section {
  margin-bottom: var(--space-2xl);
}

.upcoming-list-section h2,
.history-list-section h2 {
  margin-bottom: var(--space-lg);
}

.debates-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-2xl);
  color: var(--text-muted);
}

/* Debate List Card (Upcoming) */
.debate-list-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-fast);
}

.debate-list-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.debate-list-card.highlight {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary);
}

.debate-list-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.debate-list-status.live {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.debate-list-status.scheduled {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.debate-list-question {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.debate-list-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* History Stats */
.history-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

/* Debate History Card */
.debate-history-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-fast);
}

.debate-history-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.debate-history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.debate-history-question {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.debate-history-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.debate-history-results {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-md);
  align-items: center;
  margin-bottom: var(--space-md);
}

.debate-history-side {
  text-align: center;
}

.debate-history-side.side-a {
  text-align: left;
}

.debate-history-side.side-b {
  text-align: right;
}

.debate-history-side .side-label {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}

.debate-history-side.side-a .side-label {
  color: var(--side-a);
}

.debate-history-side.side-b .side-label {
  color: var(--side-b);
}

.debate-history-side .side-percent {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
}

.debate-history-side.side-a .side-percent {
  color: var(--side-a);
}

.debate-history-side.side-b .side-percent {
  color: var(--side-b);
}

.debate-history-side .side-votes {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.debate-history-side.winner .side-label::after {
  content: ' (Winner)';
  font-weight: 400;
  font-size: 0.8rem;
}

.debate-history-bar {
  display: flex;
  height: 8px;
  background: var(--bg-primary);
  border-radius: var(--radius-full);
  overflow: hidden;
  width: 100%;
  max-width: 200px;
}

.debate-history-bar .bar-a {
  background: var(--side-a);
}

.debate-history-bar .bar-b {
  background: var(--side-b);
}

.debate-history-footer {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}

.winner-badge,
.tie-badge,
.bring-back-badge {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.winner-badge {
  background: var(--side-a-bg);
  color: var(--side-a);
}

.tie-badge {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.bring-back-badge {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary);
}

.load-more-container {
  display: flex;
  justify-content: center;
  margin-top: var(--space-lg);
}

/* ---------- Testing Section ---------- */
.testing-section {
  margin: var(--space-xl) 0;
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
}

.testing-section summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.testing-section summary:hover {
  color: var(--text-secondary);
}

.testing-content {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}

.testing-content p {
  margin-bottom: var(--space-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- Admin Comments Modal ---------- */
.modal-large {
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.modal-header h2 {
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-xs);
  line-height: 1;
}

.close-btn:hover {
  color: var(--text-primary);
}

.modal-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.comments-admin-list {
  overflow-y: auto;
  flex: 1;
  max-height: 50vh;
}

.admin-comment-item {
  padding: var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  border: 1px solid var(--border-color);
}

.admin-comment-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-sm);
  gap: var(--space-sm);
}

.admin-comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

.admin-comment-text {
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0;
}

/* ---------- Demographics Breakdown ---------- */
.demographics-breakdown {
  margin-top: var(--space-lg);
}

.demographics-breakdown details {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.demographics-breakdown summary {
  padding: var(--space-md);
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.demographics-breakdown summary:hover {
  color: var(--text-primary);
}

.breakdown-content {
  padding: 0 var(--space-md) var(--space-md);
}

.breakdown-category {
  margin-bottom: var(--space-lg);
}

.breakdown-category:last-child {
  margin-bottom: 0;
}

.breakdown-category h4 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.breakdown-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.breakdown-row {
  display: grid;
  grid-template-columns: 80px 1fr 100px;
  align-items: center;
  gap: var(--space-sm);
}

.breakdown-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.breakdown-bar {
  height: 20px;
  background: var(--side-b-bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.breakdown-bar-a {
  height: 100%;
  background: var(--side-a);
  transition: width 0.3s ease;
}

.breakdown-pct {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
}

.breakdown-empty {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: var(--space-md);
}

.breakdown-loading {
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-md);
}

/* ---------- Share Section ---------- */
.share-section {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.share-btn-main {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.share-btn-main:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

.share-btn-main:active {
  transform: scale(0.98);
}

.share-buttons-secondary {
  display: flex;
  gap: var(--space-xs);
}

.share-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.share-btn:hover {
  transform: scale(1.1);
  color: var(--text-primary);
}

.share-btn.twitter:hover {
  background: #1DA1F2;
  color: white;
  border-color: #1DA1F2;
}

.share-btn.facebook:hover {
  background: #4267B2;
  color: white;
  border-color: #4267B2;
}

.share-btn.copy:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ---------- Comments Sort ---------- */
.comments-sort {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.comments-sort span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.sort-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.sort-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.sort-btn.active {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  font-weight: 500;
}

/* ---------- Comment Votes ---------- */
.comment-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  border: 1px solid var(--border-color);
}

.comment-votes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 40px;
}

.vote-arrow {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vote-arrow:hover {
  background: var(--bg-elevated);
}

.vote-arrow.up:hover,
.vote-arrow.up.active {
  color: var(--side-a);
}

.vote-arrow.down:hover,
.vote-arrow.down.active {
  color: var(--side-b);
}

.vote-arrow.active {
  background: var(--bg-elevated);
}

.vote-score {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
  min-width: 24px;
  text-align: center;
}

.vote-score.positive {
  color: var(--side-a);
}

.vote-score.negative {
  color: var(--side-b);
}

.comment-body {
  flex: 1;
  min-width: 0;
}

/* Override old comment-item styles */
.comments-list .comment-item .comment-header {
  padding: 0;
  background: none;
  border: none;
  margin-bottom: var(--space-xs);
}

/* ---------- Responsive for new pages ---------- */
@media (max-width: 768px) {
  .calendar-weekdays span {
    font-size: 0.7rem;
    padding: var(--space-xs);
  }
  
  .calendar-day {
    min-height: 36px;
  }
  
  .calendar-day .day-number {
    font-size: 0.8rem;
  }
  
  .calendar-legend {
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
  }
  
  .history-stats {
    grid-template-columns: 1fr;
  }
  
  .debate-history-results {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  
  .debate-history-bar {
    max-width: 100%;
    margin: var(--space-sm) 0;
  }
  
  .debate-history-side.side-a,
  .debate-history-side.side-b {
    text-align: center;
  }
}

