/**
 * FNTI Map - Carte fond blanc
 * Adhérents vert | Non adhérents orange
 */

/* === Carte fond blanc === */
.fnti-map-section .fnti-map-container,
.fnti-map-dark .fnti-map-container,
.fnti-map-dark .france-map-wrapper .fnti-map-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 420px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* === Message Carte à venir === */
.fnti-map-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 2rem;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px dashed #e5e7eb;
}

.fnti-map-placeholder-msg {
    margin: 0;
    font-size: 1.1rem;
    color: #6b7280;
}

/* === Compteur (si présent) === */
.fnti-map-counter {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 16px 24px;
    background: linear-gradient(145deg, #0f1624 0%, #1a1f2e 100%);
    border-radius: 12px 12px 0 0;
}

.fnti-map-counter-number {
    font-size: 2.25rem;
    font-weight: 700;
    color: #0046FF;
    line-height: 1;
    text-shadow: 0 0 20px rgba(0, 70, 255, 0.4);
}

.fnti-map-counter-label {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

/* === Carte SVG === */
.fnti-map-container .fnti-map-svg-wrap,
.france-map-wrapper .fnti-map-svg-wrap {
    width: 100%;
    height: 100%;
    min-height: 420px;
    position: relative;
}

.fnti-map-container .fnti-map-svg-wrap svg,
.france-map-wrapper .fnti-map-svg-wrap svg {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 420px;
    background: transparent;
}

/* === Animation progressive au chargement === */
.fnti-map-svg-wrap svg {
    opacity: 0;
    animation: fnti-map-fade-in 0.8s ease-out forwards;
}

.fnti-map-svg-wrap path[id],
.fnti-map-svg-wrap rect.fnti-dep-dom {
    opacity: 0;
    animation: fnti-map-path-appear 0.5s ease-out forwards;
}

/* Animation progressive : délais par région (svg: rect, style, title = 3, puis g à partir de 4) */
.fnti-map-svg-wrap g.region:nth-child(4) path { animation-delay: 0.1s; }
.fnti-map-svg-wrap g.region:nth-child(5) path { animation-delay: 0.15s; }
.fnti-map-svg-wrap g.region:nth-child(6) path { animation-delay: 0.2s; }
.fnti-map-svg-wrap g.region:nth-child(7) path { animation-delay: 0.25s; }
.fnti-map-svg-wrap g.region:nth-child(8) path { animation-delay: 0.3s; }
.fnti-map-svg-wrap g.region:nth-child(9) path { animation-delay: 0.35s; }
.fnti-map-svg-wrap g.region:nth-child(10) path { animation-delay: 0.4s; }
.fnti-map-svg-wrap g.region:nth-child(11) path { animation-delay: 0.45s; }
.fnti-map-svg-wrap g.region:nth-child(12) path { animation-delay: 0.5s; }
.fnti-map-svg-wrap g.region:nth-child(13) path { animation-delay: 0.55s; }
.fnti-map-svg-wrap g.region:nth-child(14) path { animation-delay: 0.6s; }
.fnti-map-svg-wrap g.region:nth-child(15) path { animation-delay: 0.65s; }
.fnti-map-svg-wrap g.region:nth-child(16) path { animation-delay: 0.7s; }
.fnti-map-svg-wrap g.region:nth-child(17) path { animation-delay: 0.75s; }
.fnti-map-svg-wrap g.region:nth-child(18) path { animation-delay: 0.8s; }
.fnti-map-svg-wrap g.region:nth-child(19) path { animation-delay: 0.85s; }
.fnti-map-svg-wrap g.region:nth-child(20) path { animation-delay: 0.9s; }
.fnti-map-svg-wrap g.region:nth-child(21) path { animation-delay: 0.95s; }
.fnti-map-svg-wrap g#dom-encadre rect.fnti-dep-dom { animation-delay: 1s; }

@keyframes fnti-map-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fnti-map-path-appear {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* === Adhérents vert uniquement | Non adhérents gris (géré par JS) === */
.fnti-map-svg-wrap path[id] {
    fill: #e5e7eb;
    stroke: #ffffff;
    stroke-width: 1;
    transition: fill 0.2s ease, opacity 0.2s ease;
}

.fnti-map-svg-wrap rect.fnti-dep-dom {
    fill: #e5e7eb;
    stroke: #ffffff;
    transition: fill 0.2s ease, opacity 0.2s ease;
}

/* Hover */
.fnti-map-svg-wrap path[id]:hover,
.fnti-map-svg-wrap rect.fnti-dep-dom:hover {
    opacity: 0.9;
}

.fnti-map-svg-wrap path[id],
.fnti-map-svg-wrap rect.fnti-dep-dom {
    cursor: pointer;
}

.fnti-map-svg-wrap .fnti-map-dom-encadre {
    isolation: isolate;
}

/* === Tooltip === */
.fnti-map-tooltip {
    position: absolute;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 12px;
    border-radius: 6px;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fnti-map-tooltip.visible {
    opacity: 1;
}

/* === Légende === */
.fnti-map-legend {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 6px 14px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    font-size: 11px;
    color: #374151;
    z-index: 50;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fnti-map-legend-item {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.fnti-map-legend-adherent {
    background: #22c55e;
}

.fnti-map-legend-non {
    background: #e5e7eb;
}

/* === Panneau latéral animé === */
.fnti-map-sidepanel {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    max-width: 95%;
    height: 100%;
    background: linear-gradient(180deg, rgba(26, 31, 46, 0.98) 0%, rgba(15, 22, 36, 0.98) 100%);
    z-index: 99999;
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
    overflow-y: auto;
}

.fnti-map-sidepanel.is-open {
    transform: translateX(0);
}

.fnti-map-sidepanel-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
}

.fnti-map-sidepanel-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.fnti-map-sidepanel-content {
    padding: 48px 24px 24px;
}

.fnti-map-sidepanel-title {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.fnti-map-sidepanel-region {
    margin: 0 0 20px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.fnti-map-sidepanel-contact {
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.fnti-map-sidepanel-contact .contact-item {
    margin-bottom: 10px;
}

.fnti-map-sidepanel-contact a {
    color: #0046FF;
    text-decoration: none;
}

.fnti-map-sidepanel-contact a:hover {
    text-decoration: underline;
}

.fnti-map-sidepanel-cta {
    display: inline-block;
    padding: 12px 20px;
    background: #0046FF;
    color: #fff !important;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 8px;
    transition: background 0.2s, box-shadow 0.2s;
}

.fnti-map-sidepanel-cta:hover {
    background: #2563eb;
    box-shadow: 0 0 16px rgba(0, 70, 255, 0.4);
}

/* === Liste départements (sous la carte) === */
.departements-list-section {
    margin-top: 2rem;
}

.fnti-map-section + .departements-list-section .departement-badge.active {
    background: #dcfce7;
    color: #22c55e;
}

.fnti-map-section + .departements-list-section .departement-badge.inactive {
    background: #ffedd5;
    color: #f97316;
}

.departement-item.is-highlighted {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

/* === Responsive === */
@media (max-width: 600px) {
    .fnti-map-counter {
        padding: 12px 16px;
    }

    .fnti-map-counter-number {
        font-size: 1.75rem;
    }

    .fnti-map-counter-label {
        font-size: 0.9rem;
    }

    .fnti-map-sidepanel {
        width: 100%;
    }

    .fnti-map-container .fnti-map-svg-wrap,
    .france-map-wrapper .fnti-map-svg-wrap,
    .fnti-map-container .fnti-map-svg-wrap svg,
    .france-map-wrapper .fnti-map-svg-wrap svg {
        min-height: 320px;
    }

}
