/* ============================================================
   DevOps / Linux Interview Command Center Stylesheet
   Theme: Apple Notes × Linear × Raycast
   ============================================================ */

:root {
  /* Dark Theme (Default) */
  --bg-app: #0d1117;
  --bg-sidebar: #161b22;
  --bg-card: #1c2128;
  --bg-card-hover: #22272e;
  --bg-subtle: #2d333b;
  --bg-code: #0b0e14;
  --bg-code-header: #161b22;
  --bg-input: #1c2128;
  --bg-overlay: rgba(0, 0, 0, 0.75);

  --border-subtle: #30363d;
  --border-card: #373e47;
  --border-focus: #58a6ff;

  --text-main: #e6edf3;
  --text-muted: #8b949e;
  --text-dim: #6e7681;
  --text-highlight: #ffffff;

  --accent-primary: #58a6ff;
  --accent-primary-hover: #79b8ff;
  --accent-primary-bg: rgba(56, 139, 253, 0.15);

  --accent-success: #3fb950;
  --accent-success-bg: rgba(63, 185, 80, 0.15);

  --accent-warning: #d29922;
  --accent-warning-bg: rgba(210, 153, 34, 0.15);

  --accent-danger: #f85149;
  --accent-danger-bg: rgba(248, 81, 73, 0.15);

  --accent-purple: #bc8cff;
  --accent-purple-bg: rgba(188, 140, 255, 0.15);

  --accent-cyan: #39c5cf;
  --accent-cyan-bg: rgba(57, 197, 207, 0.15);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Text", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "Fira Code", Menlo, Monaco, Consolas, monospace;

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

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

[data-theme="light"] {
  --bg-app: #f6f8fa;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f4f6;
  --bg-subtle: #eaeef2;
  --bg-code: #f6f8fa;
  --bg-code-header: #eaeef2;
  --bg-input: #ffffff;
  --bg-overlay: rgba(0, 0, 0, 0.4);

  --border-subtle: #d0d7de;
  --border-card: #d8dee4;
  --border-focus: #0969da;

  --text-main: #1f2328;
  --text-muted: #656d76;
  --text-dim: #8c959f;
  --text-highlight: #000000;

  --accent-primary: #0969da;
  --accent-primary-hover: #0550ae;
  --accent-primary-bg: rgba(9, 105, 218, 0.1);

  --accent-success: #1a7f37;
  --accent-success-bg: rgba(26, 127, 55, 0.1);

  --accent-warning: #9a6700;
  --accent-warning-bg: rgba(154, 103, 0, 0.1);

  --accent-danger: #cf222e;
  --accent-danger-bg: rgba(207, 34, 46, 0.1);

  --accent-purple: #8250df;
  --accent-purple-bg: rgba(130, 80, 223, 0.1);

  --accent-cyan: #057a85;
  --accent-cyan-bg: rgba(5, 122, 133, 0.1);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.15);
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* App Container */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
  width: 290px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  flex-shrink: 0;
  overflow: hidden;
}

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

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-highlight);
  letter-spacing: -0.01em;
}

.brand-badge .icon {
  font-size: 1.35rem;
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-card);
}

/* Sidebar Progress */
.sidebar-progress {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.progress-header .pct {
  color: var(--accent-primary);
  font-weight: 700;
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

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

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 10px 10px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-list {
  list-style: none;
  margin-bottom: 16px;
}

.nav-item {
  margin-bottom: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-fast);
  cursor: pointer;
}

.nav-link:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-main);
}

.nav-link.active {
  background-color: var(--accent-primary-bg);
  color: var(--accent-primary);
  font-weight: 600;
}

.nav-link-content {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  border: 1.5px solid var(--text-dim);
}

.nav-status-indicator.reviewing {
  border-color: var(--accent-warning);
  background: conic-gradient(var(--accent-warning) 0.5turn, transparent 0.5turn);
}

.nav-status-indicator.reviewed {
  border-color: var(--accent-success);
  background-color: var(--accent-success);
}

.nav-link .star-icon {
  opacity: 0.4;
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.nav-link .star-icon.active {
  opacity: 1;
  color: #f1c40f;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.sidebar-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.sidebar-footer a:hover {
  color: var(--text-main);
}

/* Main Content Area */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--bg-app);
}

