/* ─────────────────────────────────────────────────────────────────────────────
   DSAProblems.site — Modern Clean Developer Design System
   Default Theme: White / Light Theme
   Optional Theme: True Pitch-Dark Mode (Zero Blue Tint)
   Accent Palette: Developer Orange (#f97316)
   ───────────────────────────────────────────────────────────────────────────── */

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

:root, [data-theme="light"] {
  /* Default Light / White Palette */
  --bg-base: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f8fafc;
  --bg-subtle: #f1f5f9;
  --bg-elevated: #ffffff;

  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-accent: rgba(249, 115, 22, 0.35);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  /* Developer Orange Accent */
  --accent-primary: #ea580c;
  --accent-hover: #c2410c;
  --accent-light: rgba(234, 88, 12, 0.08);

  --easy-color: #059669;
  --easy-bg: #dcfce7;
  --easy-border: #86efac;

  --medium-color: #d97706;
  --medium-bg: #fef3c7;
  --medium-border: #fde047;

  --hard-color: #dc2626;
  --hard-bg: #fee2e2;
  --hard-border: #fca5a5;

  --solved-row-bg: rgba(16, 185, 129, 0.12);
  --solved-row-border: rgba(16, 185, 129, 0.45);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --max-width: 1280px;
  --header-height: 60px;
}

/* ── Explicit True Pitch-Dark Mode (Zero Blue Tint) ────────────────────────── */
[data-theme="dark"] {
  --bg-base: #09090b;
  --bg-surface: #121215;
  --bg-surface-hover: #1a1a1e;
  --bg-subtle: #18181b;
  --bg-elevated: #18181c;
  
  --border-color: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.18);
  --border-accent: rgba(249, 115, 22, 0.4);

  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --accent-primary: #f97316;
  --accent-hover: #ea580c;
  --accent-light: rgba(249, 115, 22, 0.14);

  --easy-color: #10b981;
  --easy-bg: rgba(16, 185, 129, 0.14);
  --easy-border: rgba(16, 185, 129, 0.35);

  --medium-color: #f59e0b;
  --medium-bg: rgba(245, 158, 11, 0.14);
  --medium-border: rgba(245, 158, 11, 0.35);

  --hard-color: #ef4444;
  --hard-bg: rgba(239, 68, 68, 0.14);
  --hard-border: rgba(239, 68, 68, 0.35);

  --solved-row-bg: rgba(16, 185, 129, 0.16);
  --solved-row-border: rgba(16, 185, 129, 0.5);
}

html, body {
  width: 100%;
  max-width: 100vw;
  min-height: 100%;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Ambient Developer Grid Background ───────────────────────────────────────── */
.ambient-grid-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  background-image: 
    linear-gradient(to right, rgba(15, 23, 42, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.055) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center top;
  opacity: 1;
}

.ambient-grid-bg::after {
  content: "";
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(circle, rgba(234, 88, 12, 0.07) 0%, rgba(234, 88, 12, 0) 70%);
  pointer-events: none;
}

[data-theme="dark"] .ambient-grid-bg {
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.065) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.065) 1px, transparent 1px);
}

[data-theme="dark"] .ambient-grid-bg::after {
  background: radial-gradient(circle, rgba(249, 115, 22, 0.12) 0%, rgba(249, 115, 22, 0) 70%);
}

.app-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header Navbar ───────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .site-header {
  background: rgba(9, 9, 11, 0.88);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.brand-logo span {
  color: var(--accent-primary);
}

.brand-tag {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent-primary);
  border: 1px solid var(--border-accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 150ms ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.nav-btn.active {
  color: var(--accent-primary);
  background: var(--accent-light);
  border: 1px solid var(--border-accent);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.share-btn-header {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 150ms ease;
}

.share-btn-header:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.search-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 150ms ease;
}

.search-trigger-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-secondary);
}

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

/* Smooth global theme transition */
body, .site-header, .site-footer, .view-section, .info-card-container, .problem-card {
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  height: 38px;
  min-width: 38px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 17px;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.2s ease;
}

.theme-toggle-btn:hover {
  transform: scale(1.08);
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
}

.theme-toggle-btn:active {
  transform: scale(0.94);
}

