/* =========================================================================
   Swentez AI — Surveillance Intelligente du Littoral Marocain
   Design System : Oceanic Dark Glassmorphism v2.5 (Dynamic Ambient & Trilingual)
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --bg-abyss: #061426;
  --bg-abyss-deep: #030a14;
  --bg-card: rgba(11, 31, 56, 0.78);
  --bg-card-hover: rgba(16, 42, 75, 0.90);
  --border-cyan: rgba(56, 189, 248, 0.22);
  --border-cyan-glow: rgba(0, 229, 255, 0.5);
  --cyan-primary: #00e5ff;
  --cyan-muted: #38bdf8;
  --teal-accent: #14b8a6;
  --coral-hot: #ff5e3a;
  --amber-warn: #f59e0b;
  --emerald-good: #10b981;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Cairo', sans-serif;
  background-color: var(--bg-abyss-deep);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, .font-display {
  font-family: 'Space Grotesk', 'Cairo', sans-serif;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(6, 20, 38, 0.85);
}
::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.35);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.7);
}

/* Effets Glassmorphism */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-cyan);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.glass-panel-subtle {
  background: rgba(12, 33, 60, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.18);
  transition: all 0.2s ease;
}

.glass-panel-subtle:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-cyan-glow);
}

/* Badges de Sévérité */
.badge-severe {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.5);
}
.badge-moderate {
  background: rgba(245, 158, 11, 0.25);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.5);
}
.badge-low {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

/* Carte Leaflet Customization */
#map {
  width: 100%;
  height: 100%;
  min-height: 480px;
  border-radius: 1rem;
  z-index: 10;
  background: #061426;
}

.leaflet-container {
  font-family: 'Inter', sans-serif !important;
  background-color: #061426 !important;
}

.leaflet-popup-content-wrapper {
  background: rgba(11, 31, 56, 0.96) !important;
  color: #f8fafc !important;
  backdrop-filter: blur(14px) !important;
  border: 1px solid var(--cyan-primary) !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6) !important;
}

.leaflet-popup-tip {
  background: rgba(11, 31, 56, 0.96) !important;
}

/* Marqueurs personnalisés */
.custom-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.6);
  border: 2px solid white;
  transition: transform 0.2s ease;
  cursor: pointer;
}
.custom-pin:hover {
  transform: scale(1.25);
  z-index: 9999 !important;
}

.pin-plastique { background: #0284c7; box-shadow: 0 0 12px #38bdf8; }
.pin-filets { background: #d97706; box-shadow: 0 0 12px #fbbf24; }
.pin-hydrocarbures { background: #dc2626; box-shadow: 0 0 14px #ef4444; }
.pin-organique { background: #059669; box-shadow: 0 0 12px #34d399; }

/* Animation du Robot Swentez */
@keyframes robot-float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(1deg); }
}

@keyframes robot-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.1); }
}

@keyframes pulse-cyan {
  0%, 100% { box-shadow: 0 0 15px rgba(0, 229, 255, 0.4); }
  50% { box-shadow: 0 0 30px rgba(0, 229, 255, 0.85); }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.robot-widget-floating {
  animation: robot-float 4s ease-in-out infinite;
}

.robot-eye {
  animation: robot-blink 4s infinite;
  transform-origin: center;
}

.robot-glow-idle {
  animation: pulse-cyan 3s infinite;
}

.robot-thinking-aura {
  animation: spin-slow 2s linear infinite;
}

/* Tooltip customisé pour Leaflet */
.leaflet-tooltip.custom-tooltip {
  background: rgba(6, 20, 38, 0.9);
  border: 1px solid var(--border-cyan);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* Thème Océan Nuit Haute Résolution (100% Watermark-Free & Zero Dépendance) */
.map-tiles-night-mode {
  filter: brightness(0.65) invert(1) contrast(2.2) hue-rotate(200deg) saturate(0.4) brightness(0.8) !important;
}

/* Ambiance dynamique d'arrière-plan */
#ocean-ambient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -10;
  pointer-events: none;
}

/* Mode RTL pour l'Arabe */
[dir="rtl"] {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .font-display {
  font-family: 'Cairo', sans-serif;
}
