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

html {
  font-size: 19px; /* Site-wide scaled root font size for comfortable reading */
}

:root {
  /* Dark Mode Palette (Default) */
  --bg-color: hsl(222, 47%, 7%);
  --bg-accent: hsl(223, 40%, 10%);
  --sidebar-bg: hsla(222, 47%, 5%, 0.8);
  --card-bg: hsla(222, 40%, 12%, 0.6);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover-border: hsla(250, 85%, 65%, 0.4);
  
  --text-primary: hsl(210, 40%, 98%);
  --text-secondary: hsl(215, 20%, 75%);
  --text-muted: hsl(215, 15%, 55%);
  
  --primary: hsl(250, 85%, 65%);
  --primary-glow: hsla(250, 85%, 65%, 0.35);
  --secondary: hsl(175, 75%, 45%);
  --secondary-glow: hsla(175, 75%, 45%, 0.3);
  --accent: hsl(14, 90%, 60%);
  --accent-glow: hsla(14, 90%, 60%, 0.3);
  
  --danger: hsl(350, 80%, 55%);
  --success: hsl(145, 80%, 40%);
  --warning: hsl(40, 90%, 55%);
  --info: hsl(195, 85%, 50%);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  
  --glass-blur: blur(12px) saturate(180%);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

[data-theme="light"] {
  /* High-Contrast Light Mode Palette */
  --bg-color: hsl(210, 30%, 96%);
  --bg-accent: hsl(210, 30%, 92%);
  --sidebar-bg: hsla(210, 30%, 90%, 0.85);
  --card-bg: hsla(0, 0%, 100%, 0.75);
  --card-border: rgba(0, 0, 0, 0.08);
  --card-hover-border: hsla(250, 85%, 65%, 0.6);
  
  --text-primary: hsl(222, 47%, 12%);
  --text-secondary: hsl(220, 20%, 35%);
  --text-muted: hsl(220, 10%, 50%);
  
  --primary: hsl(250, 85%, 55%);
  --primary-glow: hsla(250, 85%, 55%, 0.25);
  --secondary: hsl(175, 85%, 35%);
  --secondary-glow: hsla(175, 85%, 35%, 0.2);
  --accent: hsl(14, 90%, 50%);
  --accent-glow: hsla(14, 90%, 50%, 0.2);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.12);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
  line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text-primary);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition-smooth);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Sidebar Navigation Layout */
.sidebar {
  width: 280px;
  background-color: var(--sidebar-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  padding: 24px;
  transition: var(--transition-smooth);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 24px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.logo-text h2 {
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: var(--card-bg);
  border-color: var(--card-border);
  transform: translateX(4px);
}

.nav-link.active {
  color: white;
  background: linear-gradient(135deg, var(--primary), hsla(250, 85%, 65%, 0.8));
  box-shadow: 0 4px 20px var(--primary-glow);
  border-color: rgba(255, 255, 255, 0.15);
}

.nav-link svg {
  width: 20px;
  height: 20px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Theme Switcher Toggle */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.theme-toggle-btn:hover {
  background-color: var(--bg-accent);
  color: var(--text-primary);
}

/* Main Container Frame */
.main-wrapper {
  margin-left: 280px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 40px;
  transition: var(--transition-smooth);
}

.page-header {
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.page-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--text-muted));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
}

/* Standard Premium UI Components */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.glass-card {
  background-color: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, transparent);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  transform: translateY(-6px);
  border-color: var(--card-hover-border);
  box-shadow: var(--shadow-lg), 0 0 15px var(--primary-glow);
}

.glass-card:hover::before {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.card-icon {
  width: 44px;
  height: 44px;
  background-color: var(--bg-accent);
  border: 1px solid var(--card-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: var(--transition-smooth);
}

.glass-card:hover .card-icon {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.pill-badge {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
}

.badge-primary { background-color: var(--primary-glow); color: var(--primary); border-color: rgba(250, 85, 65, 0.2); }
.badge-secondary { background-color: var(--secondary-glow); color: var(--secondary); border-color: rgba(175, 75, 45, 0.2); }
.badge-accent { background-color: var(--accent-glow); color: var(--accent); border-color: rgba(14, 90, 60, 0.2); }
.badge-success { background-color: rgba(145, 80, 40, 0.15); color: var(--success); }
.badge-danger { background-color: rgba(350, 80, 55, 0.15); color: var(--danger); }
.badge-warning { background-color: rgba(40, 90, 55, 0.15); color: var(--warning); }

/* Buttons styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), hsla(250, 85%, 65%, 0.8));
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px var(--primary-glow);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--card-bg);
  border-color: var(--card-border);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background-color: var(--bg-accent);
  border-color: var(--text-secondary);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), hsla(14, 90%, 60%, 0.8));
  color: white;
  box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-accent:hover {
  box-shadow: 0 6px 20px var(--accent-glow);
  transform: translateY(-2px);
}

/* Accordions (FAQs / Details) */
.accordion {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background-color: var(--card-bg);
  overflow: hidden;
  margin-bottom: 12px;
  transition: var(--transition-smooth);
}

.accordion-trigger {
  width: 100%;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  outline: none;
}

.accordion-icon {
  transition: transform 0.3s ease;
  color: var(--text-muted);
}

.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  padding: 0 20px;
}

.accordion.open {
  border-color: var(--primary);
}

.accordion.open .accordion-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

.accordion.open .accordion-panel {
  max-height: 1000px;
  padding: 0 20px 20px 20px;
  transition: max-height 0.3s ease-in;
}

/* Custom Premium Checkbox Lists */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--card-border);
  cursor: pointer;
  transition: var(--transition-smooth);
}

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

