/* ==========================================================================
   AI Reality Quiz - Design System & Modern Glassmorphism Styling
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-dark: #0a0c14;
  --bg-card: rgba(18, 22, 37, 0.75);
  --bg-card-hover: rgba(26, 32, 53, 0.85);
  --bg-glass-border: rgba(255, 255, 255, 0.08);
  --bg-glass-shine: rgba(255, 255, 255, 0.03);

  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-violet: #7f5af0;
  --accent-magenta: #f72585;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --gradient-brand: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-ai: linear-gradient(135deg, #f72585 0%, #7209b7 100%);
  --gradient-classical: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
  --gradient-hero: radial-gradient(circle at 50% 0%, rgba(79, 172, 254, 0.15) 0%, rgba(10, 12, 20, 0) 70%);

  /* Shadows & Glows */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --glow-cyan: 0 0 25px rgba(0, 242, 254, 0.3);
  --glow-magenta: 0 0 25px rgba(247, 37, 133, 0.3);
  --glow-emerald: 0 0 25px rgba(16, 185, 129, 0.3);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  background-image: var(--gradient-hero);
  background-attachment: fixed;
}

/* Background Ambient Glows */
.ambient-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.35;
}

.glow-1 {
  top: -100px;
  right: -100px;
  background: radial-gradient(circle, #7f5af0, transparent 70%);
}

.glow-2 {
  bottom: 10%;
  left: -150px;
  background: radial-gradient(circle, #00f2fe, transparent 70%);
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Navigation */
header.app-header {
  padding: 24px 0;
  border-bottom: 1px solid var(--bg-glass-border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 12, 20, 0.85);
}

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

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

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-cyan);
  font-size: 1.2rem;
}

.brand-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid var(--bg-glass-border);
}

.nav-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  color: var(--text-main);
}

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

.btn-primary {
  background: var(--gradient-brand);
  color: #041226;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 25px rgba(0, 242, 254, 0.55);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--bg-glass-border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-accent {
  background: var(--gradient-ai);
  color: white;
  box-shadow: var(--glow-magenta);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(247, 37, 133, 0.5);
}

/* Hero Section */
.hero-section {
  padding: 60px 0 40px;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: rgba(79, 172, 254, 0.1);
  border: 1px solid rgba(79, 172, 254, 0.25);
  color: var(--accent-cyan);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-pill .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-alt {
  background: linear-gradient(135deg, #f72585, #b5179e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 36px;
}

.hero-cta-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

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

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-glass-border);
}

.stat-card-icon.cyan { color: var(--accent-cyan); background: rgba(0, 242, 254, 0.1); }
.stat-card-icon.magenta { color: var(--accent-magenta); background: rgba(247, 37, 133, 0.1); }
.stat-card-icon.emerald { color: var(--accent-emerald); background: rgba(16, 185, 129, 0.1); }

.stat-card-info h3 {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-card-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Chart Card Section */
.chart-section {
  margin: 50px 0;
}

.glass-box {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-head-title h2 {
  font-size: 1.6rem;
  font-weight: 700;
}

.section-head-title p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.chart-legend-custom {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 500;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-dot.ai {
  background: var(--accent-magenta);
  box-shadow: 0 0 8px rgba(247, 37, 133, 0.5);
}

.legend-dot.classical {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.chart-container-wrapper {
  position: relative;
  width: 100%;
  height: 480px;
  margin-top: 10px;
}

/* Activities Detailed Grid */
.activities-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 36px;
}

.activity-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.activity-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.activity-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.activity-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-category {
  font-size: 0.78rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.activity-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.activity-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-grow: 1;
}

.activity-real-tech {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #6ee7b7;
}

.activity-real-tech strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--accent-emerald);
  margin-bottom: 2px;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   QUIZ VIEW STYLES
   ========================================================================== */
.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.4s ease forwards;
}

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

.quiz-container {
  max-width: 780px;
  margin: 40px auto;
}

.quiz-progress-bar-wrap {
  margin-bottom: 30px;
}

.quiz-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 10px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-brand);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

.question-box {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.question-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-brand);
}

.q-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--bg-glass-border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 20px;
}

.q-title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
}

.scenario-callout {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--accent-blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin-bottom: 26px;
  font-size: 0.98rem;
  color: #cbd5e1;
}

.scenario-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--accent-blue);
  font-weight: 700;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 4px;
}

.prompt-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 28px;
}

/* Voting Options */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 30px;
}

@media (max-width: 640px) {
  .options-grid {
    grid-template-columns: 1fr;
  }
}

.option-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  font-family: inherit;
}

.option-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.option-btn.selected-ai {
  border-color: var(--accent-magenta);
  background: rgba(247, 37, 133, 0.12);
  box-shadow: 0 0 20px rgba(247, 37, 133, 0.25);
}

.option-btn.selected-no-ai {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.12);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
}

.option-icon {
  font-size: 2rem;
  margin-bottom: 4px;
}

.option-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.option-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.quiz-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--bg-glass-border);
  padding-top: 24px;
  margin-top: 10px;
}

/* ==========================================================================
   RESULTS VIEW STYLES
   ========================================================================== */
.results-container {
  max-width: 860px;
  margin: 40px auto;
}

.results-hero-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.score-circle-wrap {
  width: 140px;
  height: 140px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 4px solid var(--accent-cyan);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-cyan);
}

.score-number {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
}

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

.results-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.results-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 28px;
}

.results-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.feedback-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feedback-item {
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all var(--transition-fast);
}

.feedback-item.correct {
  border-left: 4px solid var(--accent-emerald);
}

.feedback-item.incorrect {
  border-left: 4px solid var(--accent-magenta);
}

.feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.feedback-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feedback-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-wrong {
  background: rgba(247, 37, 133, 0.15);
  color: #f472b6;
  border: 1px solid rgba(247, 37, 133, 0.3);
}

.user-vote-tag {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.user-vote-tag strong {
  color: var(--text-main);
}

.tech-explanation-box {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.55;
}

.tech-explanation-box .tech-name {
  color: var(--accent-cyan);
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}

/* Success Alert Banner */
.success-alert {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.2);
  animation: slideDown 0.4s ease forwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.success-alert-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.success-alert-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #34d399;
  flex-shrink: 0;
}

.success-alert-text h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ecfdf5;
}

.success-alert-text p {
  font-size: 0.88rem;
  color: #a7f3d0;
}

.success-alert-close {
  background: none;
  border: none;
  color: #a7f3d0;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.success-alert-close:hover {
  opacity: 1;
}

/* Footer */
footer.app-footer {
  margin-top: 80px;
  padding: 36px 0;
  border-top: 1px solid var(--bg-glass-border);
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-subtle);
}

.footer-privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Loading & Toast States */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  border-top-color: var(--accent-cyan);
  animation: spin 0.8s linear infinite;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  .glass-box {
    padding: 20px;
  }
  .chart-container-wrapper {
    height: 380px;
  }
  .question-box {
    padding: 24px 18px;
  }
}