/* Top Navigation Bar */
.top-navbar {
  position: sticky;
  top: 0;
  background-color: rgba(22, 27, 34, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 90;
  gap: 16px;
}

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

.mode-switcher {
  display: flex;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
  overflow-x: auto;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-card-hover);
}

.mode-btn.active {
  background-color: var(--accent-primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

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

.search-trigger-btn {
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

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

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-main);
}

/* Mobile drawer button */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* Content Viewport */
.content-viewport {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 28px 80px;
}

/* Banner / Title Header */
.view-header {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}

.view-title-group h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-highlight);
  margin-bottom: 6px;
}

.view-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

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

/* Status Button Toggle */
.status-select-btn {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.status-select-btn:hover {
  border-color: var(--border-card);
  color: var(--text-main);
}

/* Badges & Tags */
.tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tag-badge.must-know {
  background-color: var(--accent-danger-bg);
  color: var(--accent-danger);
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.tag-badge.command {
  background-color: var(--accent-primary-bg);
  color: var(--accent-primary);
  border: 1px solid rgba(88, 166, 255, 0.3);
}

.tag-badge.concept {
  background-color: var(--accent-purple-bg);
  color: var(--accent-purple);
  border: 1px solid rgba(188, 140, 255, 0.3);
}

.tag-badge.scenario {
  background-color: var(--accent-warning-bg);
  color: var(--accent-warning);
  border: 1px solid rgba(210, 153, 34, 0.3);
}

.tag-badge.interview {
  background-color: var(--accent-success-bg);
  color: var(--accent-success);
  border: 1px solid rgba(63, 185, 80, 0.3);
}

.tag-badge.warning {
  background-color: var(--accent-danger-bg);
  color: var(--accent-danger);
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.tag-badge.distinction {
  background-color: var(--accent-cyan-bg);
  color: var(--accent-cyan);
  border: 1px solid rgba(57, 197, 207, 0.3);
}

/* Cards & Containers */
.section-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.section-card:hover {
  border-color: rgba(88, 166, 255, 0.3);
}

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

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-highlight);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-description {
  color: var(--text-muted);
  margin-bottom: 18px;
  font-size: 0.95rem;
}

/* Mental Model Box */
.mental-model-box {
  background-color: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 18px 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.55;
  color: #c9d1d9;
  white-space: pre;
  overflow-x: auto;
}

.mental-model-title {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

/* Code Blocks */
.code-block-wrapper {
  background-color: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin: 14px 0;
  overflow: hidden;
}

.code-header {
  background-color: var(--bg-code-header);
  padding: 6px 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.code-lang {
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.copy-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
}

.code-content {
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.5;
  overflow-x: auto;
  color: #e6edf3;
  white-space: pre;
}

[data-theme="light"] .code-content {
  color: #24292f;
}

.code-why {
  padding: 8px 18px 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-subtle);
  background-color: rgba(255, 255, 255, 0.01);
}

.code-why strong {
  color: var(--accent-success);
}

/* Data Tables */
.data-table-wrapper {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background-color: var(--bg-subtle);
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text-highlight);
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

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

.data-table tr:hover td {
  background-color: var(--bg-card-hover);
}

/* Notes & Warnings */
.notice-box {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin: 14px 0;
  font-size: 0.9rem;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.notice-box.warning {
  background-color: var(--accent-warning-bg);
  border: 1px solid rgba(210, 153, 34, 0.3);
  color: var(--text-main);
}

.notice-box.danger {
  background-color: var(--accent-danger-bg);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: var(--text-main);
}

.notice-box.info {
  background-color: var(--accent-primary-bg);
  border: 1px solid rgba(88, 166, 255, 0.3);
  color: var(--text-main);
}

/* Interview Q&A Cards */
.qa-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.qa-question-bar {
  padding: 18px 22px;
  background-color: var(--bg-card-hover);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.qa-question-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-highlight);
  display: flex;
  align-items: center;
  gap: 10px;
}

.qa-question-text::before {
  content: "Q";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background-color: var(--accent-primary-bg);
  color: var(--accent-primary);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.qa-body {
  padding: 22px;
}

.qa-answer-short {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--accent-success-bg);
  border-left: 4px solid var(--accent-success);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.qa-answer-short .label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-success);
  display: block;
  margin-bottom: 4px;
}

.qa-deeper {
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.qa-followup {
  margin-top: 16px;
  padding: 12px 16px;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  border-left: 3px solid var(--accent-purple);
}

.qa-followup strong {
  color: var(--accent-purple);
}

/* Distinction (Don't Confuse These) */
.distinction-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}

@media (max-width: 700px) {
  .distinction-grid {
    grid-template-columns: 1fr;
  }
}

.distinction-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 18px;
}

.distinction-card.item-a {
  border-top: 3px solid var(--accent-primary);
}

.distinction-card.item-b {
  border-top: 3px solid var(--accent-purple);
}

.distinction-item-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.distinction-trap {
  grid-column: 1 / -1;
  background-color: var(--accent-warning-bg);
  border: 1px solid rgba(210, 153, 34, 0.3);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
}

.distinction-trap strong {
  color: var(--accent-warning);
}

/* Troubleshooting Stepper / Tree */
.troubleshoot-stepper {
  position: relative;
  padding-left: 28px;
  margin: 20px 0;
}

.troubleshoot-stepper::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background-color: var(--border-subtle);
}

