/* ===================================
   TresVida Interactive — Main Styles
   =================================== */

:root {
  /* Brand Colors */
  --ink: #0a0a0f;
  --ink-soft: #16161e;
  --ink-mid: #1e1e2a;
  --surface: #12121a;
  --surface-2: #1a1a24;
  --border: rgba(255,255,255,0.08);
  --border-bright: rgba(255,255,255,0.15);

  /* Accent */
  --volt: #7c3aed;
  --volt-light: #8b5cf6;
  --volt-glow: rgba(124, 58, 237, 0.25);
  --neon: #06d6a0;
  --neon-glow: rgba(6, 214, 160, 0.2);
  --amber: #f59e0b;
  --rose: #f43f5e;
  --sky: #38bdf8;

  /* Gradients */
  --grad-hero: linear-gradient(135deg, #7c3aed 0%, #06d6a0 100%);
  --grad-card: linear-gradient(135deg, rgba(124,58,237,0.1) 0%, rgba(6,214,160,0.05) 100%);

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-volt: 0 0 40px rgba(124,58,237,0.3);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--ink);
  color: rgba(255,255,255,0.9);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; }
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 700; }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }
p { color: rgba(255,255,255,0.65); line-height: 1.7; }
a { color: var(--volt-light); text-decoration: none; }

/* ===== UTILITY ===== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-volt { color: var(--volt-light); }
.text-neon { color: var(--neon); }
.text-amber { color: var(--amber); }
.text-rose { color: var(--rose); }
.text-muted { color: rgba(255,255,255,0.45); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--volt);
  color: #fff;
  box-shadow: 0 2px 12px rgba(124,58,237,0.4);
}
.btn-primary:hover:not(:disabled) { background: var(--volt-light); box-shadow: 0 4px 20px rgba(124,58,237,0.6); transform: translateY(-1px); }

.btn-neon {
  background: var(--neon);
  color: #0a0a0f;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(6,214,160,0.4);
}
.btn-neon:hover:not(:disabled) { box-shadow: 0 4px 24px rgba(6,214,160,0.6); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.75);
  border: 1px solid var(--border-bright);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.25); color: #fff; }

.btn-danger {
  background: rgba(244,63,94,0.15);
  color: var(--rose);
  border: 1px solid rgba(244,63,94,0.3);
}
.btn-danger:hover:not(:disabled) { background: rgba(244,63,94,0.25); }

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-xl { padding: 1rem 2.5rem; font-size: 1.1rem; border-radius: var(--radius-lg); }
.btn-icon { padding: 0.5rem; width: 36px; height: 36px; border-radius: 8px; justify-content: center; }

/* ===== INPUTS ===== */
.input, .textarea, .select {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  color: rgba(255,255,255,0.9);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: all 0.2s;
  outline: none;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--volt-light); box-shadow: 0 0 0 3px var(--volt-glow); }
.input::placeholder, .textarea::placeholder { color: rgba(255,255,255,0.3); }
.textarea { resize: vertical; min-height: 80px; }
.select { appearance: none; cursor: pointer; }
.select option { background: var(--ink-mid); }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-size: 0.82rem; font-weight: 500; color: rgba(255,255,255,0.7); }
.form-error { font-size: 0.8rem; color: var(--rose); }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.25s ease;
}
.card:hover { border-color: var(--border-bright); transform: translateY(-2px); box-shadow: var(--shadow-card); }
.card-interactive { cursor: pointer; }
.card-interactive:hover { border-color: rgba(124,58,237,0.4); box-shadow: 0 8px 32px rgba(124,58,237,0.15); }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-volt { background: rgba(124,58,237,0.2); color: var(--volt-light); border: 1px solid rgba(124,58,237,0.3); }
.badge-neon { background: rgba(6,214,160,0.15); color: var(--neon); border: 1px solid rgba(6,214,160,0.3); }
.badge-amber { background: rgba(245,158,11,0.15); color: var(--amber); border: 1px solid rgba(245,158,11,0.3); }
.badge-rose { background: rgba(244,63,94,0.15); color: var(--rose); border: 1px solid rgba(244,63,94,0.3); }

/* ===== NAVIGATION ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
}
.nav-brand-icon {
  width: 32px; height: 32px;
  background: var(--grad-hero);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: color 0.2s;
  cursor: pointer;
}
.nav-link:hover { color: #fff; }
.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

/* ===== SIDEBAR (Dashboard) ===== */
.app-layout { display: flex; min-height: 100vh; padding-top: 64px; }
.sidebar {
  width: 240px;
  min-height: calc(100vh - 64px);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  position: fixed;
  left: 0;
  top: 64px;
  bottom: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.9); }
