/* Flagger Academic Dashboard Design System - WPI Course Engine */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@600;700&display=swap');

:root {
  /* Rich Bone/Champagne Theme */
  --bg-main: #f5f0e6;
  --bg-card: #fdfbf7;
  --bg-sidebar: #ffffff;

  --border-color: #e2ddd3;
  --border-hover: #cbd5e1;

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

  /* WPI Crimson & High-Contrast Graph Accents */
  --wpi-crimson: #AC2B37;
  --wpi-crimson-hover: #8B222C;
  --wpi-crimson-light: rgba(172, 43, 55, 0.08);

  /* Prerequisites Recommended - Deep Royal Indigo */
  --badge-indigo-bg: #e0e7ff;
  --badge-indigo-text: #4338ca;
  --badge-indigo-border: #c7d2fe;

  /* Unlocks Downstream Courses - Vibrant Ocean Sky Blue */
  --badge-sky-bg: #e0f2fe;
  --badge-sky-text: #0284c7;
  --badge-sky-border: #bae6fd;

  --badge-amber-bg: #fef3c7;
  --badge-amber-text: #92400e;
  --badge-amber-border: #fde68a;

  --sidebar-width: 480px;
  --header-height: 60px;
  --footer-height: 40px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* Header Navbar */
#header {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  flex-shrink: 0;
}

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

.brand-icon {
  width: 34px;
  height: 34px;
  background: var(--wpi-crimson);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(172, 43, 55, 0.2);
}