.checklist-item:hover {
  background-color: var(--bg-accent);
}

.custom-checkbox {
  min-width: 22px;
  height: 22px;
  border: 2px solid var(--text-muted);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: var(--transition-smooth);
  margin-top: 2px;
}

.checklist-item.checked .custom-checkbox {
  background-color: var(--secondary);
  border-color: var(--secondary);
  color: white;
}

.checklist-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.checklist-item.checked .checklist-text {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Module 1 - Hearing Loss Degrees Visualizer & Anatomy */
.visualizer-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.visualizer-main-row {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .visualizer-main-row {
    flex-direction: row !important;
    align-items: center;
  }
}

.anatomy-svg-wrapper {
  position: relative;
  background-color: var(--bg-accent);
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  overflow: hidden;
  max-width: 480px;
  width: 100%;
  aspect-ratio: 1/1;
  margin: 0 auto;
  flex: 1.2 1 320px;
}

.pathway-selector-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 280px;
  justify-content: center;
}

.pathway-step-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-family: inherit;
  width: 100%;
}

.pathway-step-btn .step-num {
  background: var(--bg-accent);
  border: 1.5px solid var(--card-border);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.pathway-step-btn .step-info {
  display: flex;
  flex-direction: column;
}

.pathway-step-btn .step-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: var(--transition-smooth);
  line-height: 1.25;
}

.pathway-step-btn .step-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: var(--transition-smooth);
  line-height: 1.2;
  margin-top: 2px;
}

/* Hover & Cross-Highlight States */
.pathway-step-btn:hover, .pathway-step-btn.hover-highlight {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--card-hover-border);
  transform: translateX(4px);
}

.pathway-step-btn:hover .step-title, .pathway-step-btn.hover-highlight .step-title {
  color: var(--secondary);
}

.pathway-step-btn:hover .step-num, .pathway-step-btn.hover-highlight .step-num {
  border-color: var(--secondary);
  color: var(--secondary);
}

/* Active Highlight States */
.pathway-step-btn.active {
  background: var(--primary-glow);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(250, 85, 65, 0.05);
}

.pathway-step-btn.active .step-num {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.pathway-step-btn.active .step-title {
  color: var(--primary);
}

.pathway-step-btn.active .step-subtitle {
  color: var(--text-secondary);
}

/* Interactive Ear Target Badges */
.ear-target-badge {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--secondary);
  border: 2px solid #fff;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(0, 206, 209, 0.3), var(--shadow-sm);
  padding: 0;
  outline: none;
}

.ear-target-badge .badge-pulse {
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--secondary);
  opacity: 0;
  animation: badgePulse 2s infinite ease-out;
  pointer-events: none;
}

/* Hover State */
.ear-target-badge:hover, .ear-target-badge.hover-highlight {
  background-color: var(--secondary);
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 0 12px var(--secondary), var(--shadow-md);
  border-color: #fff;
}

/* Active State */
.ear-target-badge.active {
  background-color: var(--primary);
  border-color: #fff;
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 0 16px var(--primary), var(--shadow-md);
}

.ear-target-badge.active .badge-pulse {
  border-color: var(--primary);
}

@keyframes badgePulse {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}



.anatomy-details-box {
  min-height: 120px;
  margin-top: 16px;
}

/* Interactive Sliders (Neon Track & Glow Handles) */
.range-slider-wrapper {
  margin: 20px 0;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.custom-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-accent);
  border-radius: 4px;
  outline: none;
  border: 1px solid var(--card-border);
  transition: var(--transition-smooth);
}

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px var(--primary-glow);
  transition: var(--transition-smooth);
}

.custom-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 15px var(--primary);
}

/* Module 3 - Drag-and-Drop Classroom Seating Planner */
.planner-container {
  display: flex;
  gap: 24px;
  flex-direction: column;
  margin-top: 20px;
}

