:root {
  --primary-color: #00E676; /* Tech Mint */
  --secondary-color: #00B0FF; /* Ice Blue */
  --accent-color: #F4FF81; /* Lemon Yellow */
  
  --dark-bg: rgba(10, 15, 35, 0.85); /* Deep Navy */
  --darker-bg: rgba(5, 8, 20, 0.95);
  --panel-border: rgba(0, 230, 118, 0.25);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Noto Sans KR', sans-serif;
}

body {
  margin: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #020617; /* Very dark background */
}

#map-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  background-color: #0f172a;
}

.maplibregl-canvas, .mapboxgl-canvas {
  opacity: 0.8 !important;
}

.dark-glass-panel {
  position: absolute;
  right: 20px;
  width: 420px;
  max-height: 95vh;
  overflow-y: auto;
  background: var(--dark-bg);
  /* 블루프린트 격자 배경 */
  background-image: 
    linear-gradient(rgba(0, 230, 118, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 230, 118, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0;
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 15px rgba(0, 230, 118, 0.05);
  display: flex;
  flex-direction: column;
}

/* 스크롤바 디자인 - 날렵한 테크 민트 */
.dark-glass-panel::-webkit-scrollbar {
  width: 4px;
}
.dark-glass-panel::-webkit-scrollbar-track {
  background: transparent;
}
.dark-glass-panel::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

header {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--panel-border);
  padding: 24px 24px 15px 24px;
}

header h1 {
  font-size: 1.4rem;
  font-weight: 900;
  color: transparent;
  background: linear-gradient(90deg, #00d2ff, #3a7bd5);
  -webkit-background-clip: text;
  background-clip: text;
  margin-bottom: 4px;
}

header p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Camera & Compass Controls */
.camera-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 0 24px 25px 24px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.compass-wrapper {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
}

.compass {
  width: 100%;
  height: 100%;
  position: absolute;
  transition: transform 0.1s ease-out;
}

.compass-needle {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; 
  height: 0; 
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 16px solid #ff007f; /* Red/Pink needle pointing North */
}

.compass-n {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: bold;
  color: #fff;
}

.camera-btns {
  display: flex;
  flex: 1;
  gap: 6px;
}

.camera-btns button {
  flex: 1;
  padding: 8px 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.camera-btns button:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.camera-btns button.active {
  background: rgba(0, 210, 255, 0.2);
  border-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

/* Pledge List (Cards) */
.pledge-list-container h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 24px 15px 24px;
  color: var(--text-main);
  text-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

.pledge-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 24px 25px 24px;
}

.pledge-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pledge-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 210, 255, 0.5);
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 8px 15px rgba(0, 210, 255, 0.15);
}

.pledge-card.active {
  background: linear-gradient(145deg, rgba(0, 210, 255, 0.1), rgba(0, 0, 0, 0));
  border-color: var(--primary-color);
  box-shadow: 0 0 20px rgba(0, 210, 255, 0.25), inset 0 0 10px rgba(0, 210, 255, 0.1);
}

.pledge-card-header {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-icon {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.pledge-card.active .accordion-icon {
  transform: rotate(180deg);
  color: var(--primary-color);
}

.pledge-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.pledge-card.active .pledge-card-title {
  color: var(--primary-color);
  text-shadow: 0 0 8px rgba(0, 210, 255, 0.5);
}

.pledge-card-body {
  max-height: 0;
  overflow: hidden;
  padding: 0 20px;
  transition: max-height 0.5s cubic-bezier(0, 1, 0, 1), padding 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}

.pledge-card.active .pledge-card-body {
  max-height: 1000px;
  padding: 0 20px 18px 20px;
  opacity: 1;
  transition: max-height 1s ease-in-out, padding 0.4s ease, opacity 0.4s ease;
}

.pledge-card-desc {
  font-size: 0.95rem;
  color: #e2e8f0;
  line-height: 1.6;
  margin-bottom: 18px;
  word-break: keep-all;
}

/* Custom Audio Player */
.custom-audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.audio-play-btn {
  background: var(--primary-color);
  color: #000;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.audio-seek-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 0 10px var(--primary-color);
  transition: transform 0.2s;
}

.audio-play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px var(--primary-color);
}

.audio-progress-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.audio-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.audio-progress-fill {
  width: 0%;
  height: 100%;
  background: var(--primary-color);
  border-radius: 2px;
}

.audio-time {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 80px;
  text-align: right;
  font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
}

/* Script Panel */
.script-toggle-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
}

.script-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.audio-script-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, margin-top 0.4s ease;
}