.theme-toggle-icon {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle-btn.animating .theme-toggle-icon {
  transform: rotate(360deg) scale(1.25);
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ── Mobile Nav Drawer & Backdrop ────────────────────────────────────────────── */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 290px;
  max-width: 85vw;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  z-index: 1000;
  padding: 20px;
  flex-direction: column;
  gap: 16px;
  transform: translateX(100%);
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
}

.mobile-drawer.open {
  display: flex;
  transform: translateX(0);
}

.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 999;
}

.drawer-backdrop.open {
  display: block;
}

/* ── Main View Container ─────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.view-section {
  display: none;
  width: 100%;
}

.view-section.active {
  display: block;
  animation: fadeIn 150ms ease;
}

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

/* ── Hero Section (Compact & Sleek) ────────────────────────────────────────── */
.hero-section {
  margin-bottom: 20px;
  padding: 16px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.hero-header-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-title-area {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 280px;
}

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

.hero-title-row h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.hero-mini-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: 999px;
}

.hero-description-compact {
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.45;
  margin: 2px 0 4px 0;
  max-width: 680px;
}

.hero-compact-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.compact-pill {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 3px 9px;
  border-radius: var(--radius-md);
}

.hero-compact-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 260px;
}

.stat-chips-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-chip {
  flex: 1;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 5px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chip-lbl {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.chip-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.hero-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 999px;
  overflow: hidden;
}

.hero-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), #10b981);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* Responsive Media Breakpoints for Hero Section */
@media (max-width: 860px) {
  .hero-header-compact {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .hero-compact-stats {
    width: 100%;
    min-width: 100%;
  }
}

@media (max-width: 600px) {
  .hero-section {
    padding: 12px 14px;
    margin-bottom: 14px;
  }
  .hero-title-row h1 {
    font-size: 18px;
  }
  .hero-mini-tag {
    font-size: 11px;
  }
  .hero-description-compact {
    font-size: 12px;
  }
  .compact-chip {
    padding: 4px 6px;
  }
  .chip-val {
    font-size: 13px;
  }
}

/* ── Topic Tabs Bar ──────────────────────────────────────────────────────────── */
.topic-tabs-wrapper {
  margin-bottom: 16px;
  width: 100%;
  padding: 2px 0;
}

.topic-tabs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  width: 100%;
}

.topic-tab-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 150ms ease;
  user-select: none;
  white-space: nowrap;
}

.btn-reset-filters {
  background: var(--accent-primary, #f97316);
  color: #ffffff !important;
  border: 1px solid var(--accent-primary, #f97316);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 150ms ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 6px var(--accent-light);
}

.btn-reset-filters:hover {
  background: var(--accent-hover, #ea580c);
  border-color: var(--accent-hover, #ea580c);
  color: #ffffff !important;
}

.topic-tab-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.topic-tab-pill.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  font-weight: 600;
}

.topic-tab-pill .pill-count {
  font-size: 11px;
  opacity: 0.85;
  font-family: var(--font-mono);
  margin-left: 4px;
}

/* ── Filter Controls Bar ─────────────────────────────────────────────────────── */
.filter-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input-group {
  position: relative;
  flex: 1 1 280px;
  min-width: 220px;
}

.search-input-group svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

.search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  padding: 8px 12px 8px 36px;
  border-radius: var(--radius-md);
  outline: none;
  transition: all 150ms ease;
}

.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-light);
}

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

.filter-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  transition: all 150ms ease;
  max-width: 100%;
  box-sizing: border-box;
}

.filter-select:focus, .filter-select:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.cmd-palette-item {
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 150ms ease;
}

.cmd-palette-item:hover {
  border-color: var(--accent-primary);
  background: var(--bg-surface-hover);
}

.results-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ── Problem Sheet Table ─────────────────────────────────────────────────────── */
.table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

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

.problem-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.problem-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13.5px;
  vertical-align: middle;
}

.problem-table tr:last-child td {
  border-bottom: none;
}

.problem-table tbody tr {
  transition: background-color 150ms ease;
}

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

.problem-table tbody tr.solved-row {
  background: var(--solved-row-bg) !important;
  box-shadow: inset 4px 0 0 0 #10b981;
}

.problem-table tbody tr.solved-row .problem-title-link {
  color: #10b981;
  font-weight: 700;
}

[data-theme="light"] .problem-table tbody tr.solved-row .problem-title-link {
  color: #047857;
}

.col-num {
  width: 70px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 12.5px;
}

