﻿/* Styles de base */
body {
    overflow-x: hidden;
}

/* Conteneur des résultats */
.results-container {
    width: 100%;
    min-height: 100vh;
}

/* Conteneur de la carte - toujours visible en arrière-plan */
.map-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease-in-out;
}

/* Contrôles mobiles */
.mobile-controls {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    width: auto;
    text-align: center;
}

/* Styles desktop (≥992px) */
@media (min-width: 992px) {
    .results-container {
        width: 60%;
        overflow-y: auto;
        position: relative;
        z-index: 10;
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(5px);
    }

    .map-container {
        /*position: static;*/
        display : block;
        position: sticky;
        width: 40%;
        height: 100vh;
        opacity: 1;
        pointer-events: auto;
        z-index: 1;
    }

    #map {
        height: calc(100vh - 2rem) !important;
    }
}

/* Styles mobile (<992px) */
@media (max-width: 991.98px) {
    .results-container {
        position: relative;
        z-index: 10;
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(5px);
        transition: all 0.3s ease-in-out;
    }

    .map-container.mobile-visible {
        opacity: 1;
        pointer-events: auto;
        z-index: 1030;
    }

    /* Animation de transition */
    .map-container, .results-container {
        transition: all 0.3s ease-in-out;
    }

    /* Ajustements quand la carte est visible */
    body.map-visible .results-container {
        opacity: 0.1;
        pointer-events: none;
    }

    body.map-visible .mobile-controls {
        position: fixed;
        z-index: 1050;
    }
}

/* Style pour le bouton toggle */
#toggleMapList {
    transition: transform 0.3s ease-in-out;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
}

#toggleMapList:hover {
    transform: scale(1.05);
}

/* Ajustement de la hauteur de la carte */
#map {
    min-height: 400px;
    height: 100%;
}

/* Styles pour la pagination et le chargement */
.cardsss {
    transition: opacity 0.3s ease-in-out;
}

.pagination {
    justify-content: center;
    margin-top: 2rem;
}

.pagination .page-link {
    border-radius: 0.375rem;
    margin: 0 0.25rem;
    border: 1px solid #dee2e6;
    color: #6c757d;
}

.pagination .page-item.active .page-link {
    background-color: #5143d9;
    border-color: #0d6efd;
    color: white;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #0d6efd;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
    cursor: not-allowed;
}

/* Animation de chargement pour les cartes */
.cardsss[style*="opacity: 0.6"] {
    position: relative;
}

.cardsss[style*="opacity: 0.6"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2rem;
    height: 2rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}