.brand-title h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.brand-title p {
  font-size: 0.72rem;
  color: var(--wpi-crimson);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Modern Select Dropdown Controls */
.academic-year-select,
.dept-select {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 32px 0 12px;
  background-color: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2364748b' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.academic-year-select {
  background-color: var(--wpi-crimson-light);
  color: var(--wpi-crimson);
  border-color: rgba(172, 43, 55, 0.3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23ac2b37' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  margin-left: 8px;
  padding: 0 24px 0 12px;
}

.academic-year-select option,
.dept-select option {
  padding: 6px 10px;
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: #ffffff;
}

.dept-select {
  width: 100%;
  border-radius: 8px;
  background-color: #ffffff;
}

.academic-year-select:hover {
  background-color: rgba(172, 43, 55, 0.14);
  border-color: var(--wpi-crimson);
  box-shadow: 0 3px 10px rgba(172, 43, 55, 0.15);
  transform: translateY(-1px);
}

.dept-select:hover {
  background-color: #ffffff;
  border-color: var(--wpi-crimson);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.academic-year-select:focus,
.dept-select:focus {
  border-color: var(--wpi-crimson);
  box-shadow: 0 0 0 3px rgba(172, 43, 55, 0.18);
}

.academic-year-select option,
.dept-select option {
  background: #ffffff;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 8px 12px;
}

/* Controls Toolbar */
.toolbar,
.controls-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.toolbar-right-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.search-box {
  position: relative;
  width: 260px;
}

.search-box input {
  width: 100%;
  height: 34px;
  padding: 0 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.search-box input:hover {
  border-color: var(--border-hover);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.search-box input:focus {
  outline: none;
  border-color: var(--wpi-crimson);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(172, 43, 55, 0.18);
}

/* Fast Search Autocomplete Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}

.search-item {
  padding: 8px 14px;
  font-size: 0.825rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: background 0.1s ease;
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover,
.search-item.active {
  background: var(--wpi-crimson-light);
  color: var(--wpi-crimson);
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 9999px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-primary);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.btn:hover {
  background: #ffffff;
  border-color: var(--wpi-crimson);
  color: var(--wpi-crimson);
  box-shadow: 0 3px 10px rgba(172, 43, 55, 0.12);
  transform: translateY(-1px);
}

.btn:focus {
  outline: none;
  border-color: var(--wpi-crimson);
  box-shadow: 0 0 0 3px rgba(172, 43, 55, 0.18);
}

.btn.active {
  background: var(--wpi-crimson);
  color: #ffffff;
  border-color: var(--wpi-crimson);
  box-shadow: 0 3px 10px rgba(172, 43, 55, 0.25);
}

.btn.active:hover {
  background: #8e232e;
  border-color: #8e232e;
  transform: translateY(-1px);
}

#physics-toggle-btn {
  min-width: 124px;
  padding: 7px 10px;
  text-align: center;
  white-space: nowrap;
}

/* Compact Extra-Small Button for Tree Unwinder */
.btn-xs {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--wpi-crimson);
  background: #ffffff;
  color: var(--wpi-crimson);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-xs:hover,
.btn-xs.active {
  background: var(--wpi-crimson);
  color: #ffffff;
}



/* Main Workspace */
#main-container {
  display: flex;
  flex: 1;
  height: calc(100vh - var(--header-height) - var(--footer-height));
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* Network Canvas */
#mynetwork {
  flex: 1;
  height: 100%;
  background: var(--bg-main);
}

/* Floating Stats Bar */
.stats-bar {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
}

.stat-pill {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.stat-pill .num {
  font-weight: 700;
  color: var(--wpi-crimson);
}



/* Sidebar Drawer */
#sidebar {
  width: var(--sidebar-width);
  height: 100%;
  min-height: 0;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-section {
  padding: 18px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.sidebar-section.details-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-bottom: none;
  padding-bottom: 0;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-title-row .section-title {
  margin-bottom: 0;
}

.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.dept-courses-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}

.dept-course-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s ease;
}

.dept-course-item:hover {
  border-color: var(--wpi-crimson);
  background: #fffdfd;
}

.dept-course-item.active {
  background: var(--wpi-crimson-light);
  border-color: var(--wpi-crimson);
}

.dept-course-code {
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: var(--wpi-crimson);
}

.dept-course-title {
  color: var(--text-secondary);
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

#details-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0 18px 0;
}

.placeholder-msg {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 40px;
  line-height: 1.5;
}

.course-card-header {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.course-header-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  margin-bottom: 8px !important;
}

.btn-history-diff {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 5px 12px !important;
  border-radius: 20px !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  background: var(--wpi-crimson) !important;
  border: 1.5px solid var(--wpi-crimson) !important;
  box-shadow: 0 2px 6px rgba(172, 43, 55, 0.25) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  z-index: 10 !important;
}

.btn-history-diff:hover,
.btn-history-diff.active {
  background: #871e27 !important;
  color: #ffffff !important;
  border-color: #871e27 !important;
  box-shadow: 0 4px 12px rgba(172, 43, 55, 0.4) !important;
  transform: translateY(-1px) !important;
}

.course-history-diff-container {
  margin-top: 10px;
  margin-bottom: 10px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.course-history-diff-container.expanded {
  opacity: 1;
  max-height: 600px;
  overflow-y: auto;
}

.history-diff-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.history-diff-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.history-diff-badge {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(172, 43, 55, 0.1);
  color: var(--wpi-crimson);
  padding: 2px 8px;
  border-radius: 12px;
}

.history-diff-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-diff-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 4px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-diff-item:hover {
  border-color: var(--wpi-crimson);
  box-shadow: 0 4px 12px rgba(172, 43, 55, 0.14);
  transform: translateY(-1px);
}

.history-diff-item.current-active-year {
  border-left-color: var(--wpi-crimson) !important;
  border-color: rgba(172, 43, 55, 0.45) !important;
  background: #fff8f8 !important;
  box-shadow: 0 2px 8px rgba(172, 43, 55, 0.12) !important;
}

.history-diff-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.active-year-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--wpi-crimson);
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.click-switch-hint {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--wpi-crimson);
  opacity: 0.75;
  transition: opacity 0.15s ease;
}

.history-diff-item:hover .click-switch-hint {
  opacity: 1;
  text-decoration: underline;
}

.history-diff-item.history-diff-initial {
  border-left-color: var(--wpi-crimson);
  background: #fffdfd;
}

.history-diff-item.history-diff-modified {
  border-left-color: #d97706;
  background: #fffbeb;
}

.history-diff-item.history-diff-removed {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.history-year-tag {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-primary);
}

.history-diff-text {
  color: var(--text-secondary);
  line-height: 1.35;
}

.history-diff-loading,
.history-diff-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 10px;
  text-align: center;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed var(--border-color);
}

.course-code-tag {
  display: inline-block;
  background: var(--wpi-crimson);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
}



.course-title-text {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

.meta-row {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.825rem;
  color: var(--text-secondary);
}

.detail-block {
  margin-top: 16px;
}

.detail-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.detail-block-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

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

.badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.badge-prereq {
  background: var(--badge-indigo-bg);
  color: var(--badge-indigo-text);
  border-color: var(--badge-indigo-border);
}

.badge-unlock {
  background: var(--badge-sky-bg);
  color: var(--badge-sky-text);
  border-color: var(--badge-sky-border);
}

.badge-alias {
  background: var(--badge-amber-bg);
  color: var(--badge-amber-text);
  border-color: var(--badge-amber-border);
}

.badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* Depth Tier Headers for Recursive Tree Unwinding */
.depth-tier-block {
  margin-top: 8px;
  padding: 6px 8px;
  background: var(--bg-main);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.depth-tier-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--wpi-crimson);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

/* Structured OR / AND Prerequisite Group Containers */
.prereq-group-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 4px;
}

.prereq-group-box.or-group {
  border-left: 3px solid var(--badge-indigo-text);
  background: #f8fafc;
}

.prereq-group-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--badge-indigo-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.prereq-group-title.req-title {
  color: var(--text-secondary);
}

.or-divider-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--badge-indigo-text);
  background: #ffffff;
  border: 1px solid var(--badge-indigo-border);
  border-radius: 10px;
  padding: 2px 6px;
  align-self: center;
}

