/* ==========================================================================
   DSA TRACKER PRO - ELEVATED DESIGN SYSTEM & STYLING (UI/UX PRO MAX)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

/* --- CSS Variables & Theme Tokens --- */
:root {
  /* Default OLED/Space Dark Theme Tokens */
  --bg-base: #030712;
  --bg-surface: #0b0f19;
  --bg-surface-elevated: #151d2a;
  --bg-glass: rgba(11, 15, 25, 0.8);
  --bg-glass-elevated: rgba(21, 29, 42, 0.88);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.45);
  --border-active: #6366f1;

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

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.14);
  --primary-glow: rgba(99, 102, 241, 0.35);

  --secondary: #8b5cf6;
  --secondary-light: rgba(139, 92, 246, 0.14);
  
  --accent: #d946ef;
  --accent-light: rgba(217, 70, 239, 0.14);

  --success: #10b981;
  --success-hover: #059669;
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.35);
  --success-glow: rgba(16, 185, 129, 0.25);

  --warning: #f59e0b;
  --warning-hover: #d97706;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.3);
  
  --danger: #f43f5e;
  --danger-bg: rgba(244, 63, 94, 0.12);
  --danger-border: rgba(244, 63, 94, 0.3);

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 35px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.3);
  --shadow-emerald: 0 0 24px rgba(16, 185, 129, 0.3);

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

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

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-mono: 'Fira Code', monospace;
}

/* Light Theme Overrides (WCAG AAA Contrast Compliant) */
[data-theme="light"] {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --bg-glass-elevated: rgba(241, 245, 249, 0.92);

  --border-color: #e2e8f0;
  --border-hover: #818cf8;
  --border-active: #4f46e5;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --text-inverse: #f8fafc;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: rgba(79, 70, 229, 0.08);
  --primary-glow: rgba(79, 70, 229, 0.2);

  --secondary: #7c3aed;
  --accent: #c026d3;

  --success: #059669;
  --success-hover: #047857;
  --success-bg: #d1fae5;
  --success-border: #6ee7b7;

  --warning: #d97706;
  --warning-bg: #fef3c7;

  --danger: #e11d48;
  --danger-bg: #ffe4e6;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 28px -4px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.18);
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-base);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
  color: var(--text-main);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  user-select: none;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

ul, ol {
  list-style: none;
}

/* --- App Container --- */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem 1.5rem;
  width: 100%;
  flex: 1;
}

/* ==========================================================================
   NAVIGATION HEADER
   ========================================================================== */

.header {
  position: sticky;
  top: 1rem;
  z-index: 100;
  margin-bottom: 2.25rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: border-color var(--transition-fast), background-color var(--transition-normal), box-shadow var(--transition-normal);
}

.header:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  cursor: pointer;
}

.brand-icon {
  width: 2.75rem;
  height: 2.75rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-bounce);
}

.brand:hover .brand-icon {
  transform: scale(1.05) rotate(-3deg);
}

.brand-icon::after {
  content: '';
  position: absolute;
  inset: -50%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: rotate(45deg) translateY(-100%);
  transition: transform 0.6s ease;
}

.brand:hover .brand-icon::after {
  transform: rotate(45deg) translateY(100%);
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-main) 30%, var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-subtle);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface-elevated);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: var(--text-main);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-full);
}

.nav-tab svg {
  width: 1.15rem;
  height: 1.15rem;
  transition: transform var(--transition-fast);
}

.nav-tab:hover svg {
  transform: translateY(-1px);
}

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

.icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
  background: var(--bg-surface-elevated);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glow);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
  background: linear-gradient(135deg, #6b6eff, #4338ca);
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-danger:hover {
  background: var(--danger);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
  transform: translateY(-1px);
}

/* --- View Container --- */
.tab-content {
  display: none;
  animation: viewFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-content.active {
  display: block;
}

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

/* ==========================================================================
   DASHBOARD SECTION
   ========================================================================== */

/* Hero Banner */
.hero-banner {
  position: relative;
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-surface-elevated));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 2.25rem;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--primary-glow) 0%, rgba(139, 92, 246, 0.15) 50%, transparent 70%);
  pointer-events: none;
  filter: blur(30px);
}

.hero-banner::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: 20%;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(25px);
}

.hero-text h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--text-main) 40%, var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 620px;
  line-height: 1.6;
}

/* Radial Progress Ring Card */
.overall-progress-card {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  background: var(--bg-glass-elevated);
  backdrop-filter: blur(16px);
  padding: 1.5rem 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.overall-progress-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
}