.troubleshoot-step {
  position: relative;
  margin-bottom: 22px;
}

.troubleshoot-step::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 2px solid var(--accent-primary);
}

.step-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-highlight);
  margin-bottom: 4px;
}

.step-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Flashcards View */
.flashcards-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 650px;
  margin: 0 auto;
}

.flashcard-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.flashcard-main {
  width: 100%;
  min-height: 280px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.flashcard-main:hover {
  border-color: var(--accent-primary);
}

.flashcard-topic-tag {
  position: absolute;
  top: 16px;
  left: 18px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
}

.flashcard-text {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-highlight);
  line-height: 1.5;
  margin-bottom: 24px;
}

.flashcard-answer-revealed {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-main);
  background-color: var(--bg-subtle);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent-success);
  text-align: left;
  width: 100%;
  line-height: 1.6;
}

.flashcard-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 12px;
}

.flashcard-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
  width: 100%;
}

.btn-flashcard {
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
  color: var(--text-main);
}

.btn-flashcard:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-card);
}

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

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

.btn-flashcard.known {
  background-color: var(--accent-success-bg);
  color: var(--accent-success);
  border-color: rgba(63, 185, 80, 0.3);
}

.btn-flashcard.review {
  background-color: var(--accent-warning-bg);
  color: var(--accent-warning);
  border-color: rgba(210, 153, 34, 0.3);
}

/* Cheatsheet Table & Filter */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-btn {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.filter-btn.active {
  background-color: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.cheatsheet-table {
  width: 100%;
  border-collapse: collapse;
}

.cheatsheet-table th {
  background-color: var(--bg-subtle);
  padding: 10px 14px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-subtle);
}

.cheatsheet-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
  font-size: 0.88rem;
}

.cheatsheet-table .cmd-cell code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.cheatsheet-table .copy-action {
  opacity: 0.4;
  cursor: pointer;
  margin-left: 6px;
  transition: opacity 0.15s;
}

.cheatsheet-table tr:hover .copy-action {
  opacity: 1;
}

/* Modal: Command Palette & Global Search */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  z-index: 1000;
}

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

.modal-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 620px;
  overflow: hidden;
  animation: modalFadeIn 0.15s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.modal-search-input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--text-highlight);
  outline: none;
  font-family: var(--font-sans);
}

.modal-search-input::placeholder {
  color: var(--text-dim);
}

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

.search-result-item {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-main);
  text-decoration: none;
}

.search-result-item:hover,
.search-result-item.selected {
  background-color: var(--bg-card-hover);
}

.search-result-title {
  font-weight: 500;
  font-size: 0.95rem;
}

.search-result-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.modal-footer {
  padding: 10px 18px;
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}

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

/* Responsive Styles */
@media (max-width: 900px) {
  .app-sidebar {
    position: fixed;
    left: -290px;
    transition: left 0.25s ease;
    box-shadow: var(--shadow-lg);
  }

  .app-sidebar.open {
    left: 0;
  }

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

  .content-viewport {
    padding: 20px 16px 60px;
  }
}
