/* ==========================================================================
   ATLAS & DESCRITOR INTELIGENTE DO CORPO HUMANO
   Design System: Deep Cyber-Bio / Medical Futuristic Interface
   ========================================================================== */

:root {
  /* Color Tokens */
  --bg-dark-900: #070b14;
  --bg-dark-800: #0b1322;
  --bg-dark-700: #101c30;
  --bg-card: rgba(16, 28, 48, 0.72);
  --bg-card-hover: rgba(22, 38, 66, 0.88);
  --bg-glass: rgba(13, 23, 40, 0.65);
  
  --border-subtle: rgba(70, 120, 180, 0.2);
  --border-active: rgba(0, 210, 255, 0.6);
  --border-glow: 0 0 20px rgba(0, 210, 255, 0.25);

  --accent-cyan: #00d2ff;
  --accent-blue: #0077ff;
  --accent-emerald: #00f5a0;
  --accent-crimson: #ff2a5f;
  --accent-amber: #ffaa00;
  --accent-purple: #a855f7;

  --text-main: #f0f6fc;
  --text-muted: #8b9bb4;
  --text-dim: #54657e;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark-900);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 210, 255, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(255, 42, 95, 0.05) 0%, transparent 40%),
    linear-gradient(180deg, #070b14 0%, #0a1120 100%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark-900);
}
::-webkit-scrollbar-thumb {
  background: rgba(70, 120, 180, 0.35);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Aviso de Protocolo Local file:// (CORS) */
.protocol-warning-banner {
  background: linear-gradient(90deg, rgba(234, 179, 8, 0.16), rgba(245, 158, 11, 0.1));
  border-bottom: 1px solid rgba(245, 158, 11, 0.45);
  padding: 10px 20px;
  font-size: 0.88rem;
  color: #fef08a;
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 99;
}

.protocol-warning-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.protocol-warning-text {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.5;
}

.protocol-warning-close {
  background: transparent;
  border: none;
  color: #fef08a;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.protocol-warning-close:hover {
  background: rgba(245, 158, 11, 0.25);
  color: #ffffff;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 11, 20, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 5px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.22), rgba(0, 119, 255, 0.42));
  border: 1px solid var(--border-active);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.25);
  animation: pulse-glow 3s infinite alternate ease-in-out;
  flex-shrink: 0;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 8px rgba(0, 210, 255, 0.2); }
  100% { box-shadow: 0 0 18px rgba(0, 210, 255, 0.45); }
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.35px;
  margin: 0;
  line-height: 1.1;
  background: linear-gradient(90deg, #ffffff, #a5d8ff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  font-size: 0.60rem;
  color: var(--text-muted);
  display: block;
  line-height: 1.1;
  margin-top: 1px;
}

/* Indicador de Status do Sistema em Tempo Real (Ponto Verde Néon Pulsante e Anel Radar Compacto) */
.system-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4.5px;
  background: rgba(0, 245, 160, 0.08);
  border: 1px solid rgba(0, 245, 160, 0.38);
  padding: 1.5px 6.5px;
  border-radius: var(--radius-full);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #00f5a0;
  text-transform: uppercase;
  user-select: none;
  box-shadow: 0 0 8px rgba(0, 245, 160, 0.15);
  transition: all 0.2s ease;
  flex-shrink: 0;
  line-height: 1.1;
  position: relative;
}

.system-live-badge:hover {
  background: rgba(0, 245, 160, 0.16);
  border-color: #00f5a0;
  box-shadow: 0 0 12px rgba(0, 245, 160, 0.35);
}

.live-pulse-dot {
  width: 6px;
  height: 6px;
  background-color: #00f5a0;
  border-radius: 50%;
  position: relative;
  display: inline-block;
  box-shadow: 0 0 6px #00f5a0, 0 0 10px rgba(0, 245, 160, 0.6);
  animation: live-dot-pulse 1.8s infinite cubic-bezier(0.4, 0, 0.6, 1);
  flex-shrink: 0;
}

.live-pulse-dot::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  border: 1.2px solid #00f5a0;
  opacity: 0.85;
  animation: live-ring-expand 1.8s infinite cubic-bezier(0.15, 0.8, 0.25, 1);
}

@keyframes live-dot-pulse {
  0%, 100% {
    transform: scale(0.92);
    opacity: 0.85;
    box-shadow: 0 0 4px #00f5a0;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
    box-shadow: 0 0 10px #00f5a0, 0 0 14px rgba(0, 245, 160, 0.7);
  }
}