.progress-ring-container {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}

.progress-ring-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.progress-ring-circle-bg {
  stroke: var(--border-color);
  stroke-width: 8;
  fill: transparent;
}

.progress-ring-circle {
  stroke-width: 8;
  stroke-linecap: round;
  fill: transparent;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-main);
}

.progress-ring-text span {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.overall-stats-detail {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.overall-stats-detail .stat-num {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
}

.overall-stats-detail .stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Key Stats Grid (Bento Style) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.25rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.stat-icon-wrapper {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-bounce);
}

.stat-card:hover .stat-icon-wrapper {
  transform: scale(1.1);
}

.stat-icon-wrapper.indigo {
  background: var(--primary-light);
  color: var(--primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.stat-icon-wrapper.emerald {
  background: var(--success-bg);
  color: var(--success);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.stat-icon-wrapper.amber {
  background: var(--warning-bg);
  color: var(--warning);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.stat-icon-wrapper.purple {
  background: var(--secondary-light);
  color: var(--secondary);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
}

.stat-title {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Activity Heatmap Section */
.heatmap-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2.25rem;
  box-shadow: var(--shadow-sm);
}

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

.section-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title svg {
  color: var(--primary);
  width: 1.35rem;
  height: 1.35rem;
}

.phases-section {
  margin-bottom: 2.25rem;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  gap: 6px;
  overflow-x: auto;
  padding: 0.5rem 0;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 5px;
  background: var(--bg-surface-elevated);
  position: relative;
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.heatmap-cell:hover {
  transform: scale(1.35);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.heatmap-cell[data-level="0"] { background: var(--bg-surface-elevated); }
.heatmap-cell[data-level="1"] { background: rgba(16, 185, 129, 0.3); }
.heatmap-cell[data-level="2"] { background: rgba(16, 185, 129, 0.55); }
.heatmap-cell[data-level="3"] { background: rgba(16, 185, 129, 0.8); }
.heatmap-cell[data-level="4"] { 
  background: var(--success); 
  box-shadow: var(--shadow-emerald); 
}

/* Phases Overview Bento Grid */
.phases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.35rem;
}

.phase-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.phase-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
  transition: background 0.3s ease;
}

.phase-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.phase-card:hover::before {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.phase-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.phase-number-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.phase-card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
}

.phase-card-stats {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.phase-progress-bar-bg {
  width: 100%;
  height: 9px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

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

.phase-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.btn-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: gap var(--transition-fast), color var(--transition-fast);
}

.btn-text:hover {
  gap: 0.6rem;
  color: var(--secondary);
}

/* ==========================================================================
   CHECKLIST SECTION
   ========================================================================== */

/* Search & Filter Toolbar */
.toolbar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.5rem;
  margin-bottom: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  width: 1.15rem;
  height: 1.15rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.7rem 2.75rem 0.7rem 2.75rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--bg-surface);
}

.search-shortcut {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-subtle);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-wrap: wrap;
}

.select-input {
  padding: 0.7rem 2.25rem 0.7rem 1rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  background-size: 1rem;
  transition: all var(--transition-fast);
}

.select-input:focus {
  outline: none;
  border-color: var(--primary);
}

.status-tabs {
  display: flex;
  background: var(--bg-surface-elevated);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.status-tab-btn {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.status-tab-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* Phase Accordion Container */
.phase-accordion-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.phase-accordion-item:hover {
  border-color: var(--border-hover);
}

.phase-accordion-header {
  padding: 1.35rem 1.75rem;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--transition-fast);
}

.phase-accordion-header:hover {
  background: var(--bg-surface-elevated);
}

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

.phase-toggle-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--text-subtle);
  transition: transform var(--transition-normal);
}

.phase-accordion-item.open .phase-toggle-icon {
  transform: rotate(90deg);
  color: var(--primary);
}

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

.phase-header-right {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.phase-progress-pill {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.phase-progress-pill.completed {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}

/* Phase Body Content */
.phase-accordion-body {
  display: none;
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 1.75rem;
  background: var(--bg-base);
}

.phase-accordion-item.open .phase-accordion-body {
  display: block;
  animation: bodyExpand 0.3s ease;
}

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

.category-group {
  margin-bottom: 1.75rem;
}

.category-group:last-child {
  margin-bottom: 0;
}

.category-header {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.category-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* Problem Items */
.problem-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.problem-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.problem-row:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-elevated);
  transform: translateX(4px);
}

.problem-row.is-completed {
  background: rgba(16, 185, 129, 0.03);
  border-color: rgba(16, 185, 129, 0.2);
}

.problem-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

/* Custom Animated Checkbox */
.checkbox-custom {
  position: relative;
  width: 1.45rem;
  height: 1.45rem;
  appearance: none;
  background: var(--bg-surface-elevated);
  border: 2px solid var(--text-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.checkbox-custom:hover {
  border-color: var(--primary);
  transform: scale(1.08);
}

.checkbox-custom:checked {
  background: var(--success);
  border-color: var(--success);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.checkbox-custom:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  animation: checkRipple 0.2s ease;
}

@keyframes checkRipple {
  from { transform: rotate(45deg) scale(0); }
  to { transform: rotate(45deg) scale(1); }
}

.problem-index {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-subtle);
  min-width: 2.3rem;
}

.problem-lc-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--primary);
  white-space: nowrap;
}

.problem-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition-fast), text-decoration var(--transition-fast);
}

