/* =====================================================================
   CODE-KARO.DEV — NEXT-GENERATION STRUCTURED PROBLEM LIBRARY CSS
   Theme: Deep Midnight Obsidian (#08090f) + Electric Violet, Neon Cyan & Indigo
   ===================================================================== */

:root {
  --bg-space: #08090f;
  --bg-card: #0f121d;
  --bg-card-hover: #151928;
  --bg-surface: #181d2e;
  --bg-surface-raised: #1e2438;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(0, 245, 196, 0.25);
  --border-violet: rgba(139, 92, 246, 0.3);

  --accent-cyan: #00f5c4;
  --accent-violet: #8b5cf6;
  --accent-indigo: #6366f1;
  --accent-gold: #ffd166;
  --accent-coral: #ff2e88;

  --diff-easy: #00f5c4;
  --diff-easy-bg: rgba(0, 245, 196, 0.1);
  --diff-easy-border: rgba(0, 245, 196, 0.25);

  --diff-med: #ffd166;
  --diff-med-bg: rgba(255, 209, 102, 0.1);
  --diff-med-border: rgba(255, 209, 102, 0.25);

  --diff-hard: #ff2e88;
  --diff-hard-bg: rgba(255, 46, 136, 0.1);
  --diff-hard-border: rgba(255, 46, 136, 0.25);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-dim: #475569;

  --font-sans: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  --shadow-glow-cyan: 0 0 25px -5px rgba(0, 245, 196, 0.25);
  --shadow-glow-violet: 0 0 25px -5px rgba(139, 92, 246, 0.25);
}

/* Light Mode Overrides */
[data-theme="light"] {
  --bg-space: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-surface: #e2e8f0;
  --bg-surface-raised: #cbd5e1;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-accent: rgba(14, 165, 233, 0.3);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --diff-easy: #059669;
  --diff-easy-bg: rgba(5, 150, 105, 0.1);
  --diff-easy-border: rgba(5, 150, 105, 0.3);

  --diff-med: #d97706;
  --diff-med-bg: rgba(217, 119, 6, 0.1);
  --diff-med-border: rgba(217, 119, 6, 0.3);

  --diff-hard: #e11d48;
  --diff-hard-bg: rgba(225, 29, 72, 0.1);
  --diff-hard-border: rgba(225, 29, 72, 0.3);
}

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

body.lib-body {
  background-color: var(--bg-space);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* =====================================================================
   1. STICKY GLASSMORPHIC TOPBAR
   ===================================================================== */
.lib-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 64px;
  padding: 0 24px;
  background: rgba(8, 9, 15, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

[data-theme="light"] .lib-navbar {
  background: rgba(255, 255, 255, 0.88);
}

.lib-nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.lib-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 16.5px;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.lib-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-indigo));
  color: #fff;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

.lib-brand-accent {
  color: var(--accent-cyan);
}

.lib-tag-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  background: rgba(0, 245, 196, 0.08);
  border: 1px solid var(--border-accent);
  color: var(--accent-cyan);
  border-radius: var(--radius-full);
}

.lib-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  padding: 3px 5px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  flex-shrink: 1;
}

.lib-nav-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.lib-nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.lib-nav-link.active {
  color: #fff;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  font-weight: 600;
}

.lib-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lib-quick-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lib-quick-search-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.kbd-shortcut {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-dim);
}

.lib-cta-practice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: linear-gradient(135deg, var(--accent-cyan), #00d2aa);
  color: #08090f;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-md);
  box-shadow: 0 0 15px rgba(0, 245, 196, 0.3);
  transition: all 0.18s ease;
}

.lib-cta-practice:hover {
  box-shadow: 0 0 22px rgba(0, 245, 196, 0.6);
  transform: translateY(-1px);
}

.lib-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lib-icon-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  background: var(--accent-coral);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-coral);
}

.lib-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.lib-user-btn:hover {
  border-color: var(--accent-violet);
}

.user-avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-indigo));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
}

/* =====================================================================
   2. HERO DASHBOARD SECTION
   ===================================================================== */
.lib-main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}

.lib-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: 40px;
  padding: 48px;
  background: radial-gradient(ellipse at 85% 20%, rgba(139, 92, 246, 0.12), transparent 60%),
              radial-gradient(ellipse at 15% 90%, rgba(0, 245, 196, 0.08), transparent 60%),
              var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: var(--shadow-subtle);
}

