/* ===========================================================================
   BASE - Fondations et réinitialisations
   =========================================================================== */

/* ---------------------------------------------------------------------------
   Reset HTML & Body
--------------------------------------------------------------------------- */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
}

/* ---------------------------------------------------------------------------
   Accessibilité
--------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 1px, 1px);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------------------
   Toggle Loading State
--------------------------------------------------------------------------- */
.toggle-loading {
  opacity: 0.5;
  pointer-events: none;
  cursor: wait !important;
}

.toggle-loading::before {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--primary, #14AE5C);
  border-top-color: transparent;
  border-radius: 50%;
  animation: toggle-spin 0.8s linear infinite;
  z-index: 10;
}

@keyframes toggle-spin {
  to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------------------
   Classes utilitaires
--------------------------------------------------------------------------- */
.hidden {
  display: none !important;
}

/* ---------------------------------------------------------------------------
   Transitions globales et ajustements MapLibre GL
--------------------------------------------------------------------------- */
a,
button,
input,
select,
textarea,
img,
[class*="btn"],
[class*="badge"],
[class*="pill"],
[class*="chip"],
[class*="tab"],
[class*="card"],
[class*="toggle"],
[class*="nav-item"],
[class*="sidebar"] {
  transition: all 0.3s ease-in-out;
}

.maplibregl-map {
  transition: none !important;
}

.maplibregl-canvas-container {
  transition: none !important;
}

/* ---------------------------------------------------------------------------
   Theme Transitioning - Désactive les transitions pendant changement de thème
   Pour un changement instantané et synchrone de tous les éléments
--------------------------------------------------------------------------- */
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: none !important;
  animation-duration: 0s !important;
  animation-delay: 0s !important;
}

.maplibregl-map,
.maplibregl-map * {
  transition: none !important;
}

svg path:focus {
  outline: none;
}

/* ---------------------------------------------------------------------------
   Animations globales
--------------------------------------------------------------------------- */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes gp-fade-in {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------------------------------------------------------------------------
   Préférences de mouvement réduit
--------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  html:focus-within {
    scroll-behavior: auto;
  }
}

/* ---------------------------------------------------------------------------
   GitHub-style markdown rendering
--------------------------------------------------------------------------- */
.markdown-body {
  color: var(--gray-900) !important;
  margin-bottom: 20px;
}

/* Legacy : .highlight remplacé par .is-highlighted / .gp-marker-pulse-ring (gp-custom-markers.css) */
