/* ==========================================================================
   7. PAGE MAP : CONFIGURATION LUXE & STABILITÉ
   ========================================================================== */

/* --- 7.1. STRUCTURE GLOBALE --- */
html, body.map-page { 
    height: 100%; 
    margin: 0; 
    padding: 0; 
    overflow: hidden; 
    background-color: var(--beige); 
    font-family: 'Inter', sans-serif;
}

.map-layout {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

#map { 
    width: 100%;
    height: 100%;
    background-color: #010813; /* Fond très sombre assorti à ton thème */
}

/* --- 7.2. AJUSTEMENTS MOTEUR MAPBOX (UI) --- */

.mapboxgl-canvas-container, 
.mapboxgl-canvas {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Masquage des éléments par défaut pour un look épuré */
.mapboxgl-ctrl-bottom-right, 
.mapboxgl-ctrl-top-right,
.mapboxgl-ctrl-attrib {
    display: none !important;
}

.mapboxgl-ctrl-bottom-left {
    z-index: 10;
    margin: 0 10px 10px 10px !important; 
}

/* --- 7.3. SIDEBAR DESKTOP (PC) --- */
.map-sidebar {
    position: absolute; 
    top: 130px; 
    left: 30px; 
    width: 380px; 
    z-index: 10; 
    max-height: calc(100vh - 180px);
    background: rgba(255, 255, 255, 0.1); 
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px); 
    padding: 10px; 
    border-radius: 40px;
    box-shadow: var(--shadow-lux);
}

.sidebar-inner {
    background-color: var(--beige); 
    border-radius: 32px; 
    padding: 25px; 
    height: 100%; 
    overflow-y: auto;
}

.filter-section h3, 
.results-preview h3 {
    font-size: 0.8rem; 
    text-transform: uppercase; 
    letter-spacing: 2px;
    color: var(--text-light); 
    margin-bottom: 20px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif; /* Titres premium */
    font-weight: 800;
}

/* --- 7.4. COMPOSANTS SIDEBAR (TAGS & CARTES) --- */
.filter-tags { 
    display: grid; 
    grid-template-columns: 1fr 1fr;
    gap: 12px; 
    margin-bottom: 30px; 
}

.tag {
    padding: 12px 15px; 
    border-radius: 15px; 
    border: 1px solid rgba(28, 59, 110, 0.15);
    background: white; 
    font-size: 0.7rem; 
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer; 
    transition: all 0.3s ease;
    text-align: center;
}

/* Couleurs spécifiques aux catégories sur les tags */
.tag[data-category="hotel"].active { border-color: var(--gold); background: var(--gold); color: white; }
.tag[data-category="restaurant"].active { border-color: var(--primary); background: var(--primary); color: white; }
.tag[data-category="club"].active { border-color: var(--accent); background: var(--accent); color: white; }
.tag[data-category="bar"].active { 
    border-color: var(--bar-color); 
    background: var(--bar-color); 
    color: white; 
}

.mini-card {
    display: flex; 
    gap: 15px; 
    align-items: center; 
    padding: 10px;
    border-radius: 18px; 
    margin-bottom: 12px; 
    cursor: pointer; 
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.mini-card:hover { 
    background: white; 
    transform: translateX(8px); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.mini-card img { 
    width: 70px; 
    height: 60px; 
    border-radius: 12px; 
    object-fit: cover; 
}

.mini-card h4 { 
    font-family: 'Montserrat', sans-serif; /* Titres premium */
    font-weight: 800;
    font-size: 0.95rem; 
    color: var(--primary); 
    margin: 0; 
    font-weight: 800;
}

/* --- 7.5. MARQUEURS CUSTOM (STYLE GOUTTE) --- */
.mapboxgl-marker {
    z-index: 1 !important;
    transition: none !important;
}

.marker-container {
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    filter: drop-shadow(0 8px 6px rgba(0,0,0,0.4));
    
}

.marker-container.user-location-marker {
    /* On agrandit le container pour laisser de la place à la goutte de 38px + son ombre */
    width: 48px; 
    height: 48px;
    z-index: 100 !important; /* Priorité maximale */
}

/* LA RÈGLE D'OR : On définit la forme UNE SEULE FOIS pour tout le monde */
.custom-marker {
    box-sizing: border-box !important; /* Force la bordure à rester à l'intérieur des 26px */
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    border-radius: 50% 50% 50% 0 !important; /* La forme de goutte */
    transform: rotate(10deg) !important;    /* TON STYLE VISUEL 10° */
    cursor: pointer;
    border: 2px solid white; /* Bordure par défaut */
    flex-shrink: 0; /* Empêche l'écrasement */
    box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), z-index 0s linear 0.3s;
}

/* --- STYLE SPÉCIFIQUE : UTILISATEUR (BLANC & NOIR) --- */
/* On change UNIQUEMENT les couleurs, rien d'autre */
.marker-user {
    /* Couleurs Luxe (Noir & Or) */
    background-color: #white !important;
    border: 3px solid var(--gold) !important; /* Si var(--gold) ne marche pas, mets #d4af37 */
    
    /* C'EST ICI QUE LA MAGIE OPÈRE : On casse le carré */
    width: 20px !important;  /* Plus étroit */
    height: 30px !important; /* Beaucoup plus haut */
    
    /* La forme et l'orientation */
    border-radius: 50% 50% 50% 0 !important;
    transform: rotate(-45deg) !important; /* Pointe vers le bas */
    
    /* Centrage du point */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: relative;
    cursor: default !important;
    
    /* Relief */
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8) !important;
}