.col-title {
  min-width: 220px;
}

.problem-title-link {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color 150ms ease;
}

.problem-title-link:hover {
  color: var(--accent-primary);
}

.col-diff {
  width: 100px;
}

.diff-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
}

.diff-beginner {
  color: #0284c7;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.diff-easy {
  color: var(--easy-color);
  background: var(--easy-bg);
  border: 1px solid var(--easy-border);
}

.diff-medium {
  color: var(--medium-color);
  background: var(--medium-bg);
  border: 1px solid var(--medium-border);
}

.diff-hard {
  color: var(--hard-color);
  background: var(--hard-bg);
  border: 1px solid var(--hard-border);
}

.diff-expert {
  color: #9333ea;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.col-topic, .col-pattern {
  width: 150px;
}

.topic-badge, .pattern-badge {
  display: inline-block;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.col-practice {
  width: 100px;
  text-align: center;
}

.btn-solve {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-light);
  color: var(--accent-primary);
  border: 1px solid var(--border-accent);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 150ms ease;
}

.btn-solve:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.btn-solve.disabled {
  background: var(--bg-card);
  color: var(--text-muted);
  border-color: var(--border-color);
  cursor: not-allowed;
  opacity: 0.65;
}

.btn-solve.disabled:hover {
  background: var(--bg-card);
  color: var(--text-muted);
}

.col-status {
  width: 80px;
  text-align: center;
}

.status-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-hover);
  border-radius: 6px;
  background: var(--bg-surface);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  vertical-align: middle;
  position: relative;
}

.status-checkbox:hover {
  border-color: #10b981;
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.status-checkbox:checked {
  background: #10b981 !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.6) !important;
  transform: scale(1.08);
}

.status-checkbox:checked::after {
  content: '✓';
  color: #ffffff;
  font-weight: 900;
  font-size: 14px;
  line-height: 1;
}

.solved-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background: #10b981;
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
  vertical-align: middle;
}

.bookmark-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px;
  transition: color 150ms ease;
}

.bookmark-btn:hover, .bookmark-btn.active {
  color: #f59e0b;
}

/* ── Mobile Stacked Cards ────────────────────────────────────────────────────── */
.mobile-card-list {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.problem-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.problem-card.solved-row {
  background: var(--solved-row-bg) !important;
  border-color: var(--solved-row-border) !important;
  border-left: 4px solid #10b981 !important;
}

.problem-card.solved-row .card-title {
  color: #10b981;
  font-weight: 700;
}

.card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.card-num {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 12px;
}

.card-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  text-decoration: none;
}

.card-tags-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.card-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

/* ── Pagination Bar ──────────────────────────────────────────────────────────── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 8px;
}

#pagination-info {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.pagination-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 25px;
  padding: 2px 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 120ms ease;
  user-select: none;
  line-height: 1;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--accent-light);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-btn.active {
  background: var(--accent-primary) !important;
  color: #ffffff !important;
  border-color: var(--accent-primary) !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 4px var(--accent-light);
}

@media (max-width: 640px) {
  .pagination-bar {
    padding: 8px 10px;
    gap: 6px;
    justify-content: center;
  }
  .pagination-controls {
    gap: 2px;
    justify-content: center;
  }
  .page-btn {
    min-width: 22px;
    height: 24px;
    font-size: 11px;
    padding: 1px 4px;
  }
}

.page-ellipsis {
  color: var(--text-muted);
  font-size: 13px;
  padding: 0 2px;
  user-select: none;
}

/* ── DSA Guide Responsive Layout (Phone, Tablet, Laptop) ─────────────────────── */
.guide-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
  width: 100%;
}

.guide-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 20px);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.guide-sidebar h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.guide-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
}

.guide-nav-item {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 150ms ease;
}

.guide-nav-item:hover, .guide-nav-item.active {
  color: var(--accent-primary);
  background: var(--accent-light);
  font-weight: 600;
}

.guide-mobile-nav-wrap {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  width: 100%;
}

.guide-mobile-selector {
  width: 100%;
  font-weight: 600;
  padding: 10px 12px;
}

.guide-mobile-pills-wrap {
  width: 100%;
  margin-bottom: 0;
}

.guide-content-area {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.guide-article {
  width: 100%;
}

.guide-lang-tabs {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  margin-bottom: 8px;
  align-items: center;
}

.guide-lang-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 150ms ease;
  user-select: none;
}

