/* Learn page — 3D PCD visualizer styling */
:root {
  --learn-bg: #0a0e1a;
  --learn-fg: #f0f3ff;
  --learn-muted: #8a92a8;
  --learn-accent: #4ecdc4;
  --learn-healthy: #6ce06c;
  --learn-pcd: #ffa94d;
  --learn-warn: #ff6b6b;
  --learn-panel: rgba(20, 26, 42, 0.92);
  --learn-border: rgba(255, 255, 255, 0.08);
}

.learn-body {
  margin: 0;
  background: var(--learn-bg);
  color: var(--learn-fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

#learn-app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* TOP BAR */
.learn-topbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  padding-top: env(safe-area-inset-top);
  height: calc(52px + env(safe-area-inset-top));
  background: linear-gradient(180deg, #14182b 0%, #0a0e1a 100%);
  border-bottom: 1px solid var(--learn-border);
  z-index: 100;
}
.learn-topbar a, .learn-topbar button {
  background: none;
  border: none;
  color: var(--learn-fg);
  font-size: 22px;
  text-decoration: none;
  cursor: pointer;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.learn-topbar h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.02em;
}
.learn-topbar .subtitle {
  font-size: 11px;
  color: var(--learn-muted);
  font-weight: 400;
}

/* 3D CANVAS AREA */
.learn-canvas-wrap {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  min-height: 0;
}
.learn-canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}

/* SCENE TITLE OVERLAY */
.learn-scene-title {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 10;
  pointer-events: none;
}
.learn-scene-title h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.learn-scene-title .scene-sub {
  font-size: 12px;
  color: var(--learn-muted);
  margin-top: 2px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* HEALTHY / PCD TOGGLE */
.learn-toggle {
  position: absolute;
  top: 60px;
  left: 12px;
  right: 12px;
  display: flex;
  z-index: 10;
  background: var(--learn-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--learn-border);
  border-radius: 10px;
  padding: 3px;
  max-width: 320px;
  margin: 0 auto;
}
.learn-toggle button {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--learn-muted);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.learn-toggle button.active.healthy {
  background: var(--learn-healthy);
  color: #0a0e1a;
}
.learn-toggle button.active.pcd {
  background: var(--learn-pcd);
  color: #0a0e1a;
}

/* INFO PANEL (bottom drawer) */
.learn-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--learn-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--learn-border);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  max-height: 45%;
  overflow-y: auto;
  z-index: 20;
  transform: translateY(calc(100% - 44px));
  transition: transform 0.25s ease;
}
.learn-info.expanded {
  transform: translateY(0);
}
.learn-info .info-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  margin-bottom: 8px;
}
.learn-info .info-handle::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
}
.learn-info .info-handle h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  padding-top: 6px;
}
.learn-info .info-handle .chevron {
  color: var(--learn-muted);
  font-size: 16px;
  padding-top: 6px;
}
.learn-info .info-body {
  font-size: 14px;
  line-height: 1.45;
}
.learn-info .info-body p { margin: 0 0 10px; }
.learn-info .info-body strong { color: var(--learn-accent); }
.learn-info .info-body .src {
  font-size: 11px;
  color: var(--learn-muted);
  font-style: italic;
  margin-top: 10px;
}

/* SCENE NAV (bottom row) */
.learn-nav {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  padding: 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  background: #0a0e1a;
  border-top: 1px solid var(--learn-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 50;
}
.learn-nav button {
  flex: 0 0 auto;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--learn-border);
  color: var(--learn-muted);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.learn-nav button.active {
  background: var(--learn-accent);
  border-color: var(--learn-accent);
  color: #0a0e1a;
}

/* LOADING */
.learn-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--learn-bg);
  z-index: 200;
  color: var(--learn-muted);
  font-size: 13px;
}
.learn-loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--learn-accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* TOOLTIP / HOTSPOT */
.learn-tip {
  position: absolute;
  background: var(--learn-panel);
  border: 1px solid var(--learn-border);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
  z-index: 30;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* HINT */
.learn-hint {
  position: absolute;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  padding: 6px 12px;
  border-radius: 14px;
  font-size: 11px;
  color: var(--learn-muted);
  pointer-events: none;
  z-index: 5;
}