.sidebar-item.active { background: rgba(124,58,237,0.2); color: var(--volt-light); }
.sidebar-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-divider { border: none; border-top: 1px solid var(--border); margin: 0.75rem 0; }

.main-content { flex: 1; margin-left: 240px; padding: 2rem; max-width: calc(100vw - 240px); }

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-title { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; }
.page-subtitle { color: rgba(255,255,255,0.5); font-size: 0.9rem; margin-top: 0.25rem; }

/* ===== PRESENTATION CARDS ===== */
.presentation-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s;
  cursor: pointer;
}
.presentation-card:hover { border-color: rgba(124,58,237,0.4); transform: translateY(-3px); box-shadow: 0 8px 40px rgba(124,58,237,0.15); }
.presentation-card-thumb {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  position: relative;
  overflow: hidden;
}
.presentation-card-body { padding: 1.1rem 1.25rem; }
.presentation-card-title { font-family: var(--font-display); font-weight: 600; font-size: 1rem; margin-bottom: 0.4rem; }
.presentation-card-meta { display: flex; align-items: center; gap: 0.75rem; font-size: 0.78rem; color: rgba(255,255,255,0.45); }
.presentation-card-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  opacity: 0;
  transition: opacity 0.2s;
}
.presentation-card:hover .presentation-card-actions { opacity: 1; }

/* ===== EDITOR LAYOUT ===== */
.editor-layout {
  display: flex;
  height: calc(100vh - 64px);
  padding-top: 64px;
  overflow: hidden;
}
.editor-sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.editor-main { flex: 1; overflow-y: auto; padding: 2rem; background: var(--ink); }
.editor-panel {
  width: 320px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 1.25rem;
}
.slide-thumb {
  background: var(--ink-mid);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.slide-thumb:hover, .slide-thumb.active { border-color: var(--volt-light); }
.slide-thumb.active { background: rgba(124,58,237,0.1); }
.slide-thumb-title { font-size: 0.75rem; color: rgba(255,255,255,0.7); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide-thumb-type { font-size: 0.7rem; color: rgba(255,255,255,0.4); margin-top: 0.2rem; }
.slide-thumb-num { position: absolute; top: 0.5rem; right: 0.5rem; font-size: 0.65rem; color: rgba(255,255,255,0.3); font-family: var(--font-mono); }

/* ===== SLIDE TYPES ICONS ===== */
.slide-type-icon { font-size: 1.5rem; }

/* ===== EDITOR CANVAS ===== */
.slide-canvas {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  aspect-ratio: 16/9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  min-height: 320px;
}
.slide-canvas::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-card);
  pointer-events: none;
}
.canvas-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; text-align: center; color: #fff; margin-bottom: 1rem; position: relative; z-index: 1; }
.canvas-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; width: 100%; position: relative; z-index: 1; }
.canvas-option {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
}

/* ===== ADD SLIDE TYPES ===== */
.slide-types-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.slide-type-btn {
  background: var(--ink-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.slide-type-btn:hover { border-color: var(--volt-light); background: rgba(124,58,237,0.1); }
.slide-type-btn .type-label { font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.85); }
.slide-type-btn .type-desc { font-size: 0.72rem; color: rgba(255,255,255,0.4); }

/* ===== PRESENTER VIEW ===== */
.presenter-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  height: 100vh;
  background: var(--ink);
  padding-top: 0;
}
.presenter-main { padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem; overflow-y: auto; }
.presenter-sidebar-panel {
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.presenter-slide {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 3rem;
  flex: 1;
  position: relative;
  overflow: hidden;
}
.presenter-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-card);
  pointer-events: none;
}
.presenter-controls { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.participant-count {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(6,214,160,0.1);
  border: 1px solid rgba(6,214,160,0.25);
  border-radius: 100px;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--neon);
}
.join-code-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
}
.join-code-label { font-size: 0.75rem; color: rgba(255,255,255,0.5); }
.join-code-value { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 600; color: var(--volt-light); letter-spacing: 0.15em; }

