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

:root {
  /* Brand Colors */
  --brand-primary: #00d2ff;
  --brand-secondary: #3a7bd5;
  --brand-purple: #8b5cf6;
  --brand-teal: #14b8a6;
  --brand-green: #10b981;
  --brand-warning: #f59e0b;
  --brand-danger: #ef4444;
  --brand-cyan: #06b6d4;

  /* Backgrounds (Dark Mode) */
  --bg-base: #0d1117;
  --bg-dark: #0d1117;
  /* alias for bg-base */
  --bg-surface: rgba(22, 27, 34, 0.95);
  --bg-surface-hover: rgba(30, 38, 54, 0.95);
  --bg-surface-active: rgba(40, 52, 72, 0.98);
  --bg-sidebar: #161b22;
  --bg-panel: #21262d;

  /* Text */
  --text-primary: #f8fafc;
  --text-main: #f8fafc;
  /* alias for text-primary */
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #020617;

  /* Borders */
  --border-color: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.08);
  /* alias for border-color */
  --border-focus: var(--brand-primary);

  /* Shadow / Blur */
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glow-primary: 0 0 15px rgba(0, 210, 255, 0.3);
  --blur-strength: blur(16px);

  /* Typography */
  --font-heading: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'Fira Code', monospace;

  /* Layout Spacing */
  --header-height: 70px;
  --sidebar-width: 280px;
  --right-panel-width: 350px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-base);
  background-image:
    radial-gradient(circle at 20% 40%, rgba(0, 210, 255, 0.04), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.04), transparent 40%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  height: 100vh;
  overflow: hidden;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #fff;
}

/* App Layout Grid */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Utility: Glassmorphism Panel */
.glass-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* --- Left Sidebar --- */
.left-sidebar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  overflow-y: auto;
  z-index: 10;
  width: var(--sidebar-width);
  flex-shrink: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 32px;
  padding: 0 8px;
}

.brand-logo svg {
  width: 28px;
  height: 28px;
  fill: url(#gradient);
}

.sidebar-nav-section {
  margin-bottom: 32px;
}

.sidebar-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding: 0 8px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  cursor: pointer;
}

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

.nav-item.active {
  background: rgba(0, 210, 255, 0.1);
  color: var(--brand-primary);
  border-left: 3px solid var(--brand-primary);
}

.nav-item .icon {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  opacity: 0.7;
}

.nav-item.active .icon {
  opacity: 1;
}

.nav-item .badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-panel);
  color: var(--text-muted);
}

.nav-item.active .badge {
  background: var(--brand-primary);
  color: var(--bg-base);
}

/* Setup Progress Bar in Sidebar */
.nav-progress {
  margin-top: 24px;
  padding: 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

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

.progress-track {
  height: 6px;
  background: var(--bg-panel);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-teal));
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.5s ease;
  box-shadow: var(--glow-primary);
}


/* --- Center Content Area --- */
.center-area {
  flex: 1;
  /* fill all remaining horizontal space */
  min-width: 0;
  /* prevent flex children from overflowing */
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  overflow: hidden;
  /* inner containers handle their own scroll */
}

/* Top Navigation Bar */
.top-nav {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(11, 15, 25, 0.95);
  z-index: 20;
  flex-shrink: 0;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  width: 300px;
  transition: all 0.2s ease;
}

.search-bar:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(0, 210, 255, 0.2);
}

.search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  width: 100%;
  margin-left: 8px;
  font-family: var(--font-body);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

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


/* Main Scrolling Content */
.content-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 40px;
  scroll-behavior: smooth;
  padding-bottom: 300px;
  /* Space for the terminal */
}

/* Dashboard Specifics */
.hero-section {
  margin-bottom: 48px;
}

.hero-title {
  font-size: 2.5rem;
  margin-bottom: 16px;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.module-card {
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--bg-panel);
  transition: all 0.3s ease;
}

.module-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
}

.module-card:hover::before {
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-purple));
}

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

.mc-subtitle {
  font-size: 0.8rem;
  color: var(--brand-primary);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.mc-title {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.mc-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 24px;
  flex: 1;
}

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

/* Module Lesson Content Styling */
.lesson-header {
  margin-bottom: 40px;
}

.lesson-meta {
  display: flex;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
  font-weight: 500;
}

.lesson-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.content-block {
  background: transparent;
  margin-bottom: 40px;
}

.content-block h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  color: #fff;
}