.hero-glow-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
}
.hero-glow-orb--left {
  top: -40px;
  left: -40px;
  width: 240px;
  height: 240px;
  background: rgba(0, 245, 196, 0.12);
}
.hero-glow-orb--right {
  bottom: -40px;
  right: -40px;
  width: 280px;
  height: 280px;
  background: rgba(139, 92, 246, 0.14);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(0, 245, 196, 0.08);
  border: 1px solid var(--border-accent);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 18px;
}

.badge-pulse {
  width: 7px;
  height: 7px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: pulseGlow 2s infinite;
}

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

.hero-headline {
  font-size: 44px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -1.2px;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.gradient-text {
  background: linear-gradient(135deg, #00f5c4 0%, #8b5cf6 60%, #ffd166 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtext {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 580px;
  margin-bottom: 24px;
}

/* Hero Search Input with Animated Cycling Suggestions */
.hero-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 560px;
  background: var(--bg-space);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 6px 14px;
  margin-bottom: 24px;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-search-wrapper:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px -5px rgba(0, 245, 196, 0.35);
}

.hero-search-icon {
  font-size: 18px;
  color: var(--text-muted);
  margin-right: 10px;
}

.hero-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
}

.hero-search-input::placeholder {
  color: var(--text-dim);
  transition: opacity 0.2s ease;
}

.hero-search-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
}

.hero-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.lib-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s ease;
  border: none;
}

.lib-btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #00d2aa);
  color: #08090f;
  box-shadow: 0 4px 14px rgba(0, 245, 196, 0.25);
}
.lib-btn-primary:hover {
  box-shadow: 0 6px 20px rgba(0, 245, 196, 0.45);
  transform: translateY(-1px);
}

.lib-btn-glass {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.lib-btn-glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-accent);
}

.lib-btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.lib-btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

/* Hero Right: Radial Progress Widget */
.hero-right-widget {
  display: flex;
  justify-content: center;
}

.progress-radial-card {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 28px 32px;
  background: rgba(24, 29, 46, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-subtle);
}

.progress-radial-wrap {
  position: relative;
  width: 110px;
  height: 110px;
}

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

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

.radial-bar {
  fill: none;
  stroke: url(#radialGrad);
  stroke: var(--accent-cyan);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.radial-center-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.radial-pct {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  font-family: var(--font-mono);
}

.radial-sub {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.progress-card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.progress-card-count {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

.progress-diff-dots {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 6px;
}

.diff-dot {
  font-size: 11px;
  font-family: var(--font-mono);
}
.diff-dot.easy { color: var(--diff-easy); }
.diff-dot.med { color: var(--diff-med); }
.diff-dot.hard { color: var(--diff-hard); }

/* =====================================================================
   3. STATISTICS CARDS GRID
   ===================================================================== */
.lib-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: var(--shadow-subtle);
}

.stat-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  font-size: 18px;
  flex-shrink: 0;
}

.stat-icon--solved { background: rgba(0, 245, 196, 0.1); color: var(--accent-cyan); }
.stat-icon--diff { background: rgba(139, 92, 246, 0.1); color: var(--accent-violet); }
.stat-icon--streak { background: rgba(255, 209, 102, 0.1); color: var(--accent-gold); }
.stat-icon--accuracy { background: rgba(99, 102, 241, 0.1); color: var(--accent-indigo); }
.stat-icon--attempted { background: rgba(255, 46, 136, 0.1); color: var(--accent-coral); }

.stat-card-body {
  flex: 1;
  min-width: 0;
}

.stat-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.stat-card-val {
  font-size: 19px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-card-sub {
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 3px;
}

.stat-micro-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  margin-top: 6px;
  overflow: hidden;
}

.stat-micro-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}
.stat-fill--cyan { background: var(--accent-cyan); }

.stat-diff-bars-stacked {
  display: flex;
  width: 100%;
  height: 5px;
  border-radius: var(--radius-full);
  overflow: hidden;
  gap: 2px;
  margin-top: 6px;
}
.stacked-bar-segment.seg-easy { background: var(--diff-easy); }
.stacked-bar-segment.seg-med { background: var(--diff-med); }
.stacked-bar-segment.seg-hard { background: var(--diff-hard); }

.stat-diff-legend {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-family: var(--font-mono);
  margin-top: 5px;
}
.legend-item.easy { color: var(--diff-easy); }
.legend-item.med { color: var(--diff-med); }
.legend-item.hard { color: var(--diff-hard); }

/* =====================================================================
   4. CATEGORY NAVIGATION GRID (16 Categories)
   ===================================================================== */
.lib-section {
  margin-bottom: 48px;
}

.section-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent-violet);
  margin-bottom: 4px;
}

