/* ==========================================================================
   BHOOMI DRISHTI | AI Mission Control & Geospatial Operations Console
   Engineered for Professional Aerospace Ground Control & Cadastral Survey
   Aesthetic: Deep Graphite, Hairline Glass, Restrained Cyan/Amber Accents,
   High-Contrast Modern Typography & Sub-pixel Monospace Telemetry.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. ROOT & BODY ATMOSPHERE (DEEP GRAPHITE / OBSIDIAN)
   -------------------------------------------------------------------------- */
:root {
  --color-bg: #09090b;
  --color-surface: #0e1117;
  --color-surface-elevated: #141822;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-subtle: rgba(255, 255, 255, 0.04);
  --color-border-cyan: rgba(6, 182, 212, 0.3);
  --color-cyan: #06b6d4;
  --color-cyan-glow: rgba(6, 182, 212, 0.15);
  --color-amber: #f59e0b;
  --color-red: #ef4444;
  --color-emerald: #10b981;
}

body {
  background-color: #09090b !important;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(6, 182, 212, 0.06), transparent 70%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(14, 165, 233, 0.04), transparent 60%) !important;
  background-attachment: fixed !important;
  color: #f4f4f5 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Precision Engineering Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: #09090b;
}
::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

::selection {
  background: rgba(6, 182, 212, 0.3);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   2. HIGH-CONTRAST TYPOGRAPHY & DATA HEADINGS
   -------------------------------------------------------------------------- */
h1, h2, h3, h4,
.font-headline-xl,
.font-headline-lg,
.font-headline-md,
.font-headline-sm {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  letter-spacing: -0.02em;
  color: #f4f4f5;
  font-weight: 600;
}

.font-mono,
.font-data-sm,
.telemetry-val {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-feature-settings: "zero" 1, "tnum" 1;
}

/* --------------------------------------------------------------------------
   3. AEROSPACE MISSION BUTTONS & CONTROLS
   -------------------------------------------------------------------------- */
button {
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', -apple-system, sans-serif;
}
button:active {
  transform: scale(0.97);
}

/* Primary Action Buttons (Crisp Cyan-Sky Solid with Dark Text) */
button.bg-primary,
.btn-aerospace-primary {
  background: #0ea5e9 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border: 1px solid rgba(56, 189, 248, 0.8) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 12px rgba(14, 165, 233, 0.25) !important;
}

button.bg-primary:hover,
.btn-aerospace-primary:hover {
  background: #38bdf8 !important;
  box-shadow: 0 2px 16px rgba(56, 189, 248, 0.4) !important;
  transform: translateY(-1px);
}

button.bg-primary span,
.btn-aerospace-primary span {
  color: #ffffff !important;
}

/* Secondary & Header Action Buttons */
.btn-aerospace-secondary,
button.bg-surface-container-high:not(#btn-action-arm):not(#btn-save) {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #f4f4f5 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

button.bg-surface-container-high:not(#btn-action-arm):not(#btn-save):hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(6, 182, 212, 0.3) !important;
}

/* --------------------------------------------------------------------------
   4. GLASSMORPHISM & PRECISION PANELS
   -------------------------------------------------------------------------- */
.glass-panel,
.lovable-card {
  background: rgba(14, 17, 23, 0.78) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 32px -4px rgba(0, 0, 0, 0.7), inset 0 1px 0 0 rgba(255, 255, 255, 0.04) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover,
.lovable-card:hover {
  border-color: rgba(6, 182, 212, 0.22) !important;
  box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.8), inset 0 1px 0 0 rgba(255, 255, 255, 0.06) !important;
}

.glass-panel-glow {
  box-shadow: 0 0 24px -2px rgba(6, 182, 212, 0.2), inset 0 1px 0 0 rgba(255, 255, 255, 0.08) !important;
}

/* --------------------------------------------------------------------------
   5. STATUS INDICATORS & ANIMATIONS
   -------------------------------------------------------------------------- */
@keyframes ring-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(6, 182, 212, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

.ping-ring {
  animation: ring-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* --------------------------------------------------------------------------
   6. SIDEBAR NAVIGATION - ULTRA SLEEK MISSION PILL
   -------------------------------------------------------------------------- */
.nav-link {
  position: relative;
  border: 1px solid transparent;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1) !important;
  border-radius: 6px !important;
}

.nav-link:hover:not(.active) {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #f4f4f5 !important;
  transform: translateX(2px);
}

.nav-link:hover:not(.active) .material-symbols-outlined {
  color: #38bdf8 !important;
}

.nav-link.active {
  background: rgba(14, 165, 233, 0.12) !important;
  border-color: rgba(14, 165, 233, 0.4) !important;
  color: #38bdf8 !important;
  font-weight: 600 !important;
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.12), inset 0 0 8px rgba(14, 165, 233, 0.06) !important;
}

.nav-link.active .material-symbols-outlined {
  color: #38bdf8 !important;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 9999px;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

/* --------------------------------------------------------------------------
   7. MISSION CANVAS CONTAINER & FULLSCREEN
   -------------------------------------------------------------------------- */
#cockpit-screen-viewport,
.mission-canvas-container {
  background: #06080e !important;
  border: 1px solid rgba(6, 182, 212, 0.25) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), inset 0 0 24px rgba(0, 0, 0, 0.8) !important;
}

.mission-canvas-container:fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  padding: 0 !important;
}

/* --------------------------------------------------------------------------
   8. LEAFLET DARK GIS STYLING (PRECISION AEROSPACE MAP)
   -------------------------------------------------------------------------- */
.leaflet-container {
  background-color: #07090e !important;
  font-family: 'Inter', sans-serif !important;
}

/* Tile styling */
.leaflet-tile {
  filter: brightness(0.85) contrast(1.1) saturate(1.05);
}

/* Leaflet Zoom and Custom Control Buttons */
.leaflet-bar,
.leaflet-control-zoom {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(14, 17, 23, 0.9) !important;
  backdrop-filter: blur(12px) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6) !important;
  border-radius: 6px !important;
  overflow: hidden;
}

