/* ==========================================================================
   Meridian Global Freight OS - Advanced Styles & Animations
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  --primary-blue: #1d4ed8;
  --primary-blue-glow: rgba(29, 78, 216, 0.35);
  --electric-blue: #2563eb;
  --accent-cyan: #06b6d4;
  --obsidian-dark: #070a10;
  --obsidian-card: #0c111c;
  --light-canvas: #f8fafc;
  --border-subtle: #e2e8f0;
}

html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
  background-color: #ffffff;
  color: #0f172a;
}

/* Custom Selection */
::selection {
  background-color: #2563eb;
  color: #ffffff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Glassmorphism Classes */
.glass-panel {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-panel-dark {
  background: rgba(12, 17, 28, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Floating Animations */
@keyframes subtle-float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes subtle-float-reverse {
  0%, 100% {
    transform: translateY(-6px);
  }
  50% {
    transform: translateY(2px);
  }
}

.animate-float {
  animation: subtle-float 6s ease-in-out infinite;
}

.animate-float-delay {
  animation: subtle-float-reverse 7s ease-in-out 1.5s infinite;
}

/* Pulse Glow */
@keyframes glow-pulse {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.animate-glow-pulse {
  animation: glow-pulse 3s infinite ease-in-out;
}

/* Radar Sweep Beam */
@keyframes radar-sweep {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.radar-beam {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 280px;
  height: 280px;
  margin-top: -140px;
  margin-left: -140px;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(from 0deg at 50% 50%, rgba(37, 99, 235, 0.18) 0deg, rgba(37, 99, 235, 0) 65deg);
  animation: radar-sweep 8s linear infinite;
  transform-origin: center center;
}

/* Shipping Lane Animated Dashes */
@keyframes dash-flow {
  from {
    stroke-dashoffset: 60;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.animated-route-line {
  stroke-dasharray: 6, 6;
  animation: dash-flow 2.5s linear infinite;
}

.animated-route-line-fast {
  stroke-dasharray: 4, 8;
  animation: dash-flow 1.5s linear infinite;
}

/* Watermark typography at footer */
.footer-watermark {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(15, 23, 42, 0.07);
  user-select: none;
  pointer-events: none;
}

/* Bento Card Hover Lighting Effect */
.bento-card {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  position: relative;
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 35px -10px rgba(15, 23, 42, 0.12);
}

.bento-card .bento-img {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-card:hover .bento-img {
  transform: scale(1.05);
}

/* Pill Badges */
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 9999px;
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
}

.pill-badge-dark {
  background-color: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Accordion Smooth Transitions */
.accordion-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
}

.accordion-item.active .accordion-content {
  grid-template-rows: 1fr;
  opacity: 1;
}

.accordion-inner {
  overflow: hidden;
}

/* Reveal on Scroll Elements */
.reveal-init {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Interactive container sensor hotspots */
.hotspot-ring {
  position: relative;
}

.hotspot-ring::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 9999px;
  border: 1.5px solid #3b82f6;
  opacity: 0.8;
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* ==========================================================================
   Leaflet & CARTO Basemaps Geospatial Styling
   ========================================================================== */

#geospatial-map {
  background-color: #070a10;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.leaflet-container {
  background-color: #070a10 !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
}

/* Custom Zoom Controls */
.leaflet-bar {
  border: none !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5) !important;
  border-radius: 12px !important;
  overflow: hidden;
}

.leaflet-bar a {
  background-color: rgba(12, 17, 28, 0.9) !important;
  color: #93c5fd !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(8px);
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  transition: all 0.2s ease;
}

.leaflet-bar a:hover {
  background-color: #2563eb !important;
  color: #ffffff !important;
}

/* Custom Attribution */
.leaflet-control-attribution {
  background-color: rgba(7, 10, 16, 0.85) !important;
  color: #64748b !important;
  font-size: 10px !important;
  padding: 3px 8px !important;
  border-radius: 6px 0 0 0;
  backdrop-filter: blur(6px);
}

.leaflet-control-attribution a {
  color: #94a3b8 !important;
}

/* Custom Popups */
.leaflet-popup-content-wrapper {
  background: rgba(12, 17, 28, 0.95) !important;
  backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(37, 99, 235, 0.35) !important;
  border-radius: 16px !important;
  color: #f8fafc !important;
  box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.7), 0 0 20px rgba(37, 99, 235, 0.2) !important;
  padding: 0 !important;
}

.leaflet-popup-content {
  margin: 14px 16px !important;
  line-height: 1.4 !important;
}

.leaflet-popup-tip {
  background: rgba(12, 17, 28, 0.95) !important;
  border: 1px solid rgba(37, 99, 235, 0.35) !important;
}

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

.leaflet-popup-close-button:hover {
  color: #ffffff !important;
}

/* Custom Pulsing Port Marker */
.map-port-beacon {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.map-port-beacon .beacon-core {
  width: 10px;
  height: 10px;
  background-color: #3b82f6;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 10px #3b82f6;
  z-index: 2;
  transition: transform 0.2s ease;
}

.map-port-beacon:hover .beacon-core {
  transform: scale(1.35);
  background-color: #60a5fa;
}

.map-port-beacon .beacon-wave {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: rgba(37, 99, 235, 0.35);
  animation: beacon-pulse 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
  z-index: 1;
}

.map-port-beacon.beacon-cyan .beacon-core {
  background-color: #06b6d4;
  box-shadow: 0 0 10px #06b6d4;
}

.map-port-beacon.beacon-cyan .beacon-wave {
  background-color: rgba(6, 182, 212, 0.4);
}

@keyframes beacon-pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  75%, 100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* Animated Ship Marker */
.map-ship-marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.map-ship-icon {
  width: 28px;
  height: 28px;
  background: rgba(37, 99, 235, 0.9);
  border: 1.5px solid #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
  transition: transform 0.2s ease;
}

.map-ship-marker:hover .map-ship-icon {
  transform: scale(1.2);
  background: #1d4ed8;
}