.guide-lang-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: var(--accent-light);
}

.guide-lang-btn.active {
  background: var(--accent-primary) !important;
  color: #ffffff !important;
  border-color: var(--accent-primary) !important;
}

.guide-article h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.3;
  word-break: break-word;
}

.guide-article h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 16px 0 8px;
  word-break: break-word;
}

.guide-article p {
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: 12px;
  word-break: break-word;
}

.guide-article ul {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-left: 20px;
  margin-bottom: 12px;
}

.guide-article li {
  margin-bottom: 4px;
}

.code-block-wrap {
  background: #0d1117;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #e6edf3;
  overflow-x: auto;
  max-width: 100%;
  white-space: pre;
  box-sizing: border-box;
}

[data-theme="dark"] .code-block-wrap {
  background: #09090b;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f4f4f5;
}

.guide-nav-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Info Cards & General Layout ─────────────────────────────────────────────── */
.info-card-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

/* ── Support the Project Card Styles ────────────────────────────────────────── */
.support-card-container {
  position: relative;
  overflow: hidden;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.support-card-container:hover {
  border-color: var(--border-hover);
}

.support-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-accent);
}

.upi-details-container {
  width: 100%;
  max-width: 440px;
  margin-top: 8px;
  padding: 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transition: border-color 250ms ease, box-shadow 250ms ease;
}

.upi-id-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  width: 100%;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.upi-id-pill:hover {
  border-color: var(--accent-primary);
  background-color: var(--accent-light);
}

.upi-qr-card {
  background: #ffffff; /* pure white for optimal QR code mobile scanning */
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 220px;
}

.upi-qr-image {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border-radius: 4px;
}

.upi-direct-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-primary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  border: 1px solid var(--border-accent);
  transition: background 150ms ease, transform 150ms ease;
}

.upi-direct-link:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.support-subtle-note {
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 6px;
}

.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--accent-primary);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  opacity: 0;
  transform: translateY(10px);
  transition: all 200ms ease;
  pointer-events: none;
}

.toast-notification.show {
  opacity: 1;
  transform: translateY(0);
}

/* ── Progress Dashboard Layout ───────────────────────────────────────────────── */
.progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-box-title {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.stat-box-number {
  font-size: 28px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.stat-box-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Modal Component ─────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

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

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lang-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.lang-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.lang-tab.active {
  background: var(--accent-light);
  color: var(--accent-primary);
}

/* ── Buttons & Components ────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 150ms ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all 150ms ease;
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state h3 {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 6px;
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 24px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
  background: var(--bg-base);
  margin-top: auto;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 150ms ease;
}

.footer-links a:hover {
  color: var(--accent-primary);
}

/* ── Responsive Breakpoints (Phone, Tablet, Laptop) ──────────────────────────── */
@media (max-width: 1024px) {
  .guide-container {
    grid-template-columns: 220px 1fr;
    gap: 16px;
  }
}

@media (max-width: 900px) {
  .guide-container {
    grid-template-columns: 1fr;
  }
  .guide-sidebar {
    display: none;
  }
  .guide-mobile-nav-wrap {
    display: flex;
  }
}

@media (max-width: 768px) {
  .nav-links, .search-trigger-btn {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .problem-table {
    display: none;
  }

  .mobile-card-list {
    display: flex;
  }

  .hero-header {
    flex-direction: column;
  }

  .main-content {
    padding: 16px 12px 40px;
  }

  .info-card-container {
    padding: 20px 16px;
  }

  .guide-content-area {
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }

  .guide-article h2 {
    font-size: 19px;
  }

  .code-block-wrap {
    padding: 12px;
    font-size: 12px;
  }

  .search-input-group {
    width: 100%;
    flex: 1 1 100%;
  }

  .filter-selects-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .filter-select {
    width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }
}

@media (max-width: 480px) {
  .guide-content-area {
    padding: 14px 12px;
  }
  .guide-article h2 {
    font-size: 18px;
  }
  .filter-selects-group {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Google AdSense Slots & Containers ────────────────────────────────────────── */
.adsense-slot-wrapper {
  width: 100%;
  margin: 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 90px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-sizing: border-box;
  padding: 8px;
}

.adsense-slot-wrapper .adsbygoogle {
  display: block;
  width: 100%;
  text-align: center;
}

