/* ==========================================================================
   NEUROFLOW — ADHD Cognitive Sanctuary & Focus Engine
   Curated Sensory Design System & Responsive Architecture
   ========================================================================== */

/* --- 1. CSS Custom Properties / Design Tokens --- */
:root {
  /* Default Theme: Deep Obsidian (Cosmic & Low Eye-Strain) */
  --bg-core: #090D16;
  --bg-surface: #0F172A;
  --bg-card: rgba(30, 41, 59, 0.65);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(139, 92, 246, 0.4);

  --accent-primary: #8B5CF6;       /* Luminous Electric Violet */
  --accent-secondary: #06B6D4;     /* Crisp Cyan */
  --accent-success: #10B981;       /* Dopamine Mint */
  --accent-warning: #F59E0B;       /* Warm Amber */
  --accent-danger: #EF4444;

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --glow-1: rgba(139, 92, 246, 0.15);
  --glow-2: rgba(6, 182, 212, 0.12);

  --font-display: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

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

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px -3px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 35px -5px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 35px -5px var(--accent-primary);

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Theme 2: Calm Sage (Parasympathetic Calming / Anxiety Reducer) */
[data-theme="sage"] {
  --bg-core: #0C1310;
  --bg-surface: #131E19;
  --bg-card: rgba(22, 38, 30, 0.7);
  --bg-card-hover: rgba(26, 46, 36, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-focus: rgba(52, 211, 153, 0.45);

  --accent-primary: #34D399;       /* Fresh Calm Sage */
  --accent-secondary: #2DD4BF;     /* Soft Seafoam */
  --accent-success: #10B981;
  --accent-warning: #FBBF24;

  --text-primary: #F0FDF4;
  --text-secondary: #86EFAC;
  --text-muted: #4B6B58;

  --glow-1: rgba(52, 211, 153, 0.15);
  --glow-2: rgba(45, 212, 191, 0.12);
  --shadow-glow: 0 0 30px -5px rgba(52, 211, 153, 0.35);
}

/* Theme 3: Sunset Dopamine (Energy & Sluggish Brain Activator) */
[data-theme="sunset"] {
  --bg-core: #130B12;
  --bg-surface: #1E111D;
  --bg-card: rgba(43, 22, 39, 0.65);
  --bg-card-hover: rgba(54, 27, 49, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(244, 63, 94, 0.45);

  --accent-primary: #F43F5E;       /* Radiant Rose Coral */
  --accent-secondary: #FB923C;     /* Sunburst Orange */
  --accent-success: #34D399;
  --accent-warning: #F59E0B;

  --text-primary: #FFF1F2;
  --text-secondary: #FDA4AF;
  --text-muted: #885566;

  --glow-1: rgba(244, 63, 94, 0.18);
  --glow-2: rgba(251, 146, 60, 0.14);
  --shadow-glow: 0 0 35px -5px rgba(244, 63, 94, 0.4);
}

/* --- 2. Baseline & Resets --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  min-height: 100vh;
  background-color: var(--bg-core);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
}

/* Canvas Confetti Layer */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* Subtle Ambient Glows */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  transition: background var(--transition-normal);
}

.glow-1 {
  top: -10vw;
  left: 15vw;
  width: 45vw;
  height: 45vw;
  background: var(--glow-1);
}

.glow-2 {
  bottom: -15vw;
  right: 10vw;
  width: 50vw;
  height: 50vw;
  background: var(--glow-2);
}

/* Utility Containers */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* --- 3. Header & Gamification Bar --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(9, 13, 22, 0.75);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

[data-theme="sage"] .app-header {
  background: rgba(12, 19, 16, 0.8);
}
[data-theme="sunset"] .app-header {
  background: rgba(19, 11, 18, 0.8);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  box-shadow: 0 4px 14px -2px var(--accent-primary);
}

.brand-icon svg {
  width: 24px;
  height: 24px;
  animation: rotateSlow 24s linear infinite;
}

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: block;
}

.brand-title span {
  background: linear-gradient(120deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: block;
}

/* Gamification Momentum Bar */
.momentum-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.streak-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-warning);
}

.streak-flame {
  font-size: 1.1rem;
  animation: flicker 1.8s ease-in-out infinite alternate;
}

@keyframes flicker {
  0% { transform: scale(1) rotate(-3deg); }
  100% { transform: scale(1.15) rotate(3deg); }
}

.xp-container {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 170px;
}

.xp-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
}

.level-badge {
  color: var(--accent-secondary);
}

.xp-text {
  color: var(--text-muted);
  font-family: var(--font-mono);
}

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

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

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-btn, .action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.icon-btn:hover, .action-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  transform: translateY(-1px);
}

.icon-btn:active, .action-btn:active {
  transform: translateY(0);
}

/* Audio Wave Animation in Button */
.audio-wave-anim {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
  height: 14px;
}

