/* Modern Light Theme Styles for Hydraulic Press & Pascal Simulation */

/* Critical utility styles for 100% offline & sandbox resilience */
.hidden {
  display: none !important;
}

/* Base layout & typography */
body {
  margin: 0;
  padding: 0;
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f1f5f9;
  color: #1e293b;
}

/* Smooth custom scrollbars for light mode */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Tab Navigation Styles */
.nav-tab {
  color: #64748b;
  background: transparent;
  white-space: nowrap;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
}
.nav-tab:hover {
  color: #0369a1;
  background: #f0f9ff;
}
.nav-tab.active {
  color: #0284c7 !important;
  background: #e0f2fe !important;
  border-color: #bae6fd !important;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.1) !important;
  font-weight: 700 !important;
}

/* Canvas styling */
#simCanvas {
  touch-action: none;
  width: 100%;
  height: 100%;
  min-height: 480px;
  display: block;
}

/* 2D Ear Anatomy Diagram & Pressure Simulation Styles */
.ear-3d-viewport {
  position: relative;
  width: 100%;
  height: 520px;
  min-height: 500px;
  user-select: none;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #eff2f5 0%, #e2e6eb 60%, #d5dae0 100%);
  border-radius: 1rem;
}

/* Top-Left HUD Controls */
.ear-hud-controls {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.ear-hud-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 12px;
  background: #ffffff;
  color: #1e293b;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.ear-hud-btn:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}
.ear-hud-btn.active {
  background: #0f4049 !important;
  color: #ffffff !important;
  border-color: rgba(45, 212, 191, 0.6) !important;
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.4) !important;
}

.ear-3d-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
  pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#ear3DModelContainer {
  position: relative;
  width: 520px;
  max-width: 65%;
  aspect-ratio: 738 / 715;
  pointer-events: none;
}

#earCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

#earCalloutsContainer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

/* Callout Badges (HUD) */
.ear-callout-badge {
  position: absolute;
  width: max-content;
  background: rgba(13, 37, 45, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  border-radius: 14px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  pointer-events: auto;
  color: #ffffff !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s, box-shadow 0.2s;
  user-select: none;
  z-index: 25;
}

.ear-callout-badge span {
  color: #ffffff;
}

.ear-callout-badge .badge-title {
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 12px !important;
}

.ear-callout-badge .badge-desc {
  color: #6ee7b7 !important;
  font-size: 10px !important;
  font-weight: 500 !important;
}

.ear-callout-badge:hover {
  transform: scale(1.06);
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.55);
}

.ear-callout-badge.active {
  background: rgba(15, 52, 64, 0.98) !important;
  border-color: #fbbf24 !important;
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.7) !important;
}

.ear-callout-badge.centered {
  transform: translateX(-50%);
}
.ear-callout-badge.centered:hover {
  transform: translateX(-50%) scale(1.06);
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.55);
}
.ear-callout-badge.centered.active {
  transform: translateX(-50%);
  border-color: #fbbf24 !important;
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.65) !important;
}

/* 2D Hotspot Pins: Clean, solid, numbered, non-obscuring */
.ear-3d-pin {
  position: absolute;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  border-radius: 9999px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  pointer-events: auto;
  z-index: 22;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s;
  user-select: none;
}

.ear-3d-pin:hover {
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 4px 14px rgba(0, 0, 0, 0.65);
  z-index: 24;
}

.ear-3d-pin.active {
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px #fbbf24, 0 5px 16px rgba(0, 0, 0, 0.7);
  z-index: 25;
}

/* Floating Information Card for Selected Ear Part */
.ear-popup-card {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 520px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(56, 189, 248, 0.6);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  color: #ffffff;
  z-index: 35;
  pointer-events: auto;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.ear-popup-card.hidden {
  display: none !important;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.2s ease-out forwards;
}

/* Print styling for practical lab report */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  header, #bannerCard, button, .no-print {
    display: none !important;
  }
  #panel-practice {
    display: block !important;
  }
  table {
    border-collapse: collapse !important;
    width: 100% !important;
  }
  th, td {
    border: 1px solid #cbd5e1 !important;
    color: black !important;
    padding: 6px !important;
  }
}