.content-block h3 {
  font-size: 1.2rem;
  margin-top: 24px;
  margin-bottom: 12px;
  color: #e2e8f0;
}

.content-block p {
  margin-bottom: 16px;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.content-block ul {
  margin-bottom: 16px;
  padding-left: 24px;
  color: var(--text-secondary);
}

.content-block li {
  margin-bottom: 8px;
}

/* Code Snippets */
.code-window {
  background: #0f172a;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin: 10px 0;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 4px;
  min-height: 36px;
}

.window-controls {
  display: flex;
  gap: 6px;
}

.wc-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.wc-red {
  background: #ef4444;
}

.wc-yellow {
  background: #f59e0b;
}

.wc-green {
  background: #10b981;
}

.code-lang {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.code-window pre {
  padding: 14px 16px;
  margin: 0;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 320px;
  /* cap tall YAML blocks — user can scroll */
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.6;
  white-space: pre;
  word-break: normal;
  box-sizing: border-box;
}

/* Bash command blocks are shorter — less scrolling needed */
.code-window.cmd pre {
  max-height: 200px;
}

/* Expected output blocks — dimmer, slightly smaller */
.output-pre {
  color: #64748b;
  font-size: 0.8rem;
  max-height: 160px !important;
  font-style: italic;
}

/* Scrollbar styling for code blocks */
.code-window pre::-webkit-scrollbar {
  height: 4px;
  width: 4px;
}

.code-window pre::-webkit-scrollbar-track {
  background: transparent;
}

.code-window pre::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.inline-code {
  background: rgba(255, 255, 255, 0.1);
  color: var(--brand-primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Checkbox Tasks (Labs) */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 20px 0;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, background 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  /* allow content to shrink */
}

.task-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.task-item.completed {
  border-color: var(--brand-green);
  background: rgba(16, 185, 129, 0.04);
}

.task-checkbox {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 6px;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  margin-top: 2px;
  /* align with first line of title */
}

.task-item.completed .task-checkbox {
  background: var(--brand-green);
  border-color: var(--brand-green);
}

.task-checkbox svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: white;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.task-item.completed .task-checkbox svg {
  opacity: 1;
  transform: scale(1);
}

.task-content {
  flex: 1;
  min-width: 0;
  /* prevent content from overflowing flex parent */
  overflow: hidden;
}

.task-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.task-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 10px;
}

.task-item.completed .task-title {
  color: var(--brand-green);
  text-decoration: line-through;
  opacity: 0.8;
}

/* Mobile responsiveness for lab task items */
@media (max-width: 640px) {
  .task-item {
    padding: 14px 12px;
    gap: 10px;
  }

  .task-title {
    font-size: 0.92rem;
  }

  .task-desc {
    font-size: 0.82rem;
  }

  .code-window pre {
    font-size: 0.75rem;
    max-height: 240px;
    padding: 10px 12px;
  }

  .code-header {
    padding: 5px 10px;
  }

  .output-pre {
    max-height: 120px !important;
  }
}

/* Built-in Terminal Area */
.terminal-dock {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 250px;
  background: #0f172a;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: height 0.3s ease;
}

.terminal-dock.expanded {
  height: 60vh;
}

.terminal-dock.minimized {
  height: 40px;
}

.terminal-header {
  height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  cursor: pointer;
  user-select: none;
}

.term-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #e2e8f0;
}

.term-prompt {
  color: var(--brand-green);
  margin-right: 8px;
}

.term-input-line {
  display: flex;
  align-items: center;
  margin-top: 8px;
}

.term-input {
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  outline: none;
  flex: 1;
}

.term-output {
  color: #94a3b8;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.term-output.error {
  color: var(--brand-danger);
}

.term-output.success {
  color: var(--brand-primary);
}


/* --- Right Panel (AI Tutor Chat) --- */
.right-panel {
  border-left: 1px solid var(--border-color);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 10;
  width: var(--right-panel-width);
  min-width: var(--right-panel-width);
  /* prevent shrinking */
  max-width: var(--right-panel-width);
  /* prevent growing */
  flex-shrink: 0;
  flex-grow: 0;
  height: 100vh;
  overflow: hidden;
}

.chat-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(11, 15, 25, 0.95);
  flex-shrink: 0;
}