.or-connector {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--wpi-crimson);
  letter-spacing: 0.08em;
  margin: 4px 0;
  position: relative;
}

.and-connector {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--badge-indigo-text);
  letter-spacing: 0.08em;
  margin: 4px 0;
  position: relative;
}

/* Dynamic Hover Popover Tooltip for Sidebar Badges */
.badge-tooltip {
  position: fixed;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 3000;
  width: 290px;
  pointer-events: none;
  display: none;
  font-size: 0.8rem;
  line-height: 1.4;
}

.badge-tooltip-code {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--wpi-crimson);
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.badge-tooltip-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.85rem;
  margin-bottom: 6px;
  line-height: 1.25;
}

.badge-tooltip-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.badge-tooltip-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-main);
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  margin-top: 6px;
  line-height: 1.35;
}

.badge-tooltip-prereqs {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 500;
}

.description-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 3.5px solid var(--wpi-crimson);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04), 0 2px 6px rgba(172, 43, 55, 0.02);
  transition: all 0.2s ease;
}

.description-card:hover {
  border-color: #cbd5e1;
  border-left-color: var(--wpi-crimson);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
}

.description-text {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.84rem;
  line-height: 1.62;
  color: #334155;
  letter-spacing: -0.005em;
  word-break: break-word;
}

/* Footer Bar */
#footer {
  height: var(--footer-height);
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  flex-shrink: 0;
  line-height: 1.3;
  z-index: 100;
}

#footer a {
  color: var(--wpi-crimson);
  text-decoration: none;
  font-weight: 600;
}

#footer a:hover {
  text-decoration: underline;
}

#footer em {
  font-style: italic;
}

/* Modal Dialog System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 90%;
  max-width: 540px;
  max-height: 85vh;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

/* Tutorial Modal Specific Rules */
.tutorial-modal-card {
  max-width: 580px !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25) !important;
}

.tutorial-modal-header {
  background: #ffffff;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-color);
}

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

.tutorial-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--wpi-crimson);
  background: var(--wpi-crimson-light);
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.step-counter {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.tutorial-progress-track {
  width: 100%;
  height: 3px;
  background: #f1f5f9;
}

.tutorial-progress-bar {
  height: 100%;
  background: var(--wpi-crimson);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tutorial-modal-body {
  padding: 24px;
  background: #ffffff;
  min-height: 220px;
  overflow-y: auto;
}

.tutorial-step-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.step-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--wpi-crimson-light);
  color: var(--wpi-crimson);
  flex-shrink: 0;
}

.step-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.step-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.step-desc a {
  color: var(--wpi-crimson);
  text-decoration: none;
  font-weight: 600;
}

.step-desc a:hover {
  text-decoration: underline;
}

.step-highlights {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
}

.step-highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-primary);
}

.step-highlight-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--wpi-crimson);
  flex-shrink: 0;
  margin-top: 2px;
}

.tutorial-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
}

.tutorial-pagination-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tutorial-pagination-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tutorial-pagination-dots .dot.active {
  width: 20px;
  border-radius: 10px;
  background: var(--wpi-crimson);
}

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

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

.modal-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s ease;
}

