/* ═══════════════════════════════════════════════════════
   ANIMATIONS — Breathing, Crisis, Brain
   ═══════════════════════════════════════════════════════ */

/* ── Breathing Exercise ──────────────────────────────── */
.breathing-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.breathing-container {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.breathing-ring-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(77, 111, 255, 0.08);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.breathing-ring-mid {
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  border: 2px solid rgba(77, 111, 255, 0.2);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.breathing-circle {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1B6EC2, #1455A4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 32px rgba(27, 58, 107, 0.3);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s ease;
  cursor: default;
  user-select: none;
}

.breathing-phase {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
  line-height: 1;
}

.breathing-count {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  font-family: var(--font-sans);
}

/* Phase states */
.breathing-circle.phase-in  { background: linear-gradient(135deg, #1B6EC2, #1455A4); }
.breathing-circle.phase-hold { background: linear-gradient(135deg, #7C3AED, #5B21B6); }
.breathing-circle.phase-out { background: linear-gradient(135deg, #37683F, #2C5232); }

.breathing-instruction {
  font-size: 1rem;
  color: #374151;
  text-align: center;
  max-width: 280px;
  line-height: 1.6;
  min-height: 3em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.breathing-progress {
  width: 100%;
  max-width: 280px;
}

.breathing-progress-bar {
  height: 4px;
  background: var(--sand-300);
  border-radius: 99px;
  overflow: hidden;
}

.breathing-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1B6EC2, #3A8ED4);
  border-radius: 99px;
  transition: width 0.3s linear;
}

.breathing-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #9CA3AF;
  margin-top: 0.5rem;
}

/* ── Breathing page layout ───────────────────────────── */
.exercise-page { background: var(--deep-950); min-height: 100vh; }

.exercise-hero {
  background: var(--deep-950);
  padding: calc(var(--header-height) + 3rem) 0 3rem;
  text-align: center;
  color: white;
}

.exercise-hero__title { font-size: 2.25rem; font-weight: 700; color: white; }
.exercise-hero__subtitle { color: rgba(255,255,255,0.6); margin-top: 0.75rem; font-size: 1.125rem; }

.exercise-interactive {
  background: var(--deep-950);
  padding: 3rem 0 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exercise-content {
  background: white;
  padding: 4rem 0;
}

/* ── Grounding 5-4-3-2-1 ─────────────────────────────── */
.grounding-step {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1rem;
  padding: 1.25rem;
  opacity: 0.4;
  transition: opacity 0.5s ease, background 0.3s ease;
}

.grounding-step.active {
  opacity: 1;
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
}

.grounding-step.done { opacity: 0.6; }

.grounding-step__num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  color: white;
  flex-shrink: 0;
}

.grounding-step__sense { font-size: 0.625rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 0.25rem; }
.grounding-step__prompt { font-size: 0.9375rem; color: rgba(255,255,255,0.85); line-height: 1.5; }

/* ── Timer ───────────────────────────────────────────── */
.timer-display {
  font-size: 4.5rem;
  font-weight: 700;
  font-family: var(--font-sans);
  color: white;
  line-height: 1;
  text-align: center;
  letter-spacing: -0.02em;
}

.timer-label { font-size: 0.8125rem; color: rgba(255,255,255,0.4); text-align: center; margin-bottom: 1rem; }

/* ── Crisis mode styles ──────────────────────────────── */
.crisis-page { background: var(--deep-950); min-height: 100vh; color: white; }

.crisis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.crisis-back {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.5);
  font-size: 0.875rem;
  transition: color 0.2s;
  text-decoration: none;
}

.crisis-back:hover { color: white; }
.crisis-back svg { width: 16px; height: 16px; }

.crisis-emergency {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 0.75rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #FCA5A5;
  text-decoration: none;
  transition: background 0.2s;
}

.crisis-emergency:hover { background: rgba(239,68,68,0.25); }
.crisis-emergency svg { width: 16px; height: 16px; }

.crisis-content {
  max-width: 560px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.crisis-step { animation: fadeUp 0.5s ease both; }

.crisis-step__icon {
  width: 64px;
  height: 64px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.crisis-step__icon svg { width: 32px; height: 32px; color: rgba(255,255,255,0.5); }

.crisis-step__title {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 700;
  color: white;
  text-align: center;
  margin-bottom: 1rem;
}

.crisis-step__text {
  color: rgba(255,255,255,0.65);
  line-height: 1.8;
  text-align: center;
  font-size: 1rem;
}

.crisis-step__text strong { color: white; }

.crisis-info-box {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1rem;
  padding: 1.25rem;
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.75;
}

.crisis-info-box strong { color: white; }

.crisis-actions { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; }

.crisis-action-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1rem;
  padding: 1.25rem;
  cursor: pointer;
  transition: background 0.2s;
  text-align: left;
  width: 100%;
  color: white;
}

.crisis-action-btn:hover { background: rgba(255,255,255,0.09); }
.crisis-action-btn__title { font-weight: 600; font-size: 1rem; }
.crisis-action-btn__sub { font-size: 0.8125rem; color: rgba(255,255,255,0.45); margin-top: 0.25rem; }
.crisis-action-btn svg { width: 20px; height: 20px; color: rgba(255,255,255,0.3); flex-shrink: 0; }

.crisis-urgency {
  margin-top: 1.5rem;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 1rem;
  padding: 1.25rem;
  font-size: 0.875rem;
  color: #FCA5A5;
  line-height: 1.75;
}

.crisis-urgency strong { color: #FCA5A5; }
.crisis-urgency .tel { font-weight: 700; color: #FCD34D; }

.crisis-timer-box {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  margin-top: 1.5rem;
}

.crisis-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  color: white;
  transition: background 0.2s;
}

.crisis-btn:hover { background: rgba(255,255,255,0.14); }
.crisis-btn--primary { background: var(--deep-700); border-color: var(--deep-600); }
.crisis-btn--primary:hover { background: var(--deep-600); }

/* Grounding page */
.grounding-steps { display: flex; flex-direction: column; gap: 0.75rem; margin: 1.5rem 0; }

/* Success screen */
.crisis-success {
  text-align: center;
  animation: fadeUp 0.6s ease both;
}

.crisis-success__icon {
  width: 80px;
  height: 80px;
  background: rgba(74,130,87,0.2);
  border: 1px solid rgba(74,130,87,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.crisis-success__icon svg { width: 40px; height: 40px; color: #9DC0A4; }

.post-crisis {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1rem;
  padding: 1.25rem;
  margin-top: 1.5rem;
  text-align: left;
}

.post-crisis__title { font-size: 0.875rem; font-weight: 600; color: white; margin-bottom: 0.75rem; }

.post-crisis__list { display: flex; flex-direction: column; gap: 0.625rem; }

.post-crisis__item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.65);
}

.post-crisis__item svg { width: 16px; height: 16px; color: #9DC0A4; flex-shrink: 0; margin-top: 2px; }

/* ── Symptom detail page ─────────────────────────────── */
.symptom-page { background: var(--sand-100); }

.symptom-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: flex-start;
}

.symptom-section { margin-bottom: 2rem; }

.symptom-section__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.symptom-section__icon {
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.symptom-section__icon svg { width: 16px; height: 16px; }
.symptom-section__title { font-family: var(--font-sans); font-size: 1.25rem; font-weight: 700; color: var(--deep-900); }

.symptom-feeling {
  background: var(--sand-200);
  border: 1px solid var(--sand-300);
  border-radius: 1rem;
  padding: 1.5rem;
  color: #374151;
  line-height: 1.8;
}

.symptom-bio {
  background: var(--sage-50);
  border: 1px solid var(--sage-200);
  border-radius: 1rem;
  padding: 1.5rem;
  font-size: 0.9375rem;
  color: #374151;
  line-height: 1.8;
}

.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

.help-card {
  background: white;
  border: 1px solid var(--sand-300);
  border-radius: 1rem;
  padding: 1.25rem;
}

.help-card__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--deep-900);
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
}

.help-card__title svg { width: 18px; height: 18px; }

.help-list { display: flex; flex-direction: column; gap: 0.625rem; }

.help-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #374151;
}

.help-item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.help-card--short .help-item::before { background: #D9634E; }
.help-card--long  .help-item::before { background: #37683F; }

.mistake-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 0.625rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #991B1B;
}

.mistake-item svg { width: 16px; height: 16px; color: #F87171; flex-shrink: 0; margin-top: 1px; }

.reassurance-item {
  background: var(--sage-50);
  border: 1px solid var(--sage-200);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  color: #2C5232;
  line-height: 1.65;
  font-style: italic;
}

/* Sidebar */
.symptom-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }

.sidebar-card {
  background: white;
  border: 1px solid var(--sand-300);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-card--warn { background: var(--warm-50); border-color: var(--warm-200); }
.sidebar-card--dark { background: var(--deep-900); border-color: var(--deep-700); color: white; }

.sidebar-card__title { font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.875rem; }
.sidebar-card--warn .sidebar-card__title { color: #92400E; }
.sidebar-card--dark .sidebar-card__title { color: white; }

.when-list { display: flex; flex-direction: column; gap: 0.625rem; }
.when-item { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.875rem; }
.when-item::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #D9634E; flex-shrink: 0; margin-top: 6px; }
.sidebar-card--warn .when-item { color: #78350F; }

@media (max-width: 900px) {
  .symptom-layout { grid-template-columns: 1fr; }
  .help-grid { grid-template-columns: 1fr; }
}