@keyframes live-ring-expand {
  0% {
    transform: scale(0.7);
    opacity: 0.95;
  }
  65% {
    transform: scale(2.4);
    opacity: 0.2;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

.live-status-text {
  font-family: var(--font-mono, monospace);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #00f5a0;
}

/* Nav Tabs Compactas em Linha Única Horizontal */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(16, 28, 48, 0.72);
  padding: 2.5px 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  flex-shrink: 1;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  padding: 3.5px 7px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.71rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
  letter-spacing: -0.15px;
}

.nav-tab span {
  font-size: 0.75rem;
  line-height: 1;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.nav-tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(0, 140, 255, 0.85), rgba(0, 210, 255, 0.85));
  box-shadow: 0 2px 10px rgba(0, 150, 255, 0.35);
  font-weight: 600;
}

.nav-badge {
  font-size: 0.52rem;
  background: rgba(0, 245, 160, 0.2);
  color: var(--accent-emerald);
  padding: 1px 4px;
  border-radius: var(--radius-full);
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* Modificadores de Abas Externas com Identidade Visual Própria */
.nav-tab-station {
  color: #c084fc !important;
  background: rgba(168, 85, 247, 0.1) !important;
  border-color: rgba(168, 85, 247, 0.35) !important;
  text-decoration: none;
}
.nav-tab-station:hover {
  background: rgba(168, 85, 247, 0.2) !important;
  border-color: rgba(168, 85, 247, 0.55) !important;
  color: #ffffff !important;
}

.nav-tab-manual {
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.1) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  text-decoration: none;
}
.nav-tab-manual:hover {
  background: rgba(56, 189, 248, 0.2) !important;
  border-color: rgba(56, 189, 248, 0.55) !important;
  color: #ffffff !important;
}

.nav-tab-guide {
  color: #00f5a0 !important;
  background: rgba(0, 245, 160, 0.1) !important;
  border-color: rgba(0, 245, 160, 0.35) !important;
  text-decoration: none;
}
.nav-tab-guide:hover {
  background: rgba(0, 245, 160, 0.2) !important;
  border-color: rgba(0, 245, 160, 0.55) !important;
  color: #ffffff !important;
}