.modal-close-btn:hover {
  color: var(--wpi-crimson);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.modal-body a {
  color: var(--wpi-crimson);
  text-decoration: none;
  font-weight: 600;
}

.modal-body a:hover {
  text-decoration: underline;
}

.modal-section {
  margin-bottom: 18px;
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-footer-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  font-size: 0.83rem;
  color: var(--text-secondary);
}

.modal-section h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--wpi-crimson);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.help-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.help-list li {
  position: relative;
  padding-left: 4px;
}

.color-sample {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 4px;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.red-sample {
  background: var(--wpi-crimson);
}

.indigo-sample {
  background: var(--badge-indigo-text);
}

.sky-sample {
  background: var(--badge-sky-text);
}

.white-sample {
  background: #ffffff;
  border-color: #64748b;
}

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

::-webkit-scrollbar-track {
  background: #f4f1ea;
}

::-webkit-scrollbar-thumb {
  background: #d5cfc2;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #b8b09f;
}

/* Bottom Left Controls & Legend Widget */
.controls-legend-widget {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: auto;
  z-index: 10;
  width: 250px;
  background: rgba(253, 251, 247, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.8rem;
}

@media (max-width: 768px),
(pointer: coarse) {
  .controls-legend-widget {
    left: 16px;
  }

  .legend-group.keyboard-shortcuts-group {
    display: none;
  }
}

.controls-legend-widget:hover {
  border-color: var(--border-hover);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.legend-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.legend-icon {
  font-size: 0.9rem;
}

.legend-toggle-btn {
  background: transparent;
  border: none;
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s ease;
  padding: 2px 4px;
}

.controls-legend-widget.collapsed .legend-toggle-btn {
  transform: rotate(-90deg);
}

.controls-legend-widget.collapsed .legend-header {
  border-bottom-color: transparent;
}

.legend-content {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  transform: translateY(0);
  transform-origin: top;
}

.legend-content-inner {
  min-height: 0;
  overflow: hidden;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.controls-legend-widget.collapsed .legend-content {
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

.legend-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.group-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.legend-items-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.75rem;
}

.controls-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.controls-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.control-key {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--wpi-crimson);
  background: var(--wpi-crimson-light);
  border: 1px solid rgba(172, 43, 55, 0.2);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Step-by-Step Tutorial Modal Styles */
.tutorial-modal-card {
  width: 580px;
  max-width: calc(100vw - 32px);
  height: 420px;
  max-height: calc(100vh - 32px);
  border-radius: 14px;
}

.tutorial-modal-header {
  padding: 14px 20px;
  background: var(--bg-card);
}

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

.tutorial-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff;
  background: var(--wpi-crimson);
  padding: 2px 8px;
  border-radius: 9999px;
}

.step-counter {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.tutorial-progress-track {
  width: 100%;
  height: 4px;
  background: var(--border-color);
  overflow: hidden;
}

.tutorial-progress-bar {
  height: 100%;
  background: var(--wpi-crimson);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tutorial-modal-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.tutorial-step-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeInStep 0.25s ease-in-out forwards;
}

@keyframes fadeInStep {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

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

.step-header-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.step-hero-icon {
  font-size: 2.2rem;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: var(--wpi-crimson-light);
  border: 1px solid rgba(172, 43, 55, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wpi-crimson);
}

.step-hero-icon svg {
  display: block;
}

.step-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.step-desc {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.step-highlights {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--text-primary);
}

.step-highlight-icon {
  color: var(--wpi-crimson);
  font-weight: bold;
  display: flex;
  align-items: center;
  margin-top: 2px;
  flex-shrink: 0;
}

.tutorial-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tutorial-pagination-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dot.active {
  background: var(--wpi-crimson);
  width: 18px;
  border-radius: 4px;
}

.tutorial-nav-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.btn-primary:hover {
  background: var(--wpi-crimson-hover);
  border-color: var(--wpi-crimson-hover);
}

.btn-subtle {
  background: transparent;
  border: none;
  color: var(--text-muted);
}

.btn-subtle:hover {
  color: var(--text-primary);
  background: transparent;
}

/* Step 2 Focused Highlight for Search Bar and Department Dropdown */
body.tutorial-step-2-active #header {
  position: relative;
  z-index: 2001;
  background: transparent;
  pointer-events: none;
  border-bottom: none !important;
  box-shadow: none !important;
}

body.tutorial-step-2-active .brand,
body.tutorial-step-2-active .toolbar-right-group button,
body.tutorial-step-2-active .academic-year-badge {
  opacity: 0.4;
}

body.tutorial-step-2-active .search-box input,
body.tutorial-step-2-active #dept-select {
  pointer-events: auto;
  position: relative;
  z-index: 2002;
  border: 2px solid var(--wpi-crimson) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(172, 43, 55, 0.35), 0 0 20px rgba(172, 43, 55, 0.6);
  animation: tutorialRedPulse 1.5s infinite ease-in-out;
}

@keyframes tutorialRedPulse {

  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(172, 43, 55, 0.4), 0 0 12px rgba(172, 43, 55, 0.5);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(172, 43, 55, 0.75), 0 0 24px rgba(172, 43, 55, 0.85);
  }
}

/* Steps 3 & 4 Focused Highlight for Right Sidebar Course Details Section */
body.tutorial-step-3-active #sidebar,
body.tutorial-step-4-active #sidebar {
  position: relative;
  z-index: 2001;
  background: transparent;
  border-left: none !important;
  pointer-events: none;
}

body.tutorial-step-3-active .sidebar-section:not(.details-section),
body.tutorial-step-4-active .sidebar-section:not(.details-section) {
  opacity: 0.3;
}

body.tutorial-step-3-active .details-section,
body.tutorial-step-4-active .details-section {
  position: relative;
  z-index: 2002;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  border-radius: 12px 0 0 0;
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.15);
  pointer-events: auto;
}