.section-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

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

.results-badge {
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 4px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--accent-cyan);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.category-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.category-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-violet);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-violet);
}

.category-card.active-filtered {
  border-color: var(--accent-cyan);
  background: rgba(0, 245, 196, 0.05);
  box-shadow: var(--shadow-glow-cyan);
}

.category-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cat-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-violet);
  font-size: 16px;
}

.category-card.active-filtered .cat-icon-badge {
  background: rgba(0, 245, 196, 0.12);
  color: var(--accent-cyan);
}

.cat-count-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.category-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.cat-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.cat-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.cat-progress-pct {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

/* =====================================================================
   5. CURATED LEARNING PATHS (8 Curricula)
   ===================================================================== */
.paths-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.path-card-v2 {
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  transition: all 0.22s ease;
  position: relative;
}

.path-card-v2:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.path-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  align-self: flex-start;
}

.tier--beginner { background: rgba(0, 245, 196, 0.1); color: var(--accent-cyan); border: 1px solid var(--border-accent); }
.tier--intermediate { background: rgba(255, 209, 102, 0.1); color: var(--accent-gold); border: 1px solid rgba(255, 209, 102, 0.3); }
.tier--advanced { background: rgba(139, 92, 246, 0.12); color: var(--accent-violet); border: 1px solid var(--border-violet); }

.path-icon-visual {
  font-size: 26px;
  margin-bottom: 8px;
}

.path-card-title-v2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.path-card-desc-v2 {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.path-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 10px;
}

.path-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 16px;
}

.path-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.path-continue-btn-v2 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.path-continue-btn-v2:hover {
  background: var(--accent-cyan);
  color: #08090f;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(0, 245, 196, 0.4);
}

/* =====================================================================
   6. FILTER TOOLBAR & PROBLEM TABLE
   ===================================================================== */
.filter-toolbar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filter-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.filter-search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
  background: var(--bg-space);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
}

.filter-search-box:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 245, 196, 0.2);
}

.filter-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
}

.filter-selects-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.lib-select {
  background: var(--bg-space);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lib-select:hover, .lib-select:focus {
  border-color: var(--accent-cyan);
  background: var(--bg-surface);
}

/* Topic Multi-select Chips Bar */
.topic-chips-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.topic-chips-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.topic-chips-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 84px;
  overflow-y: auto;
  padding: 2px 0;
}

.lib-topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: var(--bg-space);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.lib-topic-chip:hover {
  border-color: var(--accent-violet);
  color: var(--text-primary);
}

.lib-topic-chip.selected {
  background: rgba(0, 245, 196, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
}

.lib-topic-count {
  font-family: var(--font-mono);
  font-size: 9.5px;
  opacity: 0.75;
}

/* Active Filters Row */
.active-filters-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 46, 136, 0.06);
  border: 1px solid rgba(255, 46, 136, 0.2);
  border-radius: var(--radius-md);
}

.active-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.active-chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-primary);
}

.active-chip-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
}

.active-chip-remove:hover { color: var(--accent-coral); }

.clear-all-filters-btn {
  background: transparent;
  border: none;
  color: var(--accent-coral);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.clear-all-filters-btn:hover { text-decoration: underline; }

/* Problem Table Styling */
.lib-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
}

.lib-problem-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.lib-problem-table thead tr {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
}

.lib-problem-table th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.th-status { width: 50px; text-align: center; }
.th-id { width: 70px; }
.th-title { min-width: 220px; }
.th-topics { width: 240px; }
.th-diff { width: 110px; }
.th-acceptance { width: 110px; }
.th-lang { width: 100px; }
.th-action { width: 60px; text-align: center; }

.lib-problem-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
  cursor: pointer;
}

.lib-problem-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.lib-problem-table td {
  padding: 12px 16px;
  font-size: 13px;
  vertical-align: middle;
}

.td-status {
  text-align: center;
}

.table-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 12px;
}
.table-status-icon.solved { color: var(--accent-cyan); font-weight: bold; }
.table-status-icon.attempted { color: var(--accent-gold); font-size: 14px; }
.table-status-icon.unsolved { color: var(--text-dim); }