@media (min-width: 992px) {
  .planner-container {
    flex-direction: row;
  }
}

.classroom-grid {
  flex: 2.2;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 10px;
  background-color: var(--bg-accent);
  border: 2px dashed var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px;
  aspect-ratio: 1;
  position: relative;
  max-width: 580px;
  max-height: 580px;
  width: 100%;
}

.classroom-node {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: var(--transition-smooth);
  padding: 8px;
  text-align: center;
  overflow: hidden;
}

.classroom-node.fixed-node {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  font-weight: 700;
  color: var(--text-primary);
}

.classroom-node.drop-target {
  border: 2px dashed var(--primary);
  background-color: var(--primary-glow);
}

.classroom-node.zone-excellent {
  background-color: rgba(145, 80, 40, 0.1);
  border-color: hsla(145, 80%, 40%, 0.3);
}

.classroom-node.zone-moderate {
  background-color: rgba(40, 90, 55, 0.1);
  border-color: hsla(40, 90%, 55%, 0.3);
}

.classroom-node.zone-poor {
  background-color: rgba(350, 80, 55, 0.1);
  border-color: hsla(350, 80%, 55%, 0.3);
}

.student-palette {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.draggable-student-card {
  padding: 16px;
  background: linear-gradient(135deg, var(--card-bg), var(--bg-accent));
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  cursor: grab;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 15px var(--primary-glow);
  font-weight: 700;
}

.draggable-student-card:active {
  cursor: grabbing;
}

.draggable-student-card.palette-active {
  border-color: var(--secondary) !important;
  box-shadow: 0 0 15px var(--secondary-glow) !important;
  transform: translateY(-2px);
}

/* Compact styling for draggable elements inside grid cells */
.classroom-node .draggable-student-card {
  padding: 4px !important;
  background: transparent !important;
  border: none !important;
  cursor: grab;
  display: flex;
  flex-direction: column !important;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100% !important;
  height: 100% !important;
  box-shadow: none !important;
  gap: 2px !important;
  margin: 0 !important;
}

.classroom-node .draggable-student-card p {
  display: none !important;
}

.classroom-node .draggable-student-card h5 {
  font-size: 0.65rem !important;
  margin-top: 2px !important;
  color: var(--text-primary) !important;
  font-weight: 600 !important;
  white-space: normal !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  line-height: 1.2 !important;
  max-height: 2.4em !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  width: 100% !important;
}

.classroom-node .draggable-student-card div:first-child {
  font-size: 1.4rem !important;
}

.classroom-info-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  font-size: 0.9rem;
}

/* Module 4 - Maintenance Branching Wizard & Cards */
.troubleshoot-node {
  text-align: center;
  padding: 30px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  max-width: 600px;
  margin: 0 auto;
}

.wizard-choices {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
}

.battery-display {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background-color: var(--bg-accent);
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  margin-top: 12px;
}

.battery-color-pill {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.pill-y10 { background-color: #ffd700; }
.pill-br312 { background-color: #8b4513; }
.pill-or13 { background-color: #ff8c00; }
.pill-bl675 { background-color: #1e90ff; }

/* Module 5 - Simulator (SVG Audiogram & Controls) */
.simulator-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 1200px) {
  .simulator-layout {
    grid-template-columns: 3fr 2fr;
  }
}

.audiogram-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.audiogram-svg-container {
  width: 100%;
  max-width: 650px;
  aspect-ratio: 980 / 781;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.audiogram-grid-line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.audiogram-grid-label {
  fill: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
}

.audiogram-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-dasharray: 4 2;
  pointer-events: none;
}

.audiogram-node-circle {
  fill: var(--bg-color);
  stroke: var(--accent);
  stroke-width: 3;
  cursor: ns-resize;
  transition: stroke-width 0.15s ease, fill 0.15s ease;
}

.audiogram-node-circle:hover, .audiogram-node-circle.dragging {
  fill: var(--accent);
  stroke-width: 6;
}

.simulator-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Control Toggles */
.filter-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background-color: var(--bg-accent);
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--card-border);
  transition: .3s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px; width: 18px;
  left: 4px; bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--secondary);
}

input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* Visualizer Canvas box */
.visualizer-wrapper {
  margin-top: 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: black;
  border: 1px solid var(--card-border);
  height: 120px;
  position: relative;
}

.visualizer-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Tab container controls */
.tabs-container {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Audio Snippet selector cards */
.snippet-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.snippet-btn {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.snippet-btn:hover, .snippet-btn.active {
  border-color: var(--primary);
  background-color: var(--bg-accent);
}

.snippet-btn.active h5 {
  color: var(--primary);
}

.snippet-btn h5 {
  font-weight: 700;
  font-size: 0.9rem;
}

.snippet-btn span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* File Dropper style */
.file-dropper {
  border: 2px dashed var(--card-border);
  background-color: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.file-dropper:hover {
  border-color: var(--primary);
  background-color: var(--bg-accent);
}

/* Footer layout */
.page-footer {
  margin-top: auto;
  padding-top: 40px;
  border-top: 1px solid var(--card-border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsiveness overrides */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-280px);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .main-wrapper {
    margin-left: 0;
    padding: 24px;
  }
  .mobile-menu-toggle {
    display: block;
  }
}

/* Standard AG Bell Background Image & Audibility Mask */
#audiogram-bg-image {
  border-radius: var(--radius-md);
  transition: filter 0.3s ease;
}

[data-theme="dark"] #audiogram-bg-image,
[data-theme="dark"] #audiogram-bg-image-bar,
[data-theme="dark"] #speech-banana-cap {
  /* Invert whites to slate-black, while keeping the Speech Banana yellow/orange using hue rotation */
  filter: invert(0.9) hue-rotate(180deg) brightness(1.2) contrast(0.95);
}

.audiogram-label-mask {
  fill: #ffffff;
}

[data-theme="dark"] .audiogram-label-mask {
  fill: #191c24; /* matches the inverted white background exactly under CSS filter */
}

.audiogram-header-text {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-anchor: middle;
  fill: #2d3748;
}

[data-theme="dark"] .audiogram-header-text {
  fill: #e2e8f0;
}

.audiogram-grid-line {
  stroke: #4f4f4f;
  stroke-width: 2;
}

[data-theme="dark"] .audiogram-grid-line {
  stroke: #c4c4c4;
  stroke-width: 2;
}

#audiogram-mask {
  fill: rgba(10, 15, 30, 0.55);
}

[data-theme="light"] #audiogram-mask {
  fill: rgba(255, 255, 255, 0.6);
}