.tutor-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tutor-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
}

.tutor-avatar svg {
  width: 20px;
  height: 20px;
  fill: white;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
}

/* -----------------------------------------
   Animations
----------------------------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatConfetti {
  0% {
    transform: translateY(-10vh) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.confetti {
  position: fixed;
  top: -10px;
  width: 10px;
  height: 10px;
  background-color: var(--brand-primary);
  opacity: 0;
  animation: floatConfetti 3s linear forwards;
  z-index: 10000;
  pointer-events: none;
}


.msg-ai {
  align-self: flex-start;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-top-left-radius: 4px;
}

.msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: white;
  border-top-right-radius: 4px;
}

.chat-input-area {
  padding: 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-color);
  background: var(--bg-sidebar);
  flex-shrink: 0;
  /* never compress the input area */
}

.chat-config {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-config input,
.chat-config select {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  outline: none;
  font-family: inherit;
}

.chat-config input:focus,
.chat-config select:focus {
  border-color: var(--brand-purple);
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 8px;
  transition: border-color 0.2s ease;
}

.input-wrapper:focus-within {
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.chat-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  resize: none;
  max-height: 120px;
  padding: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  overflow-y: auto;
}

.chat-send-btn {
  background: var(--brand-purple);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: #7c3aed;
  transform: scale(1.05);
}

.chat-send-btn:active {
  transform: scale(0.95);
}


/* --- Buttons & Inputs --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.btn:hover {
  background: var(--bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  border: none;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 210, 255, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0ce1ff, #478dec);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 210, 255, 0.4);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 6px;
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Specific Modals (Search, Shortcuts) overlay the whole grid */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  padding: 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.search-input-large {
  width: 100%;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1.2rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.search-input-large:focus {
  border-color: var(--brand-primary);
}

/* --- Mobile Responsiveness --- */
.mobile-toggle-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-md);
  transition: background 0.2s ease;
}

.mobile-toggle-btn:hover {
  background: var(--bg-surface-hover);
}

.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay.active {
  display: block;
  opacity: 1;
}

@media (max-width: 992px) {
  :root {
    --blur-strength: none;
  }

  * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .app-layout {
    display: block;
  }

  .left-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100dvh;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 50;
    background: rgba(17, 24, 39, 0.95);
  }

  .left-sidebar.sidebar-open {
    transform: translateX(0);
  }

  .right-panel {
    position: fixed;
    right: 0;
    top: 0;
    height: 100dvh;
    width: 350px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 50;
    background: rgba(17, 24, 39, 0.95);
  }

  .right-panel.ai-open {
    transform: translateX(0);
  }

  .mobile-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  button.mobile-toggle-btn {
    display: flex !important;
    /* Force override inline display:none on mobile */
  }

  .top-nav {
    padding: 0 16px;
  }

  .search-bar {
    width: 200px;
  }
}

@media (max-width: 600px) {
  .search-bar {
    width: 140px;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .content-scrollable {
    padding: 20px;
    padding-bottom: 250px;
  }

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

  .right-panel {
    width: 100%;
  }
}

/* --- Tab System --- */
.tab-container {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 28px;
  padding-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-container::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  padding: 10px 18px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.25s ease;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  margin-bottom: -2px;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
  border-color: var(--border-color);
  border-bottom-color: transparent;
}

.tab-btn.active {
  background: rgba(0, 210, 255, 0.08);
  color: var(--brand-primary);
  border: 1px solid rgba(0, 210, 255, 0.25);
  border-bottom: 3px solid var(--brand-primary);
  font-weight: 600;
}

.panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.panel.active {
  display: block;
}

/* Cheat Sheet & Scenarios Specific Styles */
.cheatsheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

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

.cheat-card h4 {
  color: var(--brand-warning);
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-transform: uppercase;
}

.scenario-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
  border-left: 4px solid var(--brand-danger);
}

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

.scenario-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.scenario-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--brand-danger);
  background: rgba(239, 68, 68, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
}

.scenario-section {
  margin-bottom: 16px;
}

.scenario-section-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}