.audio-script-panel.open {
  max-height: 150px;
  margin-top: 10px;
}

.audio-script-content {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.6;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  border-left: 3px solid var(--primary-color);
  max-height: 140px;
  overflow-y: auto;
}

.audio-script-content::-webkit-scrollbar {
  width: 4px;
}
.audio-script-content::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 2px;
}

/* Legends */
.dark-legend {
  padding: 15px;
  background: var(--dark-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}

.dark-legend h3 {
  font-size: 0.9rem;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.gradient-bar {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, rgba(50,50,60,0.5), rgba(0,255,255,1));
  margin-bottom: 8px;
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.bottom-left-panel {
  position: absolute;
  bottom: 30px;
  left: 30px;
  width: 320px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 15px;
  transition: all 0.3s ease;
  opacity: 1;
}

.bottom-left-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

.graphic-legend {
  padding: 15px;
  background: var(--dark-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  font-size: 0.85rem;
  color: #fff;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}

.graphic-legend h3 {
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 6px;
}

#graphic-legend-content {
  font-size: 0.85rem;
  color: #cbd5e0;
  line-height: 1.6;
}

/* Tooltip */
.tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  z-index: 20;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 210, 255, 0.3);
  transform: translate(-50%, -100%);
  margin-top: -10px;
  transition: opacity 0.2s ease;
}

.tooltip.hidden {
  opacity: 0;
}

.tooltip-title {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
}

.tooltip-score {
  font-size: 14px;
  margin-top: 5px;
  font-weight: 700;
  font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
  color: var(--primary-color);
}

.tooltip-detail {
  color: var(--text-muted);
}

/* Global Hidden */
.hidden {
  display: none !important;
}

/* ── Cinematic Video Overlay ── */
#cinematic-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

#cinematic-overlay.active {
  opacity: 1;
  pointer-events: all;
  animation: lensFlare 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes lensFlare {
  0% { box-shadow: inset 0 0 0 0 rgba(255, 255, 255, 0); background: rgba(255,255,255,1); opacity: 0; }
  20% { opacity: 1; background: rgba(255,255,255,0.9); box-shadow: inset 0 0 100px 50px rgba(0, 210, 255, 0.5); }
  100% { background: rgba(0, 0, 0, 0.85); box-shadow: inset 0 0 0 0 rgba(0, 210, 255, 0); }
}

.overlay-content {
  position: relative;
  width: 80%;
  max-width: 1200px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 210, 255, 0.3);
  border: 1px solid rgba(0, 210, 255, 0.3);
}

#cinematic-close {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

#cinematic-close:hover {
  background: var(--primary-color);
  color: #000;
  transform: rotate(90deg);
}

#cinematic-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#cinematic-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, #0f172a 0%, #020617 100%);
}

.cyber-pulse-text {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.6;
  text-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color);
  animation: cyberPulse 2s infinite alternate;
}

#cinematic-pledge-name {
  color: var(--primary-color);
  font-size: 2.2rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

@keyframes cyberPulse {
  0% { opacity: 0.6; text-shadow: 0 0 5px var(--primary-color); transform: scale(0.98); }
  100% { opacity: 1; text-shadow: 0 0 25px var(--primary-color), 0 0 40px var(--accent-color); transform: scale(1.02); }
}