.problem-row.is-completed .problem-title {
  color: var(--text-muted);
  text-decoration: line-through;
}

.problem-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.btn-note {
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-note:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

.btn-note.has-note {
  background: var(--secondary-light);
  color: var(--secondary);
  border-color: rgba(139, 92, 246, 0.35);
}

.btn-lc-link {
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-lc-link:hover {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 12px var(--primary-glow);
}

/* Difficulty Badges */
.difficulty-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.difficulty-easy {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.difficulty-medium {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.difficulty-hard {
  background: rgba(244, 63, 94, 0.12);
  color: var(--danger);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

/* Phase Theoretical Checkpoints Callout Box */
.checkpoint-box {
  margin-top: 1.75rem;
  padding: 1.5rem;
  background: var(--bg-surface);
  border: 1px dashed rgba(139, 92, 246, 0.4);
  border-left: 4px solid var(--secondary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.checkpoint-box-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.875rem;
}

.checkpoint-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.checkpoint-item {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  line-height: 1.5;
}

/* ==========================================================================
   GOALS & MILESTONES SECTION
   ========================================================================== */

.goals-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.25rem;
}

.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.35rem;
  margin-bottom: 3.5rem;
}

.goal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.35rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all var(--transition-fast);
}

.goal-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.goal-card.completed {
  border-color: var(--success-border);
  background: rgba(16, 185, 129, 0.02);
}

.goal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.goal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.goal-date {
  font-size: 0.78rem;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.goal-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  flex-shrink: 0;
}

.goal-badge.completed {
  background: var(--success-bg);
  color: var(--success);
}

.milestones-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
}

.milestones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.35rem;
  margin-top: 1.75rem;
}

.milestone-badge-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  transition: all var(--transition-fast);
}

.milestone-badge-card.unlocked {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: var(--shadow-glow);
}

.milestone-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  border: 2px solid var(--border-color);
  transition: transform var(--transition-bounce);
}

.milestone-badge-card.unlocked .milestone-icon {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 0 20px var(--primary-glow);
  transform: scale(1.08);
}

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

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

/* ==========================================================================
   SETTINGS & DATA BACKUP SECTION
   ========================================================================== */

.settings-container {
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.settings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
}

.settings-card-header {
  margin-bottom: 1.75rem;
}

.settings-card-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.settings-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}

/* Pulse status dot */
.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--success);
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* ==========================================================================
   MODALS & OVERLAYS
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: modalFadeIn 0.2s ease;
}

.modal-backdrop.active {
  display: flex;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  overflow: hidden;
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 1.35rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.modal-body {
  padding: 1.75rem;
}

.modal-footer {
  padding: 1.2rem 1.75rem;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.875rem;
}

.form-group {
  margin-bottom: 1.35rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--text-main);
}

.form-input, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.925rem;
  transition: all var(--transition-fast);
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--bg-surface);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-mono);
  line-height: 1.5;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 1rem 1.35rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.success {
  border-color: var(--success-border);
  color: var(--success);
  box-shadow: var(--shadow-emerald);
}

/* Footer */
.footer {
  text-align: center;
  padding: 2.5rem 0;
  font-size: 0.85rem;
  color: var(--text-subtle);
  border-top: 1px solid var(--border-color);
  margin-top: 4.5rem;
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .hero-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .overall-progress-card {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-tabs {
    overflow-x: auto;
    width: 100%;
    padding: 0.25rem;
  }

  .nav-tab {
    padding: 0.5rem 0.85rem;
    white-space: nowrap;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .problem-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .problem-right {
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.5rem;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}
