/* Web 1.0 Retro Terminal Aesthetic */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #000;
  color: #00ff41;
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 18px;
  min-height: 100vh;
  overflow-x: hidden;
}

.terminal,
.loading-screen {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Loading Screen (fades out before Hello World) */
.loading-screen {
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.faded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Main Grid Layout */
.main-grid {
  border: 1px solid #00ff41;
  padding: 0;
}

.grid-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #00ff41;
  padding: 8px 12px;
  background: rgba(0, 255, 65, 0.05);
}

.grid-body {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  min-height: 400px;
}

.left-panel,
.center-panel,
.right-panel {
  border-right: 1px solid #00ff41;
  padding: 12px;
}

.right-panel {
  border-right: none;
}

.panel-section {
  margin-bottom: 16px;
}

.panel-section div {
  margin-bottom: 2px;
}

.panel-title {
  margin-bottom: 8px;
  font-weight: bold;
}

.file-list div {
  margin-bottom: 2px;
}

.highlight {
  background: rgba(0, 255, 65, 0.3);
  padding: 2px 4px;
}

/* Loading Bars (TR-100 style) */
.load-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.load-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.load-bar-row.load-bar-only {
  margin-left: 0;
  padding-left: 0;
}

.load-label {
  min-width: 140px;
}

.load-value {
  font-size: 14px;
  color: rgba(0, 255, 65, 0.9);
}

.load-bar {
  flex: 1;
  min-width: 120px;
  height: 14px;
  background: transparent;
  border: 1px solid #00ff41;
  display: flex;
  overflow: hidden;
}

.load-bar-fill {
  height: 100%;
  width: 0;
  background: #00ff41;
  transition: width 0.8s ease-out;
  flex-shrink: 0;
}

.load-bar-dots {
  flex: 1;
  height: 100%;
  background-image: radial-gradient(
    circle at center,
    rgba(0, 255, 65, 0.7) 1px,
    transparent 1px
  );
  background-size: 3px 3px;
}

.footer {
  border-top: 1px solid #00ff41;
  padding: 8px 12px;
  font-size: 14px;
  background: rgba(0, 255, 65, 0.05);
}

/* Hidden state for loading sequence */
.hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.visible {
  opacity: 1;
  visibility: visible;
}

/* Globe container */
.globe-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: #080808;
  opacity: 1;
  transition: opacity 0.8s ease;
  overflow: hidden;
}

/* Inner MapLibre mount point — fills the fixed container */
#map-canvas {
  width: 100%;
  height: 100%;
}

/* Desaturate the map canvas to match Polyglobe's grayscale palette.
   HTML Marker elements (user dot) live outside the canvas so they stay green. */
.maplibregl-canvas {
  filter: grayscale(1) brightness(0.78) contrast(1.05);
}

/* ── User location marker ── */
.user-marker {
  width: 10px;
  height: 10px;
  background: #00ff41;
  border: 1px solid #000;
  border-radius: 50%;
  box-shadow: 0 0 6px #00ff41;
  position: relative;
}

/* Oscillating ring — breathes in and out, matching the original rAF animation
   that cycled the circle-radius between 8 and 18 px */
.user-marker::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  /* 36px box: scale(0.44) ≈ 16px diameter, scale(1) = 36px diameter */
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(0, 255, 65, 0.55);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.44);
  animation: user-ring-breathe 1.5s ease-in-out infinite alternate;
}

@keyframes user-ring-breathe {
  from { transform: translate(-50%, -50%) scale(0.44); }
  to   { transform: translate(-50%, -50%) scale(1);    }
}

.globe-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Globe Nav */
.globe-nav {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  display: flex;
  gap: 16px;
  opacity: 1;
  transition: opacity 0.8s ease;
}

.globe-nav.globe-hidden {
  opacity: 0;
  pointer-events: none;
}

.globe-nav-link {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 22px;
  color: #00ff41;
  text-decoration: none;
  border: 1px solid #00ff41;
  padding: 8px 24px;
  background: rgba(0,0,0,0.7);
  letter-spacing: 0.15em;
  text-shadow: 0 0 8px #00ff41;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.globe-nav-link:hover {
  background: #00ff41;
  color: #000;
  box-shadow: 0 0 20px #00ff41, 0 0 40px rgba(0,255,65,0.4);
}

.nav-arrow {
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Responsive */
@media (max-width: 768px) {
  .grid-body {
    grid-template-columns: 1fr;
  }

  .left-panel,
  .center-panel {
    border-right: none;
    border-bottom: 1px solid #00ff41;
  }

  .grid-header {
    grid-template-columns: 1fr;
  }

  .globe-container {
    width: 100vw;
    height: 100vh;
  }
}