/* Micro-Guias Contextuais de Utilização Rápida */
.section-micro-guide {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(16, 28, 48, 0.65), rgba(7, 11, 20, 0.8));
  border: 1px solid rgba(0, 210, 255, 0.2);
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  margin-bottom: 18px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.micro-guide-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(0, 210, 255, 0.12);
  border: 1px solid rgba(0, 210, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.micro-guide-body {
  flex: 1;
  min-width: 0;
}

.micro-guide-badge {
  display: inline-block;
  font-family: var(--font-mono, monospace);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.micro-guide-text {
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

.micro-guide-text strong {
  color: #ffffff;
  font-weight: 600;
}

/* Micro-Guias Diretos & Compactos (Sub-Secções e Componentes Chave) */
.sub-micro-guide {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: linear-gradient(135deg, rgba(13, 23, 40, 0.7), rgba(9, 15, 26, 0.85));
  border: 1px solid rgba(70, 120, 180, 0.25);
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  margin: 10px 0 14px 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.42;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.sub-micro-guide-icon {
  font-size: 14px;
  line-height: 1.2;
  flex-shrink: 0;
  margin-top: 1px;
}

.sub-micro-guide-content {
  flex: 1;
  min-width: 0;
}

.sub-micro-guide-title {
  display: block;
  font-family: var(--font-mono, monospace);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.sub-micro-guide p {
  margin: 0;
}

.sub-micro-guide strong {
  color: #ffffff;
  font-weight: 600;
}

/* ==========================================================================
   Main Layout & Container
   ========================================================================== */

.main-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section Header */
.section-header {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
  max-width: 800px;
}

/* ==========================================================================
   Explorer Tab: 2D & Systems Grid
   ========================================================================== */

.explorer-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
}

.card-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.interactive-body-wrapper {
  background: linear-gradient(180deg, rgba(8, 18, 34, 0.7), rgba(12, 26, 48, 0.9));
  border: 1px solid rgba(0, 210, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.body-svg-container {
  width: 100%;
  max-width: 250px;
  height: 420px;
}

.body-svg-container svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 12px rgba(0, 210, 255, 0.25));
}

.body-part {
  fill: rgba(0, 140, 220, 0.25);
  stroke: var(--accent-cyan);
  stroke-width: 1.5;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.body-part:hover {
  fill: rgba(0, 210, 255, 0.6);
  filter: drop-shadow(0 0 8px rgba(0, 210, 255, 0.8));
}

.body-part.active {
  fill: rgba(0, 245, 160, 0.65);
  stroke: var(--accent-emerald);
  stroke-width: 2.2;
  filter: drop-shadow(0 0 12px rgba(0, 245, 160, 0.9));
}

/* Filter Chips */
.filter-group {
  margin-top: 18px;
}

.filter-group h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: rgba(16, 28, 48, 0.5);
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-btn:hover {
  border-color: rgba(0, 210, 255, 0.4);
  color: var(--text-main);
  background: rgba(0, 210, 255, 0.1);
}

.chip-btn.active {
  background: linear-gradient(135deg, rgba(0, 180, 255, 0.25), rgba(0, 100, 220, 0.45));
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

/* Search Bar */
.search-box {
  position: relative;
  margin-bottom: 20px;
}

.search-input {
  width: 100%;
  padding: 14px 18px 14px 46px;
  background: rgba(11, 19, 34, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.96rem;
  transition: var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 18px rgba(0, 210, 255, 0.25);
  background: rgba(14, 25, 46, 0.95);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--text-dim);
  pointer-events: none;
}

/* Organs Grid Cards */
.results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.organs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.organ-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  cursor: pointer;
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.organ-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-color, var(--accent-cyan));
  opacity: 0.7;
  transition: var(--transition-fast);
}

.organ-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(0, 210, 255, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.organ-card:hover::before {
  opacity: 1;
  height: 4px;
}

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

.organ-title-wrap h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
}

.organ-latin {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

.system-tag {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--card-color, var(--accent-cyan));
  font-weight: 600;
}

.organ-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.organ-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
  font-size: 0.78rem;
}

.tag-region {
  color: var(--text-dim);
}

.btn-open-detail {
  color: var(--accent-cyan);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   Organ Modal / Detail Panel
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.modal-dialog {
  background: var(--bg-dark-800);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), var(--border-glow);
  animation: modalEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: sticky;
  top: 0;
  background: var(--bg-dark-800);
  z-index: 2;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(255, 42, 95, 0.2);
  color: var(--accent-crimson);
  border-color: var(--accent-crimson);
}

.modal-body {
  padding: 24px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.detail-box {
  background: rgba(16, 28, 48, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.detail-box h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-cyan);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-box p {
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.55;
}

.image-preview-box {
  grid-column: span 2;
  background: #000;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-preview-box img {
  max-width: 100%;
  max-height: 320px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.slice-meta {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   Simulation Tab: Dynamic Homeostasis
   ========================================================================== */

.sim-container {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
}

.scenario-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scenario-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 14px;
}

.scenario-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 210, 255, 0.4);
}

.scenario-card.active {
  background: linear-gradient(135deg, rgba(0, 119, 255, 0.25), rgba(0, 210, 255, 0.15));
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.25);
}

.scenario-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
}

.scenario-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.scenario-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Vital Monitors */
.vitals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.vital-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.vital-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--vital-color, var(--accent-cyan));
}

.vital-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.vital-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 6px 0;
}

.vital-val {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 700;
  color: #ffffff;
}