.leaflet-bar a,
.leaflet-control-zoom a {
  background-color: rgba(14, 17, 23, 0.9) !important;
  color: #f4f4f5 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  transition: all 0.15s ease;
}

.leaflet-bar a:hover,
.leaflet-control-zoom a:hover {
  background-color: #0ea5e9 !important;
  color: #ffffff !important;
}

/* Leaflet Popup Styling */
.leaflet-popup-content-wrapper {
  background: rgba(14, 17, 23, 0.95) !important;
  backdrop-filter: blur(16px) !important;
  color: #f4f4f5 !important;
  border: 1px solid rgba(6, 182, 212, 0.35) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 16px rgba(6, 182, 212, 0.15) !important;
  padding: 2px !important;
}

.leaflet-popup-tip {
  background: rgba(14, 17, 23, 0.95) !important;
  border: 1px solid rgba(6, 182, 212, 0.35) !important;
}

.leaflet-popup-close-button {
  color: #94a3b8 !important;
  padding: 6px !important;
}
.leaflet-popup-close-button:hover {
  color: #38bdf8 !important;
}

/* Scale & Attribution */
.leaflet-control-scale-line {
  background: rgba(14, 17, 23, 0.85) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 10px !important;
  padding: 2px 6px !important;
  border-radius: 3px !important;
}

.leaflet-control-attribution {
  background: rgba(9, 9, 11, 0.85) !important;
  color: #64748b !important;
  font-size: 9px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 4px 0 0 0 !important;
}
.leaflet-control-attribution a {
  color: #94a3b8 !important;
}

/* Survey Transect Flight Path Animation */
.survey-flight-path {
  stroke: #38bdf8;
  stroke-width: 2.2;
  stroke-dasharray: 6, 6;
  animation: dash 30s linear infinite;
  filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.6));
}

@keyframes dash {
  to {
    stroke-dashoffset: -1000;
  }
}

/* Drone Icon Pulse in Map */
.ov-drone-marker {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   9. RETICLE & ATTITUDE OVERLAYS
   -------------------------------------------------------------------------- */
.fpv-hud-overlay {
  pointer-events: none;
}

.nadir-crosshair {
  stroke: rgba(6, 182, 212, 0.85);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.5));
}