/* High-Tech 3D Lightbox Inspector Styles */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-modal.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: -1;
}

.lightbox-content {
  position: relative;
  width: 100%;
  max-width: 960px;
  height: 80vh;
  max-height: 700px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-hover-border);
  padding: 32px;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 30px var(--primary-glow);
  transform: scale(0.95);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.lightbox-modal.open .lightbox-content {
  transform: scale(1);
}

.lightbox-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.lightbox-close-btn:hover {
  color: var(--danger);
  transform: scale(1.1);
}

/* 3D Showcase Viewer Container */
.inspector-main-row {
  height: 100%;
}

.inspector-viewer-pane {
  flex: 1.3;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.viewer-container-3d {
  flex: 1;
  background: radial-gradient(circle at center, hsla(223, 40%, 15%, 0.8) 0%, var(--bg-accent) 100%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  perspective: 1200px;
}

.viewer-container-3d:active {
  cursor: grabbing;
}

.rotator-3d-wrapper {
  position: relative;
  width: 75%;
  height: 75%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease-out;
}

.rotator-3d-wrapper img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
  pointer-events: none;
}

/* Lightbox Controls HUD */
.viewer-controls-hud {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.inspector-hud-details-pane {
  flex: 1;
  min-width: 280px;
}

/* Interactive Glowing Hotspots on 3D rotator */
.hud-hotspot {
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--primary);
  border: 2px solid #fff;
  border-radius: 50%;
  z-index: 100;
  cursor: pointer;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--primary-glow);
  transition: var(--transition-smooth);
}

.hud-hotspot::after {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
  opacity: 0;
  animation: badgePulse 2s infinite ease-out;
  pointer-events: none;
}

.hud-hotspot:hover, .hud-hotspot.active {
  background: var(--secondary);
  border-color: #fff;
  transform: translate(-50%, -50%) scale(1.25);
  box-shadow: 0 0 14px var(--secondary);
}

.hud-hotspot:hover::after, .hud-hotspot.active::after {
  border-color: var(--secondary);
}

/* Interactive hover tilt on the card image elements */
.maintenance-card-img-wrapper {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.01);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  width: 100px;
  height: 100px;
  margin: 0 auto;
  flex-shrink: 0;
}

.maintenance-card-img-wrapper::after {
  content: '🔍 Inspect';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(138, 43, 226, 0.85);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  text-align: center;
  padding: 2px 0;
  opacity: 0;
  transform: translateY(100%);
  transition: var(--transition-smooth);
}

.maintenance-card-img-wrapper:hover {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.maintenance-card-img-wrapper:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.maintenance-card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.maintenance-card-img-wrapper:hover img {
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .lightbox-content {
    height: 90vh;
    overflow-y: auto;
    padding: 20px;
  }
  .inspector-main-row {
    flex-direction: column !important;
    height: auto;
    gap: 20px;
  }
  .inspector-hud-details-pane {
    height: auto;
    min-height: 220px;
  }
  .viewer-container-3d {
    min-height: 250px;
  }
}