.vital-unit {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.vital-status {
  font-size: 0.76rem;
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ECG Canvas Monitor */
.ecg-monitor-box {
  background: #03070e;
  border: 1px solid rgba(0, 245, 160, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  position: relative;
  box-shadow: inset 0 0 25px rgba(0, 245, 160, 0.05);
}

.ecg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-emerald);
}

.ecg-canvas {
  width: 100%;
  height: 90px;
  display: block;
}

/* Organ Live Responses in Sim */
.organ-responses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.sim-organ-card {
  background: rgba(14, 25, 46, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.sim-organ-card h4 {
  font-size: 0.92rem;
  color: #ffffff;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sim-organ-card p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   3D View Tab
   ========================================================================== */

.viewer-3d-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  height: calc(100vh - 180px);
  min-height: 600px;
}

.canvas-3d-container {
  background: radial-gradient(circle at center, #0e1b2f 0%, #050913 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

#threeCanvas {
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

.overlay-controls {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.control-btn {
  background: rgba(11, 20, 36, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition-fast);
  backdrop-filter: blur(8px);
}

.control-btn:hover {
  background: rgba(0, 210, 255, 0.2);
  border-color: var(--accent-cyan);
}

.control-btn.active {
  background: var(--accent-cyan);
  color: #050a14;
  font-weight: 600;
  border-color: var(--accent-cyan);
}

.sidebar-3d-controls {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.layer-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(16, 28, 48, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
}

.layer-toggle:hover {
  border-color: rgba(0, 210, 255, 0.3);
}

.layer-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 500;
}

/* Switch toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--accent-cyan);
}
input:checked + .slider:before {
  transform: translateX(18px);
}

/* ==========================================================================
   Visible Human Imaging Explorer Tab
   ========================================================================== */

.imaging-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

.imaging-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 680px;
  overflow-y: auto;
  padding-right: 6px;
}

.slice-item-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.slice-item-btn:hover {
  border-color: rgba(0, 210, 255, 0.4);
  background: var(--bg-card-hover);
}

.slice-item-btn.active {
  border-color: var(--accent-cyan);
  background: linear-gradient(135deg, rgba(0, 119, 255, 0.25), rgba(0, 210, 255, 0.15));
  box-shadow: 0 0 14px rgba(0, 210, 255, 0.2);
}

.slice-thumb {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  background: #000;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.slice-info h4 {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}

.slice-info span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.imaging-view-panel {
  background: #000000;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.imaging-mode-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.imaging-main-display {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

.slice-description-bar {
  margin-top: 16px;
  width: 100%;
  background: rgba(16, 28, 48, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

/* ==========================================================================
   AI / Cognitive QA Tab
   ========================================================================== */

.qa-container {
  max-width: 900px;
  margin: 0 auto;
}

.qa-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
  transition: var(--transition-fast);
}

.qa-card:hover {
  border-color: rgba(0, 210, 255, 0.3);
}

.qa-question {
  padding: 18px 22px;
  font-weight: 600;
  font-size: 1.05rem;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: rgba(16, 28, 48, 0.4);
}

.qa-question:hover {
  background: rgba(0, 210, 255, 0.05);
}

.qa-answer {
  padding: 20px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-main);
  background: rgba(11, 20, 36, 0.4);
}

.involved-tags {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

/* Prompt Ask Box */
.ask-box-panel {
  background: linear-gradient(135deg, rgba(16, 28, 48, 0.85), rgba(9, 18, 34, 0.95));
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: 0 0 25px rgba(0, 210, 255, 0.15);
}

.ask-input-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.ask-input {
  flex: 1;
  padding: 14px 18px;
  background: rgba(6, 11, 20, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.95rem;
}

.ask-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.ask-submit-btn {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  color: #040810;
  font-weight: 700;
  padding: 0 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.ask-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 210, 255, 0.4);
}

/* ==========================================================================
   Footer & Responsive
   ========================================================================== */

.app-footer {
  border-top: 1px solid rgba(0, 210, 255, 0.2);
  background: linear-gradient(180deg, rgba(7, 11, 20, 0.8) 0%, rgba(5, 8, 17, 0.98) 100%);
  padding: 40px 24px 30px;
  margin-top: 60px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 16px;
}

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

.cylinder-seal {
  background: linear-gradient(135deg, #00d2ff, #0284c7);
  color: #050811;
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 1.2px;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.35);
}

.footer-event-badge {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-disclaimer-box {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 4px solid var(--accent-amber);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  text-align: left;
  line-height: 1.6;
}

.footer-disclaimer-title {
  color: #fbbf24;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-disclaimer-text {
  color: #cbd5e1;
  font-size: 0.84rem;
  margin: 0;
}

.footer-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.78rem;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 14px;
}

.footer-credits-list {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-credits-list span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 1024px) {
  .explorer-grid, .sim-container, .imaging-layout, .viewer-3d-layout {
    grid-template-columns: 1fr;
  }
  .viewer-3d-layout {
    height: auto;
  }
  .canvas-3d-container {
    height: 480px;
  }
}

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
  }
  .nav-tabs {
    overflow-x: auto;
    padding-bottom: 6px;
  }
  .nav-tab {
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .image-preview-box {
    grid-column: span 1;
  }
}
