/* ============================================================
   GLOBE SECTION -- GPSwitch "Precision Instrument"
   Version 2.0: globe.gl desktop + SVG world map mobile
   Design tokens: Ink #0C0F14 / Signal Blue #3B82F6 / Snow #F1F5F9
   ============================================================ */

/* Section wrapper */
.globe-section {
  width: 100%;
  padding: 48px 24px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(59, 130, 246, 0.04) 40%,
    rgba(59, 130, 246, 0.06) 60%,
    transparent 100%
  );
  position: relative;
  overflow: hidden;
}

.globe-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--wire, #2A3140), transparent);
}

/* Titre */
.globe-title {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: 700;
  color: var(--text, #F1F5F9);
  text-align: center;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

/* Sous-titre */
.globe-subtitle {
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-2, #94A3B8);
  text-align: center;
  margin: 0 0 32px;
}

/* ============================================================
   CONTENEUR GLOBE DESKTOP
   ============================================================ */

#globe-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  overflow: visible;
}

/* Canvas globe.gl -- visible par defaut (anti-Enumalon) */
#globe-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: grab;
  border-radius: 50%;
  filter: drop-shadow(0 0 40px rgba(59, 130, 246, 0.2));
  transition: filter 0.3s ease;
}

#globe-container canvas:active {
  cursor: grabbing;
}

#globe-container canvas:hover {
  filter: drop-shadow(0 0 60px rgba(59, 130, 246, 0.28));
}

/* ============================================================
   SVG WORLD MAP -- MOBILE
   Visible par defaut sur mobile, remplace le globe 3D
   ============================================================ */

.world-map-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
}

/* Container SVG activé (classe ajoutee par world-map.js) */
.world-map-active {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  background: rgba(59, 130, 246, 0.03);
  border: 1px solid rgba(59, 130, 246, 0.08);
  border-radius: 12px;
  padding: 16px;
  overflow: hidden;
}

/* Dots de fond des masses terrestres */
.world-dots rect {
  opacity: 1; /* visible par defaut, anti-Enumalon */
}

/* Pins SVG -- visibles par defaut */
.world-pin {
  opacity: 1;
  transition: transform 0.2s ease;
  transform-origin: center;
}

.world-pin:hover {
  transform: scale(1.4);
}

.world-pin:focus {
  outline: 2px solid rgba(59, 130, 246, 0.6);
  outline-offset: 4px;
  border-radius: 50%;
}

.world-pin.active {
  transform: scale(1.5);
}

/* Animation halo pulse sur les pins SVG */
@keyframes pin-pulse {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(1.6); }
}

.pin-halo {
  animation: pin-pulse 3s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* Decaler les animations pour effet naturel */
.world-pin:nth-child(3n) .pin-halo { animation-delay: -1s; }
.world-pin:nth-child(5n) .pin-halo { animation-delay: -2s; }
.world-pin:nth-child(7n) .pin-halo { animation-delay: -0.5s; }

/* ============================================================
   FALLBACK STATIQUE -- si ni globe ni SVG
   ============================================================ */

.globe-fallback {
  display: none;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(59, 130, 246, 0.08) 0%,
    rgba(59, 130, 246, 0.03) 60%,
    transparent 100%
  );
  border: 1px solid rgba(59, 130, 246, 0.12);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

.globe-fallback-icon {
  width: 48px;
  height: 48px;
  opacity: 0.4;
  color: var(--signal, #3B82F6);
}

.globe-fallback-text {
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 0.75rem;
  color: var(--text-2, #94A3B8);
  text-align: center;
}

/* ============================================================
   STATS
   ============================================================ */

.globe-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
  justify-content: center;
}

.globe-stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 0.8rem;
  color: var(--text-2, #94A3B8);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.globe-stat-pill:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.28);
}

.globe-stat-pill strong {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--signal, #3B82F6);
}

.globe-stats-sep {
  width: 1px;
  height: 20px;
  background: var(--wire, #2A3140);
}

/* Note RGPD */
.globe-privacy-note {
  margin-top: 16px;
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 0.7rem;
  color: var(--text-2, #94A3B8);
  opacity: 0.6;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 5px;
}

.globe-privacy-note svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* ============================================================
   LIGHT MODE
   ============================================================ */

[data-theme="light"] .globe-section {
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(59, 130, 246, 0.03) 40%,
    rgba(59, 130, 246, 0.05) 60%,
    transparent 100%
  );
}

[data-theme="light"] .globe-title {
  color: #1E293B;
}

[data-theme="light"] .globe-subtitle {
  color: #64748B;
}

[data-theme="light"] .globe-stat-pill {
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(59, 130, 246, 0.2);
  color: #475569;
}

[data-theme="light"] .globe-privacy-note {
  color: #94A3B8;
}

[data-theme="light"] .world-map-active {
  background: rgba(59, 130, 246, 0.02);
  border-color: rgba(59, 130, 246, 0.1);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Mobile: carte SVG, max-width reduite */
@media (max-width: 768px) {
  .globe-section {
    padding: 36px 16px 44px;
  }

  #globe-container {
    max-width: 340px;
  }

  .world-map-active {
    max-width: 100%;
    padding: 12px;
  }

  .world-map-svg {
    max-height: 240px;
  }

  .globe-stats {
    gap: 8px;
  }

  .globe-stat-pill {
    padding: 5px 10px;
    font-size: 0.75rem;
  }
}

/* Tres petit mobile */
@media (max-width: 375px) {
  .world-map-svg {
    max-height: 200px;
  }
}

/* Desktop: globe plus grand */
@media (min-width: 768px) {
  #globe-container {
    max-width: 560px;
  }
}

@media (min-width: 1024px) {
  #globe-container {
    max-width: 600px;
  }
}

/* ============================================================
   REDUCED MOTION -- respecter la preference utilisateur
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  #globe-container canvas {
    transition: none;
    filter: drop-shadow(0 0 24px rgba(59, 130, 246, 0.12));
  }

  #globe-container canvas:hover {
    filter: drop-shadow(0 0 24px rgba(59, 130, 246, 0.12));
  }

  .pin-halo {
    animation: none;
    opacity: 0.15;
  }

  .world-pin {
    transition: none;
  }
}
