/* ═══════════════════════════════════════════════════════
   DESIGN TOKENS — typography
═══════════════════════════════════════════════════════ */
:root {
  --text-caption: 0.6875rem;
  --text-small: 0.8125rem;
  --text-body: 0.9375rem;
  --text-heading-sm: 1.125rem;
  --text-heading: 1.5rem;
  --text-display: clamp(1.75rem, 1.25rem + 2.8vw, 3.25rem);
  --color-page: #f8fafc;
  --color-hero: linear-gradient(160deg, #0f172a 0%, #1e293b 55%, #0f172a 100%);
}

.text-caption { font-size: var(--text-caption); line-height: 1.35; }
.text-small { font-size: var(--text-small); line-height: 1.45; }
.text-body { font-size: var(--text-body); line-height: 1.55; }
.text-heading-sm { font-size: var(--text-heading-sm); line-height: 1.35; }
.text-heading { font-size: var(--text-heading); line-height: 1.25; }
.hero-display {
  font-size: var(--text-display);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ═══════════════════════════════════════════════════════
   BASE
═══════════════════════════════════════════════════════ */
* { font-family: 'Inter', system-ui, sans-serif; }

body {
  background: var(--color-page);
  min-height: 100vh;
}

/* Sidebar: off-screen on small viewports; always visible md+ */
.sidebar-shell {
  transform: translate3d(-100%, 0, 0);
  will-change: transform;
}
.sidebar-shell.sidebar-open {
  transform: translate3d(0, 0, 0);
}
@media (min-width: 768px) {
  .sidebar-shell {
    transform: translate3d(0, 0, 0);
  }
  .sidebar-shell.sidebar-open {
    transform: translate3d(0, 0, 0);
  }
}

.main-with-sidebar {
  margin-left: 0;
  width: 100%;
  max-width: 100vw;
}
@media (min-width: 768px) {
  .main-with-sidebar {
    margin-left: 15rem;
    width: auto;
  }
}

.nav-section-heading {
  font-size: var(--text-caption);
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

/* ═══════════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
  50% { box-shadow: 0 0 16px 2px rgba(245, 158, 11, 0.12); }
}
@keyframes streak-flash {
  0% { background-color: transparent; }
  50% { background-color: rgba(245, 158, 11, 0.08); }
  100% { background-color: transparent; }
}

.animate-fade-in { animation: fadeIn 0.25s ease-out; }
.animate-slide-in { animation: slideIn 0.2s ease-out; }
.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }
.animate-streak { animation: streak-flash 0.6s ease-out; }

/* ═══════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════ */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
}
.nav-item:hover {
  color: #334155;
  background: #f1f5f9;
}
.nav-item.active {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
  font-weight: 600;
}
.nav-icon {
  font-size: 0.875rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════ */
.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card:hover {
  border-color: #d1d5db;
}
.card-interactive {
  cursor: pointer;
}
.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #d1d5db;
}

.card-inset {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.625rem;
}

/* ═══════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: #ffffff;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(217, 119, 6, 0.2);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.8125rem;
  color: #475569;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #1e293b;
}
.btn-secondary.active {
  color: #92400e;
  background: #fffbeb;
  border-color: #fcd34d;
}

/* ═══════════════════════════════════════════════════════
   CATEGORY BADGES
═══════════════════════════════════════════════════════ */
.cat-badge {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  display: inline-block;
  letter-spacing: 0.02em;
}
.cat-attack      { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.cat-disinfo     { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.cat-framing     { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.cat-manipulation{ background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.cat-digital     { background: #faf5ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.cat-emotional   { background: #fdf2f8; color: #9d174d; border: 1px solid #fbcfe8; }
.cat-cognitive   { background: #f0fdfa; color: #0f766e; border: 1px solid #99f6e4; }

/* ═══════════════════════════════════════════════════════
   QUIZ OPTIONS
═══════════════════════════════════════════════════════ */
.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: #334155;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.625rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.quiz-option:hover:not(.answered) {
  background: #fefce8;
  border-color: #fcd34d;
  transform: translateX(4px);
}
.quiz-option.correct {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}
.quiz-option.incorrect {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}
.quiz-option.neutral-answered {
  opacity: 0.5;
  cursor: default;
}
.quiz-option.answered {
  cursor: default;
}
.quiz-option.answered:hover {
  transform: none;
}

/* ═══════════════════════════════════════════════════════
   PROGRESS BARS
═══════════════════════════════════════════════════════ */
.progress-track {
  width: 100%;
  height: 0.375rem;
  background: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease;
}

/* ═══════════════════════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
.sidebar-scroll::-webkit-scrollbar { width: 3px; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
html, body { overflow-x: hidden; }
body { max-width: 100vw; }

#content h1, #content h2, #content h3 {
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow-wrap: anywhere;
}

/* ═══════════════════════════════════════════════════════
   UTILITY
═══════════════════════════════════════════════════════ */
.text-gradient {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═══════════════════════════════════════════════════════
   HOME HERO
   ═══════════════════════════════════════════════════════ */
.hero-dark {
  background: var(--color-hero);
  position: relative;
  overflow: hidden;
}
.hero-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0);
  background-size: 24px 24px;
  pointer-events: none;
}
.hero-dark::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -15%;
  width: 55%;
  height: 180%;
  background: radial-gradient(ellipse, rgba(245,158,11,0.06) 0%, transparent 55%);
  pointer-events: none;
}

.hero-quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.88);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.hero-quiz-option:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.2);
  transform: translateX(4px);
}
.hero-quiz-option.selected {
  background: rgba(255,255,255,0.18);
  border-color: rgba(245,158,11,0.5);
}

.hero-quiz-situation {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.75rem;
  padding: 1rem;
}

/* ═══════════════════════════════════════════════════════
   HOME CALLOUT / INPUT / DAILY
   ═══════════════════════════════════════════════════════ */
.callout-left {
  background: #ffffff;
  border: none;
  border-left: 4px solid;
  border-radius: 0 0.75rem 0.75rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Mantenuto per compatibilità con altre pagine */
.input-area {
  background: #fffbeb;
  border: 2px dashed #fcd34d;
  border-radius: 0.75rem;
  box-shadow: none;
  transition: border-color 0.2s ease;
}
.input-area:focus-within {
  border-color: #f59e0b;
}

/* ═══════════════════════════════════════════════════════
   HOME SECTION LABEL
   ═══════════════════════════════════════════════════════ */
.home-section-label {
  display: block;
  font-size: var(--text-caption);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

/* Techniques list — status dots */
.tech-status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  flex-shrink: 0;
}
.tech-status-dot--new { background: #e2e8f0; }
.tech-status-dot--explored { background: #f59e0b; }
.tech-status-dot--mastered { background: #10b981; }

.quiz-stat-grid .card { min-height: 5.5rem; }
.home-section-label--light {
  color: rgba(255,255,255,0.45);
}

/* ═══════════════════════════════════════════════════════
   DAILY TECHNIQUE CARD
   ═══════════════════════════════════════════════════════ */
.daily-card {
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  border: 1px solid rgba(245,158,11,0.22);
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  transition: border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}
.daily-card::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 50%;
  height: 180%;
  background: radial-gradient(ellipse, rgba(245,158,11,0.06) 0%, transparent 65%);
  pointer-events: none;
}
.daily-card:hover {
  border-color: rgba(245,158,11,0.4);
}

/* ═══════════════════════════════════════════════════════
   HOME ANALYZER CARD
   ═══════════════════════════════════════════════════════ */
.home-analyzer-card {
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(148,163,184,0.15);
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  position: relative;
  overflow: hidden;
}
.home-analyzer-card::after {
  content: '';
  position: absolute;
  bottom: -25%;
  left: -8%;
  width: 45%;
  height: 120%;
  background: radial-gradient(ellipse, rgba(245,158,11,0.05) 0%, transparent 60%);
  pointer-events: none;
}
.home-analyzer-textarea {
  width: 100%;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  resize: vertical;
  transition: border-color 0.2s ease, background 0.2s ease;
  font-family: inherit;
}
.home-analyzer-textarea::placeholder {
  color: rgba(255,255,255,0.35);
}
.home-analyzer-textarea:focus {
  outline: none;
  border-color: rgba(245,158,11,0.5);
  background: rgba(255,255,255,0.1);
}
.home-analyzer-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 9999px;
  padding: 0.25rem 0.625rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.home-analyzer-chip:hover {
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.9);
}

/* ═══════════════════════════════════════════════════════
   STAGGER ANIMATIONS
   ═══════════════════════════════════════════════════════ */
.stagger-1 { animation-delay: 0ms; }
.stagger-2 { animation-delay: 150ms; opacity: 0; animation-fill-mode: forwards; }
.stagger-3 { animation-delay: 300ms; opacity: 0; animation-fill-mode: forwards; }
.stagger-4 { animation-delay: 450ms; opacity: 0; animation-fill-mode: forwards; }

/* ═══════════════════════════════════════════════════════
   RESULT CARD (inside dark hero)
   ═══════════════════════════════════════════════════════ */
.result-card {
  background: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
