/* ==========================================================================
   Camp Blue Ground — Weather Station & Radar Dashboard Stylesheet
   ========================================================================== */

:root {
  --carbon-dark:     #0c0c0c;
  --carbon-bg:       #121212;
  --carbon-card:     rgba(30, 30, 30, 0.65);
  --carbon-border:   rgba(255, 255, 255, 0.08);
  --carbon-border-hover: rgba(200, 168, 75, 0.3);
  --carbon-text:     #f5f5f5;
  --carbon-muted:    #a0aba0;
  
  --primary-accent:  #c8a84b;   /* Warm golden amber */
  --emerald:         #00e676;   /* Tactical translucent emerald */
  --crimson:         #ff1744;   /* Crimson boundary color */
  --indigo:          #3d5afe;   /* Gorman Road indigo */
  --warning-orange:  #ff9100;
  
  --font-body:       'PT Sans', sans-serif;
  --font-headline:   'Playfair Display', Georgia, serif;
  --font-mono:       'Unica One', monospace;
  --radius-lg:       1rem;
  --radius-md:       0.75rem;
  --radius-sm:       0.375rem;
  --shadow-lux:      0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --transition-fast: 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-smooth: 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Base resets & layout */
body.radar-page-body {
  font-family: var(--font-body);
  background-color: var(--carbon-bg);
  background-image: radial-gradient(circle at 50% 0%, #1c2a1c 0%, var(--carbon-bg) 75%);
  color: var(--carbon-text);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism utility */
.glass-panel {
  background: var(--carbon-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--carbon-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lux);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.glass-panel:hover {
  border-color: var(--carbon-border-hover);
}

/* Header styling */
.radar-header {
  height: 80px;
  border-bottom: 1px solid var(--carbon-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(12, 12, 12, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-brand-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-brand-block .back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--carbon-border);
  color: var(--carbon-text);
  transition: all var(--transition-fast);
}

.header-brand-block .back-link:hover {
  background: var(--primary-accent);
  color: var(--carbon-dark);
  border-color: transparent;
  transform: translateX(-3px);
}

.header-brand-block h1 {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.station-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(45, 90, 39, 0.25);
  border: 1px solid rgba(45, 90, 39, 0.4);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #81c784;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--emerald);
  border-radius: 50%;
  animation: radar-beam 1.8s infinite ease-in-out;
}

@keyframes radar-beam {
  0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.6); }
  70% { transform: scale(1.3); opacity: 0.5; box-shadow: 0 0 0 6px rgba(0, 230, 118, 0); }
  100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

/* Dashboard Layout Grid */
.dashboard-container {
  max-width: 1400px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.5rem;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 2rem;
  flex-grow: 1;
}

@media (max-width: 1100px) {
  .dashboard-container {
    grid-template-columns: 1fr;
  }
}

/* Left Column: Weather Station Metrics */
.metrics-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.metric-card {
  padding: 1.75rem;
}

.card-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary-accent);
  margin-top: 0;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--carbon-border);
  padding-bottom: 0.75rem;
}

.conditions-primary {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.weather-icon-large {
  font-size: 3.5rem;
  line-height: 1;
}

.temp-primary-block {
  display: flex;
  flex-direction: column;
}

.temp-value {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 400;
  line-height: 1;
  color: #fff;
}

.temp-feels-like {
  font-size: 0.85rem;
  color: var(--carbon-muted);
  margin-top: 0.25rem;
}

.conditions-desc {
  font-family: var(--font-headline);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.5rem;
}

/* Detail specs list */
.metrics-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.metric-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
}

.metric-item-icon {
  font-size: 1.5rem;
  opacity: 0.8;
  color: var(--primary-accent);
  flex-shrink: 0;
}

.metric-item-data {
  display: flex;
  flex-direction: column;
}

.metric-item-label {
  font-size: 0.75rem;
  color: var(--carbon-muted);
}

.metric-item-value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: #fff;
  margin-top: 0.1rem;
}

/* Ground mud index widget */
.mud-widget {
  padding: 1.5rem;
}

.mud-badge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--carbon-border);
  text-align: center;
}

.mud-status-label {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--carbon-muted);
  margin-bottom: 0.5rem;
}