/* Step 4 Red Highlight for Collapse Tree / Show All Button */
body.tutorial-step-4-active .details-section .detail-block-header button {
  position: relative;
  z-index: 2003;
  border: 2px solid var(--wpi-crimson) !important;
  background: #ffffff !important;
  color: var(--wpi-crimson) !important;
  font-weight: 700 !important;
  box-shadow: 0 0 0 4px rgba(172, 43, 55, 0.35), 0 0 20px rgba(172, 43, 55, 0.6);
  animation: tutorialRedPulse 1.5s infinite ease-in-out;
}

/* ============================================================================
   RESPONSIVE MOBILE & LANDSCAPE ENGINE
   ============================================================================ */

/* Hide mobile elements on desktop by default */
.mobile-drawer-handle-bar,
.mobile-drawer-overlay,
.mobile-fab-btn,
.mobile-menu-btn {
  display: none;
}

/* ----------------------------------------------------------------------------
   1. PORTRAIT MOBILE VIEWPORTS (<768px portrait)
   ---------------------------------------------------------------------------- */
@media (max-width: 767px) and (orientation: portrait),
(max-width: 600px) {
  #header {
    padding: 0 12px;
    height: 54px;
  }

  .brand-title p,
  .academic-year-badge {
    display: none;
  }

  .brand-title h1 {
    font-size: 1rem;
  }

  .search-box {
    width: 140px;
  }

  .search-box input {
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  .mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 34px;
    height: 34px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
  }

  .mobile-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.2s ease;
  }

  .toolbar-right-group {
    display: none;
    position: absolute;
    top: 54px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    z-index: 150;
  }

  .toolbar-right-group.mobile-active {
    display: flex;
  }

  .toolbar-right-group .select-control,
  .toolbar-right-group .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 8px 12px;
  }

  /* Stats Bar on Mobile */
  .stats-bar {
    top: 8px;
    left: 8px;
    right: 8px;
    gap: 6px;
    justify-content: space-between;
  }

  .stat-pill {
    padding: 3px 8px;
    font-size: 0.7rem;
    flex: 1;
    text-align: center;
  }

  /* Controls Legend Widget on Mobile */
  .controls-legend-widget {
    bottom: 64px;
    left: 8px;
    width: 200px;
  }

  /* Slide-Up Bottom Sheet Drawer */
  #sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 70vh;
    max-height: 85vh;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border-color);
    border-left: none;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.2);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
  }

  #sidebar.mobile-open {
    transform: translateY(0);
  }

  .mobile-drawer-handle-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    border-radius: 18px 18px 0 0;
    cursor: pointer;
    user-select: none;
  }

  .drawer-drag-pill {
    width: 36px;
    height: 4px;
    background: var(--border-hover);
    border-radius: 2px;
    margin: 0 auto;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .mobile-drawer-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
  }

  .mobile-drawer-close-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
  }

  /* Backdrop Overlay */
  .mobile-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 999;
  }

  .mobile-drawer-overlay.mobile-active {
    display: block;
  }

  /* Mobile Floating Action Button (FAB) */
  .mobile-fab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    background: var(--wpi-crimson);
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    padding: 10px 20px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 6px 18px rgba(172, 43, 55, 0.4);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.15s ease;
    white-space: nowrap;
  }

  .mobile-fab-btn:active {
    transform: translateX(-50%) scale(0.95);
  }
}

