/* ==========================================================================
   06-interactive-map.css - Illustration interactive avec zones hotspot
   ========================================================================== */

/* ---- Conteneur principal ---- */
.tinderet-map {
  position: relative;
  width: 100%;
  border-radius: var(--t-radius-xl);
  overflow: hidden;
  box-shadow: var(--t-shadow-xl);
  background: var(--t-primary-light);
  cursor: crosshair;
}

.tinderet-map__image {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---- Overlay SVG / zones ---- */
.tinderet-map__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ---- Zone hotspot ---- */
.tinderet-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  z-index: 10;
}

/* Cercle pulsant (indicateur de zone) */
.tinderet-hotspot__pulse {
  position: relative;
  width: 36px;
  height: 36px;
}

.tinderet-hotspot__pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.85);
  background: rgba(26, 111, 168, 0.65);
  backdrop-filter: blur(4px);
  transition: all var(--t-transition-base);
  box-shadow: 0 0 0 0 rgba(26, 111, 168, 0.4);
  animation: tinderet-pulse 2.5s cubic-bezier(0.4,0,0.6,1) infinite;
}

.tinderet-hotspot:hover .tinderet-hotspot__pulse-ring,
.tinderet-hotspot.is-active .tinderet-hotspot__pulse-ring {
  background: rgba(26, 111, 168, 0.9);
  animation: none;
  box-shadow: 0 0 0 6px rgba(26, 111, 168, 0.25);
  transform: scale(1.15);
}

.tinderet-hotspot__pulse-dot {
  position: absolute;
  inset: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--t-white);
}

@keyframes tinderet-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(26, 111, 168, 0.5); }
  70%  { box-shadow: 0 0 0 12px rgba(26, 111, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(26, 111, 168, 0); }
}

/* ---- Tooltip label ---- */
.tinderet-hotspot__label {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--t-text);
  color: var(--t-white);
  font-family: var(--t-font-heading);
  font-size: var(--t-font-size-xs);
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--t-radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-transition-fast);
  z-index: 20;
}

.tinderet-hotspot__label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--t-text);
}

.tinderet-hotspot:hover .tinderet-hotspot__label,
.tinderet-hotspot.is-active .tinderet-hotspot__label {
  opacity: 1;
}

/* ---- Groupe d'icônes affiché au survol/tap ---- */
.tinderet-hotspot__icons {
  position: absolute;
  bottom: calc(100% + 44px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--t-space-3);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--t-radius-lg);
  padding: var(--t-space-3) var(--t-space-4);
  box-shadow: var(--t-shadow-xl);
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  transition:
    opacity var(--t-transition-base),
    transform var(--t-transition-base);
  z-index: 30;
  min-width: max-content;
}

.tinderet-hotspot.is-active .tinderet-hotspot__icons {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Petite flèche sous le panneau d'icônes */
.tinderet-hotspot__icons::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(255,255,255,0.96);
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.1));
}

/* Icône individuelle dans le panneau */
.tinderet-hotspot-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--t-space-2);
  text-decoration: none;
  padding: var(--t-space-2) var(--t-space-3);
  border-radius: var(--t-radius-md);
  transition: background var(--t-transition-fast);
  min-width: 72px;
}

.tinderet-hotspot-icon:hover {
  background: var(--t-primary-light);
  text-decoration: none;
}

.tinderet-hotspot-icon__img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  transition: transform var(--t-transition-fast);
}

.tinderet-hotspot-icon:hover .tinderet-hotspot-icon__img {
  transform: scale(1.12);
}

.tinderet-hotspot-icon__label {
  font-family: var(--t-font-heading);
  font-size: 10px;
  font-weight: 600;
  color: var(--t-text);
  text-align: center;
  line-height: 1.2;
  max-width: 72px;
}

/* ---- Légende sous la carte ---- */
.tinderet-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--t-space-3) var(--t-space-6);
  padding: var(--t-space-4) var(--t-space-5);
  background: var(--t-white);
  border-radius: 0 0 var(--t-radius-xl) var(--t-radius-xl);
  border-top: 1px solid var(--t-border);
  font-size: var(--t-font-size-xs);
  color: var(--t-text-light);
  justify-content: center;
}

.tinderet-map-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tinderet-map-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--t-primary);
  flex-shrink: 0;
}

/* ---- Message d'aide (tous appareils) ---- */
.tinderet-map-hint {
  display: flex;
  text-align: center;
  font-size: var(--t-font-size-xs);
  color: var(--t-text-muted);
  margin-top: var(--t-space-3);
  gap: 6px;
  align-items: center;
  justify-content: center;
}

/* ---- Section illustration ---- */
.tinderet-map-section {
  padding: var(--t-space-20) 0;
  background: var(--t-bg);
}

.tinderet-map-section .tinderet-container {
  max-width: var(--t-max-full);
}

/* ---- Panneau mobile (remplace les popups flottants) ---- */
.tinderet-map__mobile-panel {
  display: none;
}

/* ---- Responsive ---- */
@media (hover: none) {
  /* Appareils tactiles : pas d'animation pulse (cela peut être distrayant) */
  .tinderet-hotspot__pulse-ring {
    animation: none;
    background: rgba(26, 111, 168, 0.75);
  }
}

@media (max-width: 768px) {
  .tinderet-hotspot__pulse {
    width: 28px;
    height: 28px;
  }

  /* Masquer les popups flottants - remplacés par le panneau plein-carte */
  .tinderet-hotspot__icons {
    display: none !important;
  }

  /* Panneau plein-carte */
  .tinderet-map__mobile-panel {
    display: flex;
    position: absolute;
    inset: 0;
    z-index: 25;
    background: #fff;
    align-items: center;
    justify-content: center;
    padding: var(--t-space-8) var(--t-space-6);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-transition-base);
    border-radius: var(--t-radius-xl);
  }

  .tinderet-map.is-map-active .tinderet-map__mobile-panel {
    opacity: 1;
    pointer-events: auto;
  }

  .tinderet-map.is-map-active .tinderet-map__mobile-panel[aria-hidden="true"] {
    opacity: 0;
    pointer-events: none;
  }

  .tinderet-map__mobile-panel-close {
    position: absolute;
    top: var(--t-space-3);
    right: var(--t-space-3);
    background: none;
    border: 1px solid var(--t-border);
    border-radius: var(--t-radius-sm);
    cursor: pointer;
    color: var(--t-text-light);
    padding: var(--t-space-2);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background var(--t-transition-fast), color var(--t-transition-fast);
  }

  .tinderet-map__mobile-panel-close:hover {
    background: var(--t-bg);
    color: var(--t-text);
  }

  .tinderet-map__mobile-panel-inner {
    text-align: center;
    width: 100%;
  }

  .tinderet-map__mobile-panel-title {
    font-family: var(--t-font-heading);
    font-weight: 700;
    font-size: var(--t-font-size-lg);
    color: var(--t-text);
    margin: 0 0 var(--t-space-6);
  }

  .tinderet-map__mobile-panel-icons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--t-space-4);
    justify-content: center;
  }

  .tinderet-map__mobile-panel-icons .tinderet-hotspot-icon {
    min-width: 80px;
    padding: var(--t-space-3);
  }

  .tinderet-map__mobile-panel-icons .tinderet-hotspot-icon__img {
    width: 48px;
    height: 48px;
  }

  .tinderet-map__mobile-panel-icons .tinderet-hotspot-icon__label {
    font-size: var(--t-font-size-xs);
  }
}
