﻿body, html {
  margin: 0; padding: 0; height: 100%;
  font-family: 'Inter', sans-serif;
  background: #f8f9fa; /* White/Light background */
  overflow: hidden;
}

/* Header */
.atlas-header {
  position: absolute; top: 24px; left: 32px; right: 32px;
  display: flex; justify-content: space-between; align-items: flex-start;
  z-index: 10; pointer-events: none;
}
.atlas-title-group {
  pointer-events: auto;
}
.eyebrow {
  font-size: 10px; font-weight: 700; color: #64748b;
  letter-spacing: 1px; text-transform: uppercase;
}
h1 {
  font-size: 24px; font-weight: 700; color: #0f172a;
  margin: 4px 0; display: flex; align-items: center; gap: 8px;
}
.badge {
  font-size: 11px; background: #e2e8f0; color: #475569;
  padding: 2px 6px; border-radius: 4px;
}
.subtitle {
  font-size: 12px; color: #64748b; margin: 0;
}
.btn-back {
  pointer-events: auto;
  text-decoration: none; font-size: 14px; font-weight: 600;
  color: #0f172a; background: #ffffff;
  padding: 8px 16px; border-radius: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1px solid #e2e8f0;
}

/* Sidebar */
.atlas-sidebar {
  position: absolute; top: 120px; left: 32px;
  width: 260px; background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 16px; box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  padding: 20px; z-index: 10;
  border: 1px solid #e2e8f0;
}
.systems-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.systems-header h2 {
  font-size: 16px; font-weight: 700; margin: 0; color: #0f172a;
}
.count-badge {
  font-size: 12px; background: #f1f5f9; padding: 2px 8px; border-radius: 10px; color: #475569;
}

/* Toggles */
.system-list { display: flex; flex-direction: column; gap: 16px; }
.system-item {
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer;
}
.sys-name {
  font-size: 13px; font-weight: 600; color: #334155;
  display: flex; align-items: center; gap: 8px;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}

/* Toggle Switch CSS */
.toggle-switch {
  position: relative; width: 36px; height: 20px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1; transition: .3s;
  border-radius: 20px;
}
.slider:before {
  position: absolute; content: "";
  height: 16px; width: 16px; left: 2px; bottom: 2px;
  background-color: white; transition: .3s;
  border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input:checked + .slider { background-color: #0ea5e9; } /* LIGHT BLUE */
input:checked + .slider:before { transform: translateX(16px); }

/* 3D Viewer */
.viewer-container {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}
model-viewer {
  width: 100%; height: 100%;
  --poster-color: transparent;
}

/* Bottom Toolbar */
.bottom-toolbar {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  padding: 20px 24px; border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
  width: 320px; z-index: 10;
}
.explode-header {
  display: flex; justify-content: space-between; font-size: 12px; font-weight: 600;
  margin-bottom: 12px; color: #0f172a;
}
input[type=range] {
  width: 100%; margin: 0; cursor: pointer;
  accent-color: #0ea5e9; /* Light blue slider */
}
.explode-labels {
  display: flex; justify-content: space-between; font-size: 10px; color: #94a3b8;
  margin-top: 8px; text-transform: uppercase; letter-spacing: 0.5px;
}

/* Info Panel (Right Sidebar) */
.atlas-info-panel {
  position: absolute; top: 120px; right: 32px;
  width: 280px; background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  padding: 24px; z-index: 10;
  border: 1px solid #e2e8f0;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.atlas-info-panel.visible {
  transform: translateX(0);
}
.info-system {
  font-size: 11px; font-weight: 700; color: #0ea5e9;
  letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 6px;
  display: block;
}
.info-title {
  font-size: 18px; font-weight: 700; color: #0f172a; margin: 0 0 12px 0;
  line-height: 1.3;
}
.info-desc {
  font-size: 13px; color: #475569; line-height: 1.6; margin: 0 0 20px 0;
}
.info-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; font-size: 18px; color: #94a3b8;
  cursor: pointer; padding: 4px; line-height: 1; border-radius: 4px;
}
.info-close:hover { background: #f1f5f9; color: #0f172a; }
.btn-isolate {
  display: block; width: 100%; padding: 10px;
  background: #0f172a; color: #fff; text-align: center;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; transition: 0.2s;
}
.btn-isolate:hover { background: #1e293b; }

/* Hover Tooltip */
.hover-tooltip {
  position: absolute;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  z-index: 1000;
  transform: translate(-50%, -100%);
  margin-top: -10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}
.hover-tooltip.visible {
  opacity: 1;
}
.hover-tooltip::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.85) transparent transparent transparent;
}

/* Rich Theory Sections */
.anatomy-theory {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.theory-section {
  background: rgba(241, 245, 249, 0.6);
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid #0ea5e9;
}
.theory-section h4 {
  margin: 0 0 4px 0;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.theory-section p {
  margin: 0;
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
}
/* Specifically for isolation wrapper if needed */
.info-desc-wrapper {
  margin-bottom: 20px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 8px;
}
/* Scrollbar styling for the theory panel */
.info-desc-wrapper::-webkit-scrollbar { width: 4px; }
.info-desc-wrapper::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: none;
  flex-direction: column;
}
.search-results.active {
  display: flex;
}
.search-item {
  padding: 8px 10px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}
.search-item:hover {
  background: #f1f5f9;
  color: #0ea5e9;
}
.quiz-panel {
  background: #f8fafc;
  border: 2px dashed #8b5cf6;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 15px;
  text-align: center;
}

/* Studio presentation: a quieter frame so the anatomical model carries the page. */
body, html { background: #f3f6f4; }
.atlas-header { top: 20px; left: 24px; right: 24px; }
h1 { font-size: 22px; font-weight: 750; color: #10221d; }
.atlas-sidebar {
  top: 112px; left: 24px; width: 236px; padding: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(214, 226, 219, 0.86);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(30, 49, 42, 0.08);
}
.system-list { gap: 11px; }
.viewer-container {
  background:
    radial-gradient(ellipse 36% 44% at 50% 47%, rgba(255,255,255,.98) 0%, rgba(255,255,255,.58) 48%, transparent 78%),
    linear-gradient(180deg, #fbfdfc 0%, #f3f6f4 67%, #edf1ef 100%);
  overflow: hidden;
}
.bottom-toolbar {
  bottom: 28px; width: 292px; padding: 15px 18px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(214, 226, 219, 0.92);
  box-shadow: 0 12px 32px rgba(30, 49, 42, 0.09);
}
.atlas-info-panel {
  top: 112px; right: 24px; padding: 20px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(214, 226, 219, 0.92);
  box-shadow: 0 14px 38px rgba(30, 49, 42, 0.11);
}
.atlas-sidebar {
  max-height: calc(100vh - 136px);
  overflow-y: auto;
  box-sizing: border-box;
}
.atlas-sidebar::-webkit-scrollbar { width: 5px; }
.atlas-sidebar::-webkit-scrollbar-thumb { background: #c7d4cd; border-radius: 999px; }
.atlas-sidebar .sys-name { font-size: 12px; }