/* Gestion du survol */
.marker-container:not(.user-location-marker) .custom-marker:hover {
    transform: rotate(10deg) scale(1.2) !important;
}

.user-location-marker {
    pointer-events: none;
    z-index: 20 !important; /* Passe devant les pépites */
}

/* Couleurs des autres pépites */
.marker-hotel { background-color: var(--gold) !important; }
.marker-restaurant { background-color: var(--primary) !important; }
.marker-club { background-color: var(--accent) !important; }
.marker-bar { background-color: var(--bar-color) !important; }

/* --- 7.6. POPUPS MAPBOX (STRUCTURE ÉDITORIALE) --- */
.mapboxgl-popup {
    z-index: 9999 !important; /* Priorité maximale sur la carte */
}

.mapboxgl-popup-content {
    background: var(--beige) !important;
    border-radius: 25px !important;
    padding: 0 !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2) !important;
    width: 240px !important;
    overflow: hidden;
}

.popup-container {
    display: flex;
    flex-direction: column;
    padding-bottom: 12px; /* Donne de l'air entre le contenu et le bord bas de la bulle */
}

.popup-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    color: #1C3B6E; /* Ton bleu primary */
    padding: 18px 10px; /* Espace pour le titre en haut */
    margin: 0;
    text-align: center;
    letter-spacing: 1px;
}

.popup-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block; /* Supprime l'espace vide sous l'image */
}

.popup-footer {
    display: flex;
    justify-content: space-between; /* Écarte les deux éléments aux extrémités */
    align-items: center;
    margin-top: 18px;
    padding: 0 5px;
}

.popup-category {
    font-family: 'Inter', sans-serif;
    font-style: italic; /* Style manuscrit/italique du rendu attendu */
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
}

.popup-category.cat-hotel { color: var(--gold); }
.popup-category.cat-restaurant { color: var(--primary); }
.popup-category.cat-club { color: var(--accent); }
.popup-category.cat-bar { color: var(--bar-color); }
/* Couleurs de texte pour les catégories dans le popup */
.cat-hotel { color: var(--gold); }
.cat-restaurant { color: var(--primary); }
.cat-club { color: var(--accent); }
.cat-bar { color: var(--bar-color)}

.popup-link-discover {
    display: inline-block;
    color: var(--gold); /* Ton doré */
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    text-decoration: none !important; /* Force la suppression du soulignement */
    border: none !important;
    transition: all 0.4s ease;
    transform-origin: left;
}
.popup-link-discover:focus,
.popup-link-discover:active {
    outline: none !important;
    box-shadow: none !important;
}

.popup-link-discover:hover {
    color: var(--gold);
    transform: scale(1.15); /* Petit décalage vers la droite au survol */
}

/* --- 7.7. RESPONSIVE MOBILE --- */
.mobile-filter-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1500;
    white-space: nowrap;
    display: none;
}

@media (max-width: 768px) {
    .map-sidebar {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100vw;
        height: 40vh;
        z-index: 1100;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 0;
        border-radius: 30px 30px 0 0;
        background: transparent;
        backdrop-filter: none;
    }

    .map-sidebar.active {
        transform: translateY(0);
    }

    .sidebar-inner {
        height: 100%;
        border-radius: 30px 30px 0 0;
        padding: 20px;
        box-shadow: 0 -10px 30px rgba(0,0,0,0.15);
    }

    .map-sidebar.active ~ .mobile-filter-btn {
        display: none !important;
    }

    .mobile-filter-btn {
        display: flex !important; 
        background: var(--primary); 
        color: white;
        padding: 16px 30px; 
        border-radius: 50px; 
        border: none;
        font-weight: 700; 
        gap: 10px; 
        box-shadow: 0 10px 40px rgba(0,0,0,0.4);
        text-transform: uppercase;
        font-size: 0.85rem;
        letter-spacing: 1px;
    }

    .filter-section h3, .results-preview h3 {
        text-align: center;
    }

    .filter-tags {
        justify-content: center;
    }
}