/* ========== ADHERENT MAP — STYLES ========== */

.adherent-map-container {
    font-family: 'Quicksand', sans-serif;
    width: 100%;
    background: #EBECE6;
    padding: 30px 5%;
    box-sizing: border-box;
    margin-top: 0.5vw;
}

/* ========== ONGLETS ========== */
.amap-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 0;
}

.amap-tab {
    background: transparent;
    color: #576557;
    border: 2px solid #576557;
    border-bottom: none;
    padding: 15px 40px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    top: 2px;
}

.amap-tab:first-child {
    border-radius: 8px 0 0 0;
}

.amap-tab:last-child {
    border-radius: 0 8px 0 0;
}

.amap-tab:hover {
    background: rgba(87, 101, 87, 0.1);
}

.amap-tab.active {
    background: #576557;
    color: #fff;
}

/* ========== FILTRES ========== */
.amap-filters {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    background: #fff;
    border: 2px solid #576557;
    border-radius: 0 0 8px 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.amap-filter-group {
    flex: 1;
}

.amap-filter-group label {
    display: block;
    font-size: 12px;
    margin-bottom: 6px;
    color: #576557;
    font-weight: 600;
}

.amap-filter-group input,
.amap-filter-group select {
    width: 100%;
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 4px;
    padding: 10px 12px;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    box-sizing: border-box;
}

.amap-filter-group input:focus,
.amap-filter-group select:focus {
    outline: none;
    border-color: #576557;
}

.amap-reset-btn {
    width: 44px;
    height: 44px;
    background: #576557;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.amap-reset-btn:hover {
    background: #465246;
}

/* ========== COMPTEUR ========== */
.amap-count {
    text-align: center;
    margin-bottom: 3px;
    font-size: 14px;
    color: #576557;
    font-weight: 600;
}

/* ========== CARTE ========== */
#adherent-map {
    border: 2px solid #576557;
    border-radius: 8px;
    z-index: 1;
}

/* ========== MARQUEURS PERSONNALISÉS ========== */
.amap-marker-icon {
    background: none !important;
    border: none !important;
}

.amap-marker {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #576557;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: transform 0.2s;
}

.amap-marker:hover {
    transform: scale(3);
    z-index: 99999 !important;
    position: relative;
}

.amap-marker-icon:hover {
    z-index: 99999 !important;
}

.leaflet-marker-icon:has(.amap-marker:hover) {
    z-index: 99999 !important;
}

.amap-marker img {
    width: 80% !important;
    height: 80%;
    object-fit: contain;
}

.amap-marker-nophoto {
    background: #576557;
}

.amap-marker-nophoto span {
    color: #fff;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 14px;
}

/* ========== CLUSTERS ========== */
.amap-cluster-icon {
    background: none !important;
    border: none !important;
}

.amap-cluster {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.amap-cluster-small {
    background: #576557;
}

.amap-cluster-medium {
    background: #3d4a3d;
    width: 48px;
    height: 48px;
    font-size: 15px;
}

.amap-cluster-large {
    background: #2a342a;
    width: 56px;
    height: 56px;
    font-size: 16px;
}

/* ========== POPUP ========== */
.amap-popup-container .leaflet-popup-content-wrapper {
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.amap-popup-container .leaflet-popup-content {
    margin: 0;
    min-width: 250px;
}

.amap-popup-container .leaflet-popup-tip {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.amap-popup {
    display: flex;
    flex-direction: column;
}

.amap-popup-img {
    width: 100%;
    height: 120px;
    background: #f8f9f8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-sizing: border-box;
}

.amap-popup-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.amap-popup-body {
    padding: 15px;
}

.amap-popup-title {
    margin: 0 0 8px;
    font-family: 'Quicksand', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.amap-popup-address {
    margin: 0 0 8px;
    font-size: 12px;
    color: #777;
    line-height: 1.4;
}

.amap-popup-type {
    display: inline-block;
    background: #EBECE6;
    color: #576557;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 10px;
}

.amap-popup-link {
    display: block;
    text-align: center;
    background: #576557;
    color: #fff !important;
    text-decoration: none !important;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.2s;
}

.amap-popup-link:hover {
    background: #465246;
}

/* ========== RESPONSIVE TABLETTE ========== */
@media (max-width: 768px) {
    .adherent-map-container {
        padding: 20px 3%;
    }

    .amap-tabs {
        flex-direction: column;
    }

    .amap-tab {
        border-radius: 0 !important;
        border: 2px solid #576557;
        text-align: center;
    }

    .amap-tab:first-child {
        border-radius: 8px 8px 0 0 !important;
    }

    .amap-tab:last-child {
        border-bottom: 2px solid #576557;
    }

    .amap-tab + .amap-tab {
        border-top: none;
    }

    .amap-filters {
        flex-direction: column;
        gap: 12px;
        border-radius: 0 0 8px 8px;
    }

    .amap-reset-btn {
        width: 100%;
        height: 44px;
    }

    #adherent-map {
        height: 450px !important;
    }
}

/* ========== RESPONSIVE MOBILE ========== */
@media (max-width: 576px) {
    .amap-tab {
        padding: 12px 15px;
        font-size: 13px;
    }

    .amap-filters {
        padding: 15px 12px;
    }

    .amap-filter-group input,
    .amap-filter-group select {
        font-size: 16px; /* Empêche zoom iOS */
        padding: 12px;
    }

    #adherent-map {
        height: 400px !important;
        border-radius: 6px;
    }

    .amap-popup-img {
        height: 90px;
        padding: 10px;
    }

    .amap-popup-title {
        font-size: 14px;
    }
}

/* ========== CARTE FICHE — [fiche_adherents_map] ========== */

.fmap-container {
    font-family: 'Quicksand', sans-serif;
    margin: 30px 0;
    width: 80%;
    margin-left: 10%;
}

.fmap-header {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #576557;
    padding: 20px 25px;
    border-radius: 10px 10px 0 0;
}

.fmap-header-icon {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fmap-header-icon svg {
    width: 22px;
    height: 22px;
    color: #fff;
}

.fmap-title {
    margin: 0;
    font-size: 1.2em;
    font-weight: 700;
    color: #fff;
    font-family: 'Quicksand', sans-serif;
}

.fmap-subtitle {
    margin: 4px 0 0;
    font-size: 0.85em;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
}

#fiche-adherents-map {
    height: 750px;
    width: 100%;
    border: 2px solid #576557;
    border-top: none;
    border-radius: 0 0 10px 10px;
    z-index: 1;
}

.fmap-empty {
    text-align: center;
    padding: 30px;
    color: #888;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    background: #f9faf9;
    border-radius: 10px;
    border: 1px solid #e5ebe5;
    margin: 20px 0;
}

/* ========== RESPONSIVE FICHE MAP ========== */
@media (max-width: 768px) {
    .fmap-header {
        padding: 16px 18px;
        gap: 12px;
    }

    .fmap-title {
        font-size: 1em;
    }

    #fiche-adherents-map {
        height: 350px;
    }
}

@media (max-width: 576px) {
    #fiche-adherents-map {
        height: 300px;
        border-radius: 0 0 8px 8px;
    }

    .fmap-header-icon {
        width: 36px;
        height: 36px;
    }

    .fmap-header-icon svg {
        width: 18px;
        height: 18px;
    }
}