/* ----------------------------------------------------------------------------
   2. LANDSCAPE VIEWPORTS (<1024px landscape / height <600px)
   ---------------------------------------------------------------------------- */
@media (max-width: 1023px) and (orientation: landscape),
(max-height: 600px) and (min-width: 601px) {
  #header {
    height: 46px;
    padding: 0 14px;
  }

  .brand-title h1 {
    font-size: 0.95rem;
  }

  .brand-title p,
  .academic-year-badge {
    display: none;
  }

  .search-box {
    width: 180px;
  }

  .search-box input {
    padding: 4px 8px;
    font-size: 0.78rem;
  }

  .toolbar-right-group .select-control,
  .toolbar-right-group .btn {
    padding: 4px 8px;
    font-size: 0.78rem;
  }

  #main-container {
    height: calc(100vh - 46px);
  }

  /* Slide-Over Right Side Drawer for Landscape */
  #sidebar {
    position: fixed;
    top: 46px;
    bottom: 0;
    right: 0;
    width: 320px;
    height: calc(100vh - 46px);
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    box-shadow: -10px 0 30px rgba(15, 23, 42, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
  }

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

  .mobile-drawer-handle-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
  }

  .drawer-drag-pill {
    display: none;
  }

  .mobile-drawer-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
  }

  .mobile-drawer-close-btn {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
  }

  .mobile-drawer-overlay {
    display: none;
    position: fixed;
    top: 46px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 999;
  }

  .mobile-drawer-overlay.mobile-active {
    display: block;
  }

  /* Side-Docked FAB for Landscape */
  .mobile-fab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    position: fixed;
    bottom: 16px;
    right: 16px;
    left: auto;
    transform: none;
    z-index: 900;
    background: var(--wpi-crimson);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 8px 14px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: 0 4px 14px rgba(172, 43, 55, 0.35);
    cursor: pointer;
  }

  .stats-bar {
    top: 8px;
    left: 8px;
  }

  .controls-legend-widget {
    bottom: 8px;
    left: 8px;
  }
}

/* ----------------------------------------------------------------------------
   TUTORIAL ACTIVE STEP TARGET HIGHLIGHTS
   ---------------------------------------------------------------------------- */
@keyframes tutorialPulse {
  0% {
    box-shadow: 0 0 0 2px rgba(172, 43, 55, 0.4), 0 2px 8px rgba(172, 43, 55, 0.2);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(172, 43, 55, 0.65), 0 6px 18px rgba(172, 43, 55, 0.35);
  }

  100% {
    box-shadow: 0 0 0 2px rgba(172, 43, 55, 0.4), 0 2px 8px rgba(172, 43, 55, 0.2);
  }
}

.modal-card {
  z-index: 2050 !important;
  position: relative;
}

body.tutorial-step-2-active #header,
body.tutorial-step-3-active #sidebar,
body.tutorial-step-4-active #sidebar {
  z-index: 2010 !important;
  position: relative;
}

body.tutorial-step-2-active #sidebar {
  overflow: visible !important;
}

body.tutorial-step-2-active .search-box input,
body.tutorial-step-2-active #dept-select {
  border-color: var(--wpi-crimson) !important;
  animation: tutorialPulse 1.8s infinite ease-in-out !important;
  position: relative;
  z-index: 2020 !important;
  background-color: #ffffff !important;
}

body.tutorial-step-3-active .sidebar-section.details-section,
body.tutorial-step-4-active .sidebar-section.details-section {
  border: 2px solid var(--wpi-crimson) !important;
  border-radius: 12px;
  animation: tutorialPulse 1.8s infinite ease-in-out !important;
  position: relative;
  z-index: 2020 !important;
  background-color: #ffffff !important;
}


.wip-banner {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--wpi-crimson);
  text-align: center;
  padding: 4px 0;
  background: var(--wpi-crimson-light);
  border-bottom: 1px solid var(--wpi-crimson);
}