.audio-wave-anim span {
  display: block;
  width: 3px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: all 0.2s ease;
}

.audio-active .audio-wave-anim span {
  background: var(--accent-secondary);
}

.audio-active .audio-wave-anim span:nth-child(1) {
  animation: wave 0.8s ease-in-out infinite alternate;
}
.audio-active .audio-wave-anim span:nth-child(2) {
  animation: wave 0.8s ease-in-out 0.25s infinite alternate;
}
.audio-active .audio-wave-anim span:nth-child(3) {
  animation: wave 0.8s ease-in-out 0.5s infinite alternate;
}

@keyframes wave {
  0% { height: 4px; }
  100% { height: 16px; }
}

.brain-dump-btn {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.1));
  border-color: rgba(139, 92, 246, 0.3);
  position: relative;
}

.shortcut-tag {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.35rem;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.dump-badge {
  background: var(--accent-primary);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  font-weight: 700;
}

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  font-size: 1.1rem;
}

/* --- 4. Main App Grid Layout --- */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.75rem;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

/* Common Card Styles */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.header-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
}

.help-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Buttons System */
.btn {
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #FFF;
  box-shadow: 0 4px 15px -3px var(--accent-primary);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px -2px var(--accent-primary);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-focus);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-success), #059669);
  color: #FFF;
  box-shadow: 0 4px 15px -3px var(--accent-success);
}

.btn-success:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px -4px var(--accent-success);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

/* --- 5. Flow Section: Task Atomizer --- */
.flow-section {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.atomizer-card {
  position: relative;
  overflow: hidden;
}

.atomizer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-success));
}

.atomizer-form {
  margin-bottom: 1.25rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.4rem 0.35rem 1.1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--glow-1);
}

.atomizer-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.05rem;
  outline: none;
}

.atomizer-input::placeholder {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.break-down-btn {
  flex-shrink: 0;
  padding: 0.7rem 1.3rem;
  font-size: 0.9rem;
}

/* Quick Start Roadblock Presets */
.quick-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.presets-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 0.25rem;
}

.preset-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-pill:hover {
  background: var(--glow-1);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* --- 6. Active Task Sanctuary & Monotasking View --- */
.active-sanctuary-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sanctuary-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem;
}

.mode-toggles {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.2rem;
}

.mode-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.mode-tab.active {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.task-overall-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-ratio {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.mini-progress-bar {
  width: 90px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.mini-progress-fill {
  height: 100%;
  background: var(--accent-success);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* TUNNEL VISION: Monotask Focus Card */
.monotask-card {
  min-height: 290px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
  border: 1.5px solid var(--border-focus);
  box-shadow: var(--shadow-glow), var(--shadow-lg);
  padding: 2.5rem;
}

.monotask-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-secondary);
  text-transform: uppercase;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-secondary);
  box-shadow: 0 0 10px var(--accent-secondary);
  animation: pulseBeacon 1.8s infinite;
}

@keyframes pulseBeacon {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.time-estimate {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: none;
}

.current-step-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 1rem 0 0.75rem 0;
  letter-spacing: -0.01em;
}

.current-step-guidance {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-style: italic;
  margin-bottom: 2rem;
  border-left: 2px solid var(--accent-primary);
  padding-left: 0.85rem;
}

.monotask-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.complete-step-btn {
  font-size: 1.1rem;
  padding: 0.9rem 2rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  letter-spacing: -0.01em;
}

.skip-step-btn {
  font-size: 0.9rem;
  padding: 0.85rem 1.4rem;
}

/* ROADMAP LIST VIEW */
.roadmap-card {
  padding: 1.75rem;
}

.roadmap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.roadmap-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--accent-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.btn-text-action:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

.step-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.step-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  gap: 1rem;
  transition: all var(--transition-fast);
}

.step-item.active {
  border-color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.08);
  box-shadow: 0 0 15px -3px var(--glow-1);
}

.step-item.completed {
  opacity: 0.55;
  text-decoration: line-through;
  background: rgba(16, 185, 129, 0.05);
}

.step-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
}

.step-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--border-subtle);
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  transition: all var(--transition-fast);
}

.step-checkbox:checked {
  background: var(--accent-success);
  border-color: var(--accent-success);
}

.step-checkbox:checked::before {
  content: '✓';
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.step-index-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.step-text {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.step-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.step-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.step-del-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.2rem;
  border-radius: var(--radius-sm);
}

.step-del-btn:hover {
  color: var(--accent-danger);
}

/* Celebration Card */
.task-celebration-card {
  text-align: center;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.1));
  border: 2px solid var(--accent-success);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  box-shadow: 0 0 40px -5px rgba(16, 185, 129, 0.3);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.celebration-emoji {
  font-size: 4rem;
  margin-bottom: 0.75rem;
  animation: bounce 1.2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.celebration-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-success);
  margin-bottom: 0.5rem;
}