/* ===== LIVE RESULTS CHARTS ===== */
.results-bar {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.result-row { display: flex; align-items: center; gap: 0.75rem; }
.result-label { font-size: 0.85rem; color: rgba(255,255,255,0.8); min-width: 100px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.result-bar-wrap { flex: 1; height: 28px; background: rgba(255,255,255,0.06); border-radius: 100px; overflow: hidden; }
.result-bar-fill {
  height: 100%;
  border-radius: 100px;
  background: var(--grad-hero);
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 4px;
}
.result-count { font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.6); min-width: 30px; text-align: right; font-family: var(--font-mono); }

/* ===== WORD CLOUD ===== */
.word-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  padding: 1rem;
}
.word-tag {
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  font-weight: 600;
  transition: all 0.3s;
  animation: wordPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes wordPop { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1); } }

/* ===== AUDIENCE VIEW ===== */
.audience-layout {
  min-height: 100vh;
  background: var(--ink);
  display: flex;
  flex-direction: column;
}
.audience-header {
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.audience-content { flex: 1; padding: 2rem 1.5rem; max-width: 700px; margin: 0 auto; width: 100%; }
.audience-slide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 1.5rem;
}
.audience-slide-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: #fff; margin-bottom: 1.5rem; }

/* POLL OPTIONS */
.poll-options { display: flex; flex-direction: column; gap: 0.75rem; }
.poll-option {
  background: rgba(255,255,255,0.04);
  border: 2px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 0.9rem 1.25rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.85);
  transition: all 0.2s;
  text-align: left;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.poll-option:hover { border-color: var(--volt-light); background: rgba(124,58,237,0.1); }
.poll-option.selected { border-color: var(--volt); background: rgba(124,58,237,0.2); color: #fff; }
.poll-option.correct { border-color: var(--neon); background: rgba(6,214,160,0.15); }
.poll-option.wrong { border-color: var(--rose); background: rgba(244,63,94,0.1); }
.poll-option-letter {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

/* RATING STARS */
.rating-stars { display: flex; gap: 0.5rem; }
.rating-star {
  font-size: 2.5rem;
  cursor: pointer;
  transition: all 0.15s;
  filter: grayscale(1) opacity(0.4);
}
.rating-star:hover, .rating-star.active { filter: none; transform: scale(1.1); }

/* SCALE SLIDER */
.scale-slider { display: flex; flex-direction: column; gap: 1rem; }
.scale-slider input[type=range] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  outline: none;
  appearance: none;
  cursor: pointer;
}
.scale-slider input[type=range]::-webkit-slider-thumb {
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--volt);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(124,58,237,0.5);
}
.scale-labels { display: flex; justify-content: space-between; font-size: 0.78rem; color: rgba(255,255,255,0.45); }
.scale-value { text-align: center; font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; color: var(--volt-light); }

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: var(--surface-2);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.9);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: slideIn 0.3s ease;
  max-width: 320px;
}
.toast.success { border-left: 3px solid var(--neon); }
.toast.error { border-left: 3px solid var(--rose); }
.toast.info { border-left: 3px solid var(--volt-light); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn 0.25s ease;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
}
.modal-lg { max-width: 720px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }
.modal-close { background: rgba(255,255,255,0.07); border: none; color: rgba(255,255,255,0.7); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; transition: all 0.2s; }
.modal-close:hover { background: rgba(255,255,255,0.12); color: #fff; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ===== JOIN PAGE ===== */
.join-page {
  min-height: 100vh;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.join-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 480px;
  text-align: center;
}
.join-code-input {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
  text-transform: uppercase;
}

/* ===== LANDING PAGE ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  padding-top: 80px;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(124,58,237,0.2) 0%, transparent 60%),
              radial-gradient(ellipse 60% 40% at 80% 100%, rgba(6,214,160,0.1) 0%, transparent 50%);
  pointer-events: none;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 800px; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 100px;
  padding: 0.4rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--volt-light);
  margin-bottom: 1.5rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 5rem);
  font-weight: 800;
  line-height: 1.0;
  margin-bottom: 1.25rem;
}
.hero-title .highlight {
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc { font-size: 1.15rem; color: rgba(255,255,255,0.6); max-width: 560px; margin: 0 auto 2.5rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  margin-top: 3.5rem;
  flex-wrap: wrap;
}
.hero-stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: #fff; }
.hero-stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.45); }

.section { padding: 6rem 2rem; }
.section-center { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
.section-eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--volt-light); margin-bottom: 0.75rem; }

/* Feature cards */
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  transition: all 0.3s;
}
.feature-card:hover { border-color: rgba(124,58,237,0.35); transform: translateY(-4px); box-shadow: 0 12px 48px rgba(124,58,237,0.12); }
.feature-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
.feature-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.feature-desc { font-size: 0.88rem; color: rgba(255,255,255,0.55); line-height: 1.6; }

