/* ==========================================================================
   GLOBAL DEMOGRAPHIC TRANSITION DASHBOARD — JUPITER HEAVY SPACE
   ========================================================================== */

/* Starfield & Scanline Background Effects */
#map-starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #0e172a 0%, #030712 85%);
  z-index: -2;
}

#map-scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%);
  background-size: 100% 4px;
  z-index: 1000;
  pointer-events: none;
}

/* Custom Styled Range Slider */
input[type=range] {
  -webkit-appearance: none;
  background: transparent;
}

input[type=range]:focus {
  outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: #1e293b;
  border-radius: 3px;
  border: 1px solid rgba(235, 175, 55, 0.3);
}

input[type=range]::-webkit-slider-thumb {
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: #ebaf37;
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -6px;
  box-shadow: 0 0 10px rgba(235, 175, 55, 0.8);
  transition: transform 0.15s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  background: #00f2ff;
  box-shadow: 0 0 14px rgba(0, 242, 255, 0.9);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
  background: rgba(235, 175, 55, 0.35);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(235, 175, 55, 0.7);
}

/* Map Country Vector Hover & Transition */
.country-path {
  transition: fill 0.3s ease, stroke 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
}

.country-path:hover {
  stroke: #00f2ff !important;
  stroke-width: 1.8px !important;
  filter: drop-shadow(0 0 6px rgba(0, 242, 255, 0.8));
  opacity: 0.95;
}

/* Demographic Stage Badges & Color Tokens */
.stage-badge {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
}

.stage-early-aging {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.4);
}

.stage-peak-retirement {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4);
}

.stage-peak-wealth-transfer {
  background: rgba(234, 179, 8, 0.18);
  color: #fde047;
  border-color: rgba(234, 179, 8, 0.4);
}

.stage-housing-transition {
  background: rgba(249, 115, 22, 0.18);
  color: #fb923c;
  border-color: rgba(249, 115, 22, 0.4);
}

.stage-labor-shortage {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.stage-population-decline {
  background: rgba(190, 18, 60, 0.22);
  color: #fda4af;
  border-color: rgba(225, 29, 72, 0.5);
}

.stage-post-boomer {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

/* Light Mode Overrides */
body.light-mode {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

body.light-mode #map-starfield {
  background: radial-gradient(circle at center, #e2e8f0 0%, #cbd5e1 85%) !important;
}

body.light-mode #map-scanlines {
  display: none !important;
}

body.light-mode header,
body.light-mode #timeline-bar,
body.light-mode .bg-jhsDark\/95,
body.light-mode .bg-jhsPanel {
  background-color: rgba(255, 255, 255, 0.96) !important;
  border-color: rgba(203, 213, 225, 0.8) !important;
  color: #0f172a !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
}

body.light-mode thead {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

body.light-mode thead th {
  color: #b45309 !important;
}

body.light-mode tbody {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

body.light-mode tr {
  border-bottom-color: #e2e8f0 !important;
}

body.light-mode input,
body.light-mode select {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

body.light-mode .text-jhsGold {
  color: #b45309 !important;
  text-shadow: none !important;
}

body.light-mode .text-jhsCyan {
  color: #0284c7 !important;
  text-shadow: none !important;
}

body.light-mode .text-white {
  color: #0f172a !important;
}

body.light-mode .text-slate-100,
body.light-mode .text-slate-200,
body.light-mode .text-slate-300 {
  color: #1e293b !important;
}

body.light-mode .text-slate-400,
body.light-mode .text-slate-500 {
  color: #475569 !important;
}

body.light-mode #country-modal > div,
body.light-mode .bg-slate-900,
body.light-mode .bg-slate-950 {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