.td-id {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.problem-table-title {
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.problem-table-title:hover {
  color: var(--accent-cyan);
}

.problem-slug-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
}

.td-topics-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-topic-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  white-space: nowrap;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.diff-badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.diff-badge-pill.easy { background: var(--diff-easy-bg); color: var(--diff-easy); border: 1px solid var(--diff-easy-border); }
.diff-badge-pill.medium { background: var(--diff-med-bg); color: var(--diff-med); border: 1px solid var(--diff-med-border); }
.diff-badge-pill.hard { background: var(--diff-hard-bg); color: var(--diff-hard); border: 1px solid var(--diff-hard-border); }

.td-acceptance {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.td-lang-tag {
  display: inline-flex;
  padding: 2px 6px;
  background: var(--bg-surface);
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.table-star-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.table-star-btn:hover {
  color: var(--accent-gold);
  transform: scale(1.2);
}

.table-star-btn.bookmarked {
  color: var(--accent-gold);
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.6);
}

.highlight-match {
  background: rgba(255, 209, 102, 0.25);
  color: var(--accent-gold);
  border-radius: 2px;
  padding: 0 1px;
}

/* Empty State */
.empty-results-box {
  padding: 48px 24px;
  text-align: center;
}

.empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-text {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto 16px;
}

/* Responsive Mobile Cards */
.lib-mobile-cards-list {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}

.mobile-prob-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer;
}

.mobile-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* =====================================================================
   7. COMMAND PALETTE MODAL (Ctrl+K)
   ===================================================================== */
.command-palette-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  background: rgba(4, 5, 10, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
}

.command-palette-modal:not([open]) {
  display: none;
}

.palette-container {
  width: 90%;
  max-width: 620px;
  background: #0f121d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.8), var(--shadow-glow-cyan);
  overflow: hidden;
  animation: paletteScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes paletteScaleIn {
  from { opacity: 0; transform: scale(0.96) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.palette-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 10px;
}

.palette-search-icon {
  font-size: 18px;
  color: var(--accent-cyan);
}

.palette-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  color: #fff;
  font-family: inherit;
}

.palette-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
}

.palette-results-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}

.palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.12s ease;
}

.palette-item:hover, .palette-item.active {
  background: var(--bg-card-hover);
  color: #fff;
}

.palette-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.palette-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.palette-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-muted);
}

.palette-shortcuts {
  display: flex;
  gap: 12px;
}

.palette-brand {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* =====================================================================
   8. FOOTER
   ===================================================================== */
.lib-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(8, 9, 15, 0.9);
  padding: 48px 28px 24px;
}

.lib-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 40px;
  margin-bottom: 36px;
}

.footer-tagline {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 400px;
  margin: 12px 0 16px;
}

.footer-credits {
  font-size: 12px;
  color: var(--text-dim);
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.footer-col a {
  font-size: 12.5px;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: var(--accent-cyan);
}

.footer-bottom-row {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11.5px;
  color: var(--text-dim);
}

.footer-compiler-badge {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* =====================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ===================================================================== */
@media (max-width: 1280px) {
  .lib-navbar {
    padding: 0 18px;
    gap: 14px;
  }
  .lib-nav-link {
    padding: 5px 8px;
    font-size: 11.5px;
  }
  .lib-quick-search-btn .search-label {
    display: none;
  }
}

@media (max-width: 1040px) {
  .lib-nav-links {
    display: none;
  }
  .lib-tag-pill {
    display: none;
  }
}

@media (max-width: 1100px) {
  .lib-hero {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 32px;
  }
  .lib-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .paths-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 850px) {
  .lib-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .lib-problem-table {
    display: none;
  }
  .lib-mobile-cards-list {
    display: flex;
  }
  .lib-footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .lib-navbar {
    padding: 0 12px;
    gap: 8px;
  }
  .lib-brand {
    font-size: 15px;
  }
  .lib-brand-mark {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
  .lib-cta-practice {
    padding: 6px 10px;
    font-size: 11px;
  }
  .user-name {
    display: none;
  }
  .lib-user-btn {
    padding: 3px;
  }
  .lib-stats-grid {
    grid-template-columns: 1fr;
  }
  .categories-grid {
    grid-template-columns: 1fr;
  }
  .paths-cards-grid {
    grid-template-columns: 1fr;
  }
  .hero-headline {
    font-size: 32px;
  }
}
