/* ========== VARIABLES ========== */
:root {
  /* Couleurs principales */
  --primary-color: #1e3a52;
  --primary-main: #2C4158;
  --secondary-color: #2c5f8d;
  --accent-color: #4a90d9;
  --accent-cyan: #00D4FF;
  --favorite-gold: #FFD700;
  
  /* Texte */
  --text-color: #333;
  --text-dark: #1A202C;
  --text-medium: #4A5568;
  --text-light: #718096;
  --text-white: #FFFFFF;
  
  /* Fonds */
  --bg-color: #ffffff;
  --bg-white: #FFFFFF;
  --bg-hover: #F1F5F9;
  
  /* Bordures */
  --border-color: #ddd;
  --border-light: #E2E8F0;
  
  /* Ombres */
  --shadow: 0 2px 8px rgba(0,0,0,0.15);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 6px 20px rgba(0, 0, 0, 0.2);
  
  /* Espacements */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
}

/* ========== RESET ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-color);
}

/* ========== HEADER ========== */
.header {
  background: linear-gradient(135deg, #1e3a52 0%, #2C4158 100%);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  gap: 20px;
  position: relative;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-bottom: 3px solid rgba(0, 212, 255, 0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-logo {
  width: 48px;
  height: 48px;
  background: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.header-logo:hover {
  transform: scale(1.05) rotate(5deg);
}

.header-org-name {
  font-size: 18px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  letter-spacing: 0.8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.header-button {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

/* ========== DROPDOWNS ========== */
.dropdown {
  display: none;
  position: fixed;
  top: 90px;
  right: 20px; /* Force l'alignement à droite par rapport à la fenêtre */
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: var(--space-md);
  box-shadow: var(--shadow-xl);
  z-index: 1001;
  min-width: 300px; /* Légèrement plus large pour l'étoile */
}
.maps-dropdown {
  right: 280px; /* Ajustez selon la position de votre bouton Maps dans le header */
}

.dropdown.show {
  display: block;
  animation: slideDown 0.3s ease;
}

.dropdown-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-medium);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.5px;
}
@media (max-width: 768px) {
  .dropdown {
    right: 0;
    left: 0;
    width: 100%;
    border-radius: 0 0 15px 15px;
  }
}

/* Le sélecteur d'étoile doit être ultra-précis pour la couleur jaune */
.map-item.is-favorite .map-favorite-star,
.favorite-item.is-favorite .favorite-star {
  color: #FFD700 !important; 
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}
/* ========== UNIFICATION DES FAVORIS (MAPS & BATEAUX) ========== */

.map-item, .favorite-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px 14px;
  cursor: pointer;
  border-radius: 8px;
  transition: all var(--transition-fast);
  margin-bottom: 4px;
  position: relative;
}

.map-item:hover, .favorite-item:hover {
  background: var(--bg-hover);
  transform: translateX(4px);
}

/* Style de l'étoile (commune aux cartes et aux bateaux) */
.map-favorite-star, 
.favorite-star {
  margin-left: auto; /* Pousse l'étoile tout à droite de la ligne */
  font-size: 1.2rem;
  color: var(--text-light);
  transition: all var(--transition-fast);
  user-select: none;
  padding: 0 5px;
  cursor: pointer;
}

/* État "Sélectionné comme favori" : Jaune Or */
.map-item.is-favorite .map-favorite-star,
.favorite-item.is-favorite .favorite-star {
  color: #FFD700 !important; /* Couleur Or vive */
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
  transform: scale(1.1);
}

/* Survol de l'étoile */
.map-favorite-star:hover, 
.favorite-star:hover {
  transform: scale(1.25);
  color: #FFD700;
}

/* Ajustement pour la lisibilité quand la ligne est bleue (active) 
   mais que l'étoile n'est pas favorite */
.map-item.active:not(.is-favorite) .map-favorite-star {
  color: rgba(255, 255, 255, 0.5);
}

/* ÉTAT FAVORIS ACTIF (Jaune Or) */
.map-item.is-favorite .map-favorite-star,
.favorite-item.is-favorite .favorite-star {
  color: var(--favorite-gold) !important;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
  animation: starPop 0.3s ease-out;
}

/* Style de la carte active dans la liste (Fond bleu) */
.map-item.active {
  background: var(--primary-main) !important;
  color: var(--text-white) !important;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

.map-item.active .map-icon,
.map-item.active .map-name {
  color: var(--text-white) !important;
}
/* État au survol (uniquement pour les non-actifs) */
.map-item:not(.active):hover {
  background: var(--bg-hover);
}

/* Checkmark d'activation */
.map-checkmark {
  font-size: 16px;
  color: var(--accent-cyan);
  opacity: 0;
  order: 3;
}

.map-item.active .map-checkmark {
  opacity: 1;
}

/* ========== ZOOM CONTROLS ========== */
.map-controls {
  position: fixed;
  right: 10px;
  top: 110px;
  z-index: 800;
}

.control-btn {
  width: 50px;
  height: 50px;
  background: white;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
  transition: all 0.2s;
}

.control-btn:hover {
  transform: scale(1.05);
  background: var(--bg-hover);
}

/* ========== ANIMATIONS ========== */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes starPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ========== GLOBE SPECIFIC ========== */
.globe-layer-btn.visible {
  display: flex;
}