/* Material Symbols config */
.material-symbols-outlined {
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
  font-size: 24px;
  line-height: 1;
  vertical-align: middle;
}

.material-symbols-outlined.filled {
  font-variation-settings:
    'FILL' 1,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
}

/* Glassmorphism panel */
.glass-panel {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Hotspot pulse animation */
.hotspot-ping {
  position: relative;
}

.hotspot-ping::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  animation: hotspot-pulse 2s ease-out infinite;
}

@keyframes hotspot-pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

/* Hotspot panel slide-in */
.hotspot-panel {
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1),
              opacity 0.2s ease;
}

.hotspot-panel.open {
  transform: translateY(0);
  opacity: 1;
}

/* Quiz explanation slide-down */
.quiz-explanation {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.2, 0, 0, 1),
              opacity 0.25s ease;
}

.quiz-explanation.show {
  max-height: 300px;
  opacity: 1;
}

/* Page fade transition */
.page-entering {
  opacity: 0;
  transform: translateY(4px);
}

.page-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Radial progress SVG butt cap */
.progress-track {
  stroke-linecap: butt;
}

/* Print stylesheet */
@media print {
  #top-bar,
  #bottom-nav {
    display: none !important;
  }

  #app {
    padding-bottom: 0 !important;
    overflow: visible !important;
  }

  .glass-panel {
    background: white !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid #ccc !important;
  }

  body {
    background: white !important;
  }
}

/* === Chart-Centric Lesson Layout === */

.chart-lesson-body {
  display: flex;
  gap: 1.5rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 768px) {
  .chart-lesson-body {
    flex-direction: column;
  }
}

.chart-canvas-wrap {
  flex: 1 1 65%;
  min-width: 0;
}

.feature-sidebar {
  flex: 0 0 30%;
  min-width: 280px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  position: sticky;
  top: 80px;
}

@media (max-width: 768px) {
  .feature-sidebar {
    flex: none;
    width: 100%;
    min-width: unset;
    max-height: none;
    position: static;
  }
}

/* Marker buttons on chart */
.marker-btn {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #a52c7d;
  border: 2.5px solid #fbf8fb;
  color: white;
  font-family: 'Public Sans', sans-serif;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.marker-btn:hover {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.marker-btn.active {
  background: #003e66;
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 0 0 4px rgba(0,62,102,0.3), 0 4px 16px rgba(0,0,0,0.3);
}

.marker-btn.explored {
  background: #004349;
  border-color: #75d5e2;
}

.marker-btn .marker-number {
  line-height: 1;
}

/* SVG highlight pulse */
.highlight-active {
  animation: highlight-pulse 2s ease-in-out infinite;
}

@keyframes highlight-pulse {
  0%, 100% { stroke-opacity: 1; }
  50% { stroke-opacity: 0.5; }
}

/* Feature sidebar items */
.feature-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s ease;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  font-family: 'Inter', sans-serif;
}

.feature-item:hover {
  background: #f0edef;
}

.feature-item.active {
  background: #cfe5ff;
}

.feature-item.explored {
  color: #004349;
}

.feature-item-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e4e2e4;
  color: #41474f;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-item.active .feature-item-number {
  background: #003e66;
  color: white;
}

.feature-item.explored .feature-item-number {
  background: #004349;
  color: #75d5e2;
}

/* Feature detail panel */
.feature-detail-panel {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-top: 1rem;
}

/* Reveal answer animation */
.feature-answer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s cubic-bezier(0.2, 0, 0, 1),
              opacity 0.25s ease;
}

.feature-answer.revealed {
  max-height: 600px;
  opacity: 1;
}

/* Reveal button */
.reveal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #003e66;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: opacity 0.15s ease;
  margin-top: 1rem;
}

.reveal-btn:hover {
  opacity: 0.9;
}

.reveal-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* === Leaflet map overrides === */
#chart-map {
  background: #eae7ea;
}

#chart-map .leaflet-control-attribution {
  font-size: 9px;
  opacity: 0.7;
}

/* Numbered marker on Leaflet map */
.leaflet-marker-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #a52c7d;
  border: 2.5px solid #fbf8fb;
  color: white;
  font-family: 'Public Sans', sans-serif;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.leaflet-marker-btn:hover {
  transform: scale(1.15);
}

.leaflet-marker-btn.active {
  background: #003e66;
  transform: scale(1.2);
  box-shadow: 0 0 0 4px rgba(0,62,102,0.3), 0 4px 16px rgba(0,0,0,0.3);
}

.leaflet-marker-btn.explored {
  background: #004349;
  border-color: #75d5e2;
}