.celebration-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.celebration-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2.25rem;
}

.stat-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.celebration-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --- 7. Sidebar: Visual Time Anchor & Sensory Companion --- */
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.timer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.timer-mode-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--glow-1);
  color: var(--accent-primary);
  border: 1px solid var(--border-focus);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

/* Timer Duration Presets */
.timer-presets {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  width: 100%;
  justify-content: center;
}

.time-preset-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  transition: all var(--transition-fast);
}

.time-preset-btn small {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
}

.time-preset-btn.active {
  background: var(--glow-1);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.time-preset-btn.active small {
  color: var(--accent-primary);
}

/* Radial Visual Dial */
.radial-dial-wrapper {
  position: relative;
  width: 240px;
  height: 240px;
  margin-bottom: 1.5rem;
}

.radial-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.radial-bg-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 12;
}

.radial-progress-arc {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 691; /* 2 * PI * 110 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.8s ease, stroke 0.5s ease;
}

.radial-center-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timer-display {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  line-height: 1;
}

.timer-substatus {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-weight: 500;
}

/* Timer Control Buttons */
.timer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  margin-bottom: 1.5rem;
}

.timer-mainbtn {
  flex: 1;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

.timer-subbtn {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
}

/* Time Blindness Sensory Chime Toggle */
.pacing-chime-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.9rem;
  width: 100%;
  justify-content: space-between;
}

.switch-container {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.switch-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 20px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .switch-slider {
  background-color: var(--accent-primary);
}

input:checked + .switch-slider:before {
  transform: translateX(18px);
}

.switch-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ADHD Truth & Affirmation Card */
.reminder-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(6, 182, 212, 0.04));
  border-color: rgba(139, 92, 246, 0.2);
}

.reminder-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.reminder-text strong {
  display: block;
  font-size: 0.85rem;
  color: var(--accent-primary);
  margin-bottom: 0.2rem;
}

.reminder-text p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- 8. Modals & Drawers System --- */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  display: flex;
  justify-content: flex-end;
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer-panel {
  width: 100%;
  max-width: 520px;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}

.drawer-overlay.active .drawer-panel {
  transform: translateX(0);
}

.vault-panel {
  max-width: 680px;
}

.audio-panel {
  max-width: 540px;
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.drawer-icon {
  font-size: 1.8rem;
}

.drawer-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.drawer-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.close-drawer-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
  transition: color var(--transition-fast);
}

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

/* Brain Dump Content */
.dump-input-group {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.dump-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.dump-input:focus {
  border-color: var(--accent-primary);
}

.dump-items-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.empty-dump-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

.dump-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  gap: 1rem;
}

.dump-text {
  font-size: 0.92rem;
  color: var(--text-primary);
  word-break: break-word;
}

.dump-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.dump-action-btn {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--accent-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dump-action-btn:hover {
  background: var(--glow-2);
  border-color: var(--accent-secondary);
}

.dump-del-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.2rem;
}

.dump-del-btn:hover {
  color: var(--accent-danger);
}

/* Vault 2-Minute Grid */
.vault-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.recharge-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
}

.recharge-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
}

.recharge-card h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.recharge-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Box Breathing Visualizer */
.breathing-circle-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 90px;
  margin: 0.5rem 0;
}

.breathing-circle {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-primary), var(--accent-secondary));
  box-shadow: 0 0 20px var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  transition: all 4s ease-in-out;
}

/* Audio Sound Grid */
.audio-sound-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.sound-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.6rem;
  transition: all var(--transition-fast);
}

.sound-card:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-focus);
}

.sound-card.active {
  border-color: var(--accent-secondary);
  background: rgba(6, 182, 212, 0.08);
  box-shadow: 0 0 15px -3px var(--glow-2);
}

.sound-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sound-icon {
  font-size: 1.25rem;
}

.sound-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.sound-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.sound-indicator {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-secondary);
}

.sound-card:not(.active) .sound-indicator {
  color: var(--text-muted);
}

/* Master Audio Controls */
.audio-controls-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.audio-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.audio-status-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.volume-slider-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.volume-icon {
  font-size: 1.1rem;
}

.custom-slider {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  accent-color: var(--accent-secondary);
}

.volume-percent {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  width: 40px;
}

.ui-sound-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

/* --- 9. Responsive Adjustments --- */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-section {
    order: -1; /* Place timer above on tablet/mobile if desired, or keep natural order */
  }

  .vault-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
  }

  .momentum-bar {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .monotask-card {
    padding: 1.75rem 1.25rem;
  }

  .current-step-title {
    font-size: 1.45rem;
  }

  .drawer-panel {
    max-width: 100vw;
  }

  .audio-sound-grid {
    grid-template-columns: 1fr;
  }
}

/* --- 10. Sensory & Accessibility Preferences --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
