/**
 * EditMap - Frontend CSS

/* ========================================
   Conteneur principal
   ======================================== */

.editmap-container {
    position: relative;
    width: 100%;
    height: 100vh; /* 100vh pour un test plein écran */
    overflow: hidden;
    background: #fff;
}

@media (max-width: 768px) {
    .editmap-container {
        height: 100vh;
        height: 100dvh;
    }
}

/* ========================================
   Carte Leaflet (Plein écran)
   ======================================== */

.editmap-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.editmap-map .leaflet-container {
    width: 100%;
    height: 100%;
}

/* Forcer les couches Leaflet sur le GPU pour un zoom fluide */
.editmap-map .leaflet-tile-pane,
.editmap-map .leaflet-marker-pane,
.editmap-map .leaflet-overlay-pane {
    will-change: transform;
}

/* ========================================
   Bouton hamburger pour ouvrir le menu
   ======================================== */

.editmap-menu-toggle {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1001;
    padding: 12px 24px;
    border: none;
    border-radius: 30px !important;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    transition: background 0.3s ease, transform 0.3s ease;
    will-change: transform;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: var(--editmap-btn-menu, #ed1445);
}

.editmap-menu-toggle:hover {
    background: var(--editmap-btn-menu, #ed1445);
    filter: brightness(0.85);
    transform: scale(1.05);
}

/* ========================================
   Sidebar coulissante (à gauche)
   ======================================== */

.editmap-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 360px;
    height: 100%;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    will-change: transform;

    /* Fond sidebar dynamique */
    background: var(--editmap-sidebar-bg, #4A6CF7);
}

.editmap-sidebar.open {
    transform: translateX(0);
}

@media (max-width: 768px) {
    .editmap-sidebar {
        width: 100%;
    }
}

/* Bouton de fermeture */
.editmap-sidebar-close {
    position: absolute;
    top: 8px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 40px;
    font-weight: 300;
    color: #ffffff;
    padding: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.editmap-sidebar-close:hover {
    color: #333;
    opacity: 0.7;
}

/* Bouton home */
.editmap-sidebar-home {
    position: absolute;
    top:10px;
    left: 23%;
    transform: translateX(-50%);
    border: none;
    background: var(--editmap-btn-home, #ed1445);
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    padding: 8px 40px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: background 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
    white-space: nowrap;
}

.editmap-sidebar-home:hover {
    background: var(--editmap-btn-home, #ed1445);
    filter: brightness(0.85);
}

.editmap-sidebar-home:active {
    box-shadow: none;
}

.editmap-sidebar-home-label {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
}

/* ========================================
   Filtre par catégories (Pills verticales)
   ======================================== */

.editmap-category-filter {
    padding: 50px 14px 0 14px;
}

.editmap-category-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
}

/* Scrollbar personnalisée pour les catégories */
.editmap-category-list::-webkit-scrollbar {
    width: 8px;
}

.editmap-category-list::-webkit-scrollbar-track {
    border-radius: 3px;
}

.editmap-category-list::-webkit-scrollbar-thumb {
    background: #3a55c3;
    border-radius: 3px;
}

.editmap-category-list::-webkit-scrollbar-thumb:hover {
    background: #334aaa;
}

.editmap-category-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    will-change: transform;
    font-size: 16px;
    font-weight: 700;
    text-align: left;
    position: relative;
    background: #ffffff;
    color: #1a1a1a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.editmap-category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.13);
}

/* Pastille à droite (style Nobis) */
.editmap-category-btn::after {
    content: '';
    margin-left: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--editmap-sidebar-bg, #4a6cf7);
    flex-shrink: 0;
}

.editmap-category-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--editmap-sidebar-bg, #4a6cf7);
}

.editmap-category-icon-img {
    max-width: 90%;
    max-height: 70%;
    object-fit: contain;
}

/* .editmap-category-name {
    flex: 1;
    font-family: 'Fraunces', serif, system-ui;
} */

/* ========================================
   Barre d'icônes rondes
   ======================================== */

.editmap-icon-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    padding: 0 14px;
}

.editmap-icon-filter {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 16px;
    color: #333;
}

.editmap-icon-filter:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.editmap-icon-filter.active {
    background: #4299e1;
    color: white;
}

/* ========================================
   Titre de section
   ======================================== */

.editmap-section-title {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 0;
    margin-bottom: 20px;
    margin-top: 0;
    padding: 0 14px;
    display: flex;
    align-items: center;
    color: white;
}

.editmap-section-arrow {
    font-size: 20px;
    color: white;
    margin-left: 10px;
}

/* ========================================
   Liste des lieux
   ======================================== */

.editmap-sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    background: white;
    border-radius: 20px;
    margin: 0 14px 20px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Scrollbar personnalisée */
.editmap-sidebar-content::-webkit-scrollbar {
    width: 8px;
}

.editmap-sidebar-content::-webkit-scrollbar-track {
    border-radius: 3px;
}

.editmap-sidebar-content::-webkit-scrollbar-thumb {
    background: var(--editmap-sidebar-bg, #4a6cf7);
    border-radius: 3px;
}

.editmap-sidebar-content::-webkit-scrollbar-thumb:hover {
    background: var(--editmap-sidebar-bg, #4a6cf7);
    filter: brightness(0.85);
}

/* Message si aucun lieu */
.editmap-no-locations {
    padding: 40px 20px;
    text-align: center;
    color: #555;
    font-size: 14px;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

/* ========================================
   Éléments de lieu dans le panneau (Cards)
   ======================================== */

.editmap-location-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    cursor: pointer;
    transition: background 0.2s ease;
    background: white;
    border: none;
    margin-bottom: 0;
    border-bottom: 1px solid #f0f0f0;
}

.editmap-location-item:last-child {
    border-bottom: none;
}

.editmap-location-item:hover {
    background: #f9f9f9;
}

.editmap-location-item.active {
    background: #f5f5f5;
}

/* Image du lieu */
.editmap-location-icon {
    width: 65px;
    height: 65px;
    min-width: 65px;
    border-radius: 10px;
    overflow: hidden;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editmap-location-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Informations du lieu */
.editmap-location-info {
    flex: 1;
    min-width: 0;
}

.editmap-location-info h4 {
    margin: 0 0 3px 0;
    font-size: 17px;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editmap-location-excerpt {
    margin: 3px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.editmap-location-category {
    display: block;
    color: #aaa;
    font-size: 12px;
    margin-top: 2px;
}

/* ========================================
   Overlay (fond semi-transparent)
   ======================================== */

.editmap-sidebar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 1000;
    pointer-events: none;
    transition: background 0.3s ease;
}

.editmap-sidebar-overlay.visible {
    background: rgba(0, 0, 0, 0.5);
    pointer-events: all;
}

/* ========================================
   Popups Leaflet
   ======================================== */

.editmap-leaflet-popup .leaflet-popup-content-wrapper {
    border-radius: 16px;
    overflow: hidden;
    padding: 0;
    box-shadow: 0 !important;
}

.editmap-leaflet-popup .leaflet-popup-content {
    margin: 0;
    width: auto !important;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.editmap-leaflet-popup .leaflet-popup-content::-webkit-scrollbar {
    width: 4px;
}

.editmap-leaflet-popup .leaflet-popup-content::-webkit-scrollbar-track {
    background: transparent;
}

.editmap-leaflet-popup .leaflet-popup-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.editmap-leaflet-popup .leaflet-popup-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.35);
}

.editmap-leaflet-popup .leaflet-popup-tip {
    background: #ffffff;
}

/* Contenu du popup */
.editmap-popup {
    max-width: 350px;
    min-width: 250px;
}

.editmap-popup-content {
    padding: 18px;
}

.editmap-popup-content h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.editmap-popup-description {
    font-size: 14px;
    color: #2d3748;
    line-height: 1.6;
    margin-bottom: 12px;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
}

.editmap-popup-description p {
    margin: 0 0 10px 0;
}

.editmap-popup-description p:last-child {
    margin-bottom: 0;
}

.editmap-popup-description img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 10px 0;
}

/* Signature (prénom) */
.editmap-popup-signature {
    font-size: 14px;
    font-style: italic;
    color: #666;
    margin: 12px 0;
    text-align: right;
}

/* Témoignages liés */
.editmap-popup-testimonials {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.editmap-popup-testimonials-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #999;
    margin-bottom: 10px;
}

.editmap-popup-testimonial {
    padding: 10px 12px;
    background: #f7f7f7;
    border-radius: 8px;
    margin-bottom: 8px;
}

.editmap-popup-testimonial:last-child {
    margin-bottom: 0;
}

.editmap-popup-testimonial-text {
    font-size: 13px;
    color: #444;
    line-height: 1.5;
    margin-bottom: 4px;
}

.editmap-popup-testimonial .editmap-popup-signature {
    margin: 4px 0 0 0;
    font-size: 12px;
}

/* Notes supplémentaires */
.editmap-popup-notes {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 13px;
    color: #4a5568;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
}

.editmap-popup-notes strong {
    color: #2d3748;
    font-weight: 600;
}

/* ========================================
   Marqueurs personnalisés
   ======================================== */

.editmap-custom-marker {
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Marker catégorie (bulle avec image de la catégorie) */
.editmap-cat-marker {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    background-color: #ffffff;
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
    transition: transform 0.2s ease, filter 0.2s ease;
}

/* Transition fluide pour les overlays d'image */
.editmap-image-overlay {
    transition: opacity 0.3s ease;
}

/* Effet de survol sur les marqueurs */
.leaflet-marker-icon.editmap-marker-hover {
    filter: drop-shadow(0 0 10px rgba(66, 153, 225, 0.8));
    transform: scale(1.15);
    z-index: 1000 !important;
    will-change: filter, transform;
}

.editmap-custom-marker.editmap-marker-hover {
    border-color: #4299e1;
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.5);
}

/* ========================================
   Contrôles Leaflet (Zoom, etc.)
   ======================================== */

.editmap-map .leaflet-control-zoom {
    border: none;
    border-radius: 40px;
    background: var(--editmap-btn-controls, #ed1445);
    overflow: hidden;
}

.editmap-map .leaflet-control-zoom a {
    width: 50px;
    height: 50px;
    line-height: 50px;
    font-size: 24px;
    border: none;
    color: #ffffff;
    background: transparent;
    transition: background 0.3s ease, transform 0.3s ease;
}

.editmap-map .leaflet-control-zoom a:hover {
    background: var(--editmap-btn-controls, #ed1445);
    filter: brightness(0.85);
    color: #ffffff;
    transform: scale(1.05);
}

.editmap-map .leaflet-bar a:first-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.editmap-map .editmap-form-control {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--editmap-btn-controls, #ed1445);
    overflow: hidden;
    margin-top: 10px;
    margin-bottom: 6px;
}

.editmap-map .editmap-form-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 50px !important;
    height: 50px !important;
    color: #ffffff;
    background: transparent;
    border: none !important;
    border-bottom: none !important;
    border-radius: 50%;
    transition: background 0.3s ease, transform 0.3s ease;
}

.editmap-map .editmap-form-btn:hover {
    background: var(--editmap-btn-controls, #ed1445) !important;
    filter: brightness(0.85);
    color: #ffffff;
    transform: scale(1.05);
}

/* Positionner en bas à droite - Forcer la position */
.editmap-map .leaflet-top.leaflet-left {
    top: auto !important;
    left: auto !important;
    bottom: 35px !important;
    right: 20px !important;
}

/* ========================================
   Attribution Leaflet
   ======================================== */

.editmap-map .leaflet-control-attribution {
    background: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px 0 0 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.editmap-map .leaflet-control-attribution a {
    color: #4299e1;
    text-decoration: none;
}

.editmap-map .leaflet-control-attribution a:hover {
    text-decoration: underline;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1024px) {
    .editmap-sidebar {
        width: 360px;
    }
}

@media (max-width: 768px) {
    .editmap-menu-toggle {
        padding: 10px 20px;
        font-size: 14px;
        top: 15px;
        left: 15px;
    }

    .editmap-category-filter {
        padding-top: 50px;
    }

    .editmap-category-btn {
        font-size: 14px;
        padding: 9px 14px;
    }

    .editmap-sidebar-content {
        padding: 0 12px 20px;
    }

    .editmap-icon-filters {
        padding: 0 12px;
    }

    .editmap-section-title {
        padding: 0 12px;
        font-size: 25px;
    }

    .editmap-location-icon {
        width: 48px;
        height: 48px;
        min-width: 48px;
    }

    .editmap-map .leaflet-top.leaflet-left {
        bottom: 50px !important;
        right: 16px !important;
    }

    .editmap-map .leaflet-control-zoom a {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 20px;
    }

    .editmap-map .editmap-form-control {
        width: 40px;
        height: 40px;
        margin-top: 8px;
        margin-bottom: 4px;
    }

    .editmap-map .editmap-form-btn {
        width: 40px !important;
        height: 40px !important;
    }

    .editmap-map .editmap-form-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* ========================================
   Animations
   ======================================== */

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.editmap-location-item,
.editmap-category-btn {
    animation: slideInFromLeft 0.3s ease-out;
}

/* ========================================
   Accessibilité
   ======================================== */

.editmap-location-item:focus,
.editmap-category-btn:focus,
.editmap-menu-toggle:focus,
.editmap-sidebar-close:focus {
    outline: none;
}

/* Réduire les animations pour accessibilité */
@media (prefers-reduced-motion: reduce) {
    .editmap-location-item,
    .editmap-category-btn,
    .editmap-sidebar,
    .editmap-location-icon img,
    .leaflet-marker-icon.editmap-marker-hover {
        animation: none;
        transition: none;
    }
}

/* ========================================
   Empêcher le défilement du body quand le menu est ouvert
   ======================================== */

body.editmap-menu-open {
    overflow: hidden;
}

/* Supprimer la scrollbar verticale sur les pages avec la carte */
html:has(.editmap-container) {
    overflow: hidden;
}