/* Pricing */
.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  position: relative;
  transition: all 0.3s;
}
.pricing-card.popular { border-color: var(--volt); box-shadow: 0 0 40px rgba(124,58,237,0.2); }
.popular-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--volt); color: #fff; padding: 0.25rem 1rem; border-radius: 100px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.price-amount { font-family: var(--font-display); font-size: 2.5rem; font-weight: 800; }
.price-period { font-size: 0.85rem; color: rgba(255,255,255,0.45); }
.price-features { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; margin: 1.5rem 0; }
.price-features li { display: flex; align-items: center; gap: 0.65rem; font-size: 0.88rem; color: rgba(255,255,255,0.75); }
.price-features li::before { content: '✓'; color: var(--neon); font-weight: 700; flex-shrink: 0; }

/* Footer */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
}
.footer-brand { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; margin-bottom: 0.5rem; }
.footer-links { display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; margin: 1.5rem 0; }
.footer-link { font-size: 0.85rem; color: rgba(255,255,255,0.5); cursor: pointer; transition: color 0.2s; }
.footer-link:hover { color: rgba(255,255,255,0.85); }
.footer-copy { font-size: 0.8rem; color: rgba(255,255,255,0.3); }

/* ===== LIVE STATUS ===== */
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 8px var(--neon);
  animation: livePulse 1.5s infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--neon); }
  50% { opacity: 0.5; box-shadow: 0 0 16px var(--neon); }
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: rgba(255,255,255,0.45);
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; color: rgba(255,255,255,0.6); margin-bottom: 0.5rem; }

/* ===== LOADER ===== */
.loader {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--volt-light);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-sm { width: 18px; height: 18px; border-width: 2px; margin: 0; }

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(124,58,237,0.15) 0%, transparent 60%);
  pointer-events: none;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  box-shadow: 0 32px 80px rgba(0,0,0,0.4);
}
.auth-logo { text-align: center; margin-bottom: 1.75rem; }

/* ===== TABS ===== */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab {
  padding: 0.65rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  margin-bottom: -1px;
}
.tab.active { color: var(--volt-light); border-bottom-color: var(--volt); }
.tab:hover:not(.active) { color: rgba(255,255,255,0.8); }

/* ===== AI PANEL ===== */
.ai-panel {
  background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(6,214,160,0.05));
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--grad-hero);
  color: #fff;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

/* ===== RESULTS DASHBOARD ===== */
.results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}
.stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: #fff; }
.stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.45); margin-top: 0.25rem; }

/* ===== CHART CONTAINER ===== */
.chart-container { position: relative; width: 100%; }

/* ===== EMOJI REACTIONS ===== */
.emoji-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s;
  line-height: 1;
}
.emoji-btn:hover { background: rgba(255,255,255,0.12); transform: scale(1.15); }

/* Floating reactions */
.reaction-float {
  position: fixed;
  bottom: 5rem;
  right: 2rem;
  font-size: 2rem;
  animation: floatUp 2s ease-out forwards;
  pointer-events: none;
  z-index: 9999;
}
@keyframes floatUp {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-120px) scale(1.5); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; max-width: 100vw; padding: 1rem; }
  .editor-layout { flex-direction: column; }
  .editor-sidebar { width: 100%; height: auto; max-height: 180px; flex-direction: row; overflow-x: auto; }
  .editor-panel { width: 100%; border-left: none; border-top: 1px solid var(--border); }
  .presenter-layout { grid-template-columns: 1fr; }
  .presenter-sidebar-panel { display: none; }
  .nav-links { display: none; }
  .hero-title { font-size: 2.5rem; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .modal { padding: 1.5rem; margin: 0.5rem; }
  .nav { padding: 0.75rem 1rem; }
  .audience-content { padding: 1rem; }
}

/* ===== DRAG AND DROP ===== */
.drag-over { border: 2px dashed var(--volt-light) !important; background: rgba(124,58,237,0.05) !important; }
.dragging { opacity: 0.5; transform: scale(0.98); }

/* ===== SCROLL ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ===== TRANSITIONS ===== */
.page-enter { animation: pageIn 0.25s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== QRCODE style ===== */
.qr-container {
  background: #fff;
  border-radius: var(--radius);
  padding: 0.75rem;
  display: inline-block;
}