.mud-badge {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 1px solid transparent;
}

/* Badge specific themes */
.mud-badge.status-soup {
  background: rgba(255, 23, 68, 0.15);
  border-color: rgba(255, 23, 68, 0.4);
  color: #ff5252;
}

.mud-badge.status-solid {
  background: rgba(0, 230, 118, 0.15);
  border-color: rgba(0, 230, 118, 0.4);
  color: #69f0ae;
}

.mud-badge.status-damp {
  background: rgba(61, 90, 254, 0.15);
  border-color: rgba(61, 90, 254, 0.4);
  color: #82b1ff;
}

.mud-description {
  margin-top: 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--carbon-muted);
}

/* Right Column: Map, Playback, controls */
.map-canvas-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
}

.map-wrapper {
  position: relative;
  flex-grow: 1;
  min-height: 550px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--carbon-border);
  box-shadow: var(--shadow-lux);
}

#map {
  width: 100%;
  height: 100%;
  background: #0d0d0d;
}

/* Preloader visual */
.preloader-overlay {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 12, 0.9);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transition: opacity 0.5s ease-in-out;
  pointer-events: none;
  opacity: 0;
}
.preloader-overlay.active {
  pointer-events: all;
  opacity: 1;
}

.spinner-radar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(200, 168, 75, 0.1);
  border-top-color: var(--primary-accent);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.preloader-text {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--primary-accent);
}

/* Map Custom Control Overlay Elements */
.map-legend {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 999;
  padding: 1rem;
  background: rgba(12, 12, 12, 0.85);
  border: 1px solid var(--carbon-border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
  font-size: 0.8rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.legend-line {
  width: 24px;
  height: 0;
  border-top-width: 2px;
  border-top-style: solid;
}
.legend-line.dashed-crimson {
  border-top-color: var(--crimson);
  border-top-style: dashed;
}
.legend-line.solid-indigo {
  border-top-color: var(--indigo);
}
.legend-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--emerald);
  background: rgba(0, 230, 118, 0.15);
}

/* Playback Control Bar */
.control-bar {
  padding: 1.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
}

.timeline-slider {
  flex-grow: 1;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.08);
  height: 6px;
  border-radius: 99px;
  outline: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.timeline-slider:hover {
  background: rgba(255,255,255,0.15);
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-accent);
  box-shadow: 0 0 10px rgba(200, 168, 75, 0.6);
  transition: transform var(--transition-fast);
}

.timeline-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.timeline-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--primary-accent);
  box-shadow: 0 0 10px rgba(200, 168, 75, 0.6);
  transition: transform var(--transition-fast);
}

.timeline-slider::-moz-range-thumb:hover {
  transform: scale(1.25);
}

.time-stamp {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: #fff;
  min-width: 140px;
  text-align: right;
  flex-shrink: 0;
}

.playback-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.buttons-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.control-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--carbon-border);
  color: var(--carbon-text);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.control-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.control-btn.btn-play {
  background: var(--primary-accent);
  color: var(--carbon-dark);
  border-color: transparent;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(200, 168, 75, 0.3);
}

.control-btn.btn-play:hover {
  background: #dfbe5b;
  transform: scale(1.08);
  box-shadow: 0 0 16px rgba(200, 168, 75, 0.5);
  color: var(--carbon-dark);
}

.control-btn svg {
  width: 20px;
  height: 20px;
}

.speed-selector {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--carbon-border);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  gap: 0.25rem;
}

.speed-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.75rem;
  border-radius: calc(var(--radius-sm) - 0.125rem);
  color: var(--carbon-muted);
  transition: all var(--transition-fast);
}

.speed-btn:hover {
  color: #fff;
}

.speed-btn.active {
  background: rgba(255,255,255,0.1);
  color: var(--primary-accent);
  font-weight: 700;
}

/* Footer rules */
.radar-footer {
  margin-top: auto;
  border-top: 1px solid var(--carbon-border);
  padding: 1.5rem;
  text-align: center;
  background: rgba(12, 12, 12, 0.6);
  font-size: 0.85rem;
  color: var(--carbon-muted);
}

.radar-footer a {
  color: var(--carbon-text);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.radar-footer a:hover {
  color: var(--primary-accent);
}
