/* css/monde.css - Styles spécifiques pour la page monde */

/* Container principal */
.main-container {
    max-width: 1800px;
    margin: 2rem auto;
    padding: 0 2rem;
    flex: 1;
}

/* Barre de recherche */
.search-section {
    margin-bottom: 2rem;
}

.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3.5rem;
    font-size: 1rem;
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* Carte Leaflet */
.map-wrapper {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
}

#map {
    height: 700px;
    width: 100%;
    background: #f0f8ff;
    animation: mapZoomIn 1.5s ease-out;
}

/* Contrôles */
.controls-section {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.control-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 12px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.control-btn.active {
    background: var(--accent);
    color: white;
}

/* Cards d'information */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.info-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.info-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.info-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.info-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.info-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Popup personnalisé pour Leaflet */
.custom-popup {
    font-family: inherit;
}

.popup-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.popup-time {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.popup-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Marqueurs personnalisés */
.city-marker {
    background: white;
    border: 3px solid var(--accent);
    border-radius: 50%;
    width: 12px;
    height: 12px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.city-marker:hover {
    transform: scale(1.5);
    box-shadow: var(--shadow-lg);
}

.city-marker.favorite {
    background: var(--warning);
    border-color: var(--warning);
}

.city-marker.search-result {
    background: var(--danger);
    border-color: var(--danger);
    animation: pulse 2s infinite;
}

@keyframes markerAppear {
    from {
        opacity: 0;
        transform: scale(0) rotate(360deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes mapZoomIn {
    0% {
        opacity: 0;
        transform: scale(0.8) rotate(10deg);
    }
    50% {
        transform: scale(1.05) rotate(-2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toast.show {
    transform: translateX(0);
}

/* Loading spinner */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: var(--radius);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .main-container {
        padding: 0 1rem;
        margin: 1rem auto;
    }

    #map {
        height: 400px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .controls-section {
        justify-content: center;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        transform: translateY(100px);
    }

    .toast.show {
        transform: translateY(0);
    }
}

/* Écrans larges */
@media (min-width: 1920px) {
    .main-container {
        max-width: 2000px;
    }

    #map {
        height: 800px;
    }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    .map-wrapper {
        background: var(--bg-primary);
    }

    .control-btn {
        background: var(--bg-primary);
        color: var(--text-primary);
    }

    .control-btn:hover {
        background: var(--bg-tertiary);
    }

    .control-btn.active {
        background: var(--accent);
        color: white;
    }

    .info-card {
        background: var(--bg-primary);
    }

    .toast {
        background: var(--bg-primary);
        color: var(--text-primary);
    }
}

/* === FIXES À AJOUTER À LA FIN DE monde.css === */

/* Fix pour éliminer la marge blanche sous la carte */

/* 1. Ajuster le container principal */
.main-container {
    margin-top: 1rem; /* Réduire de 2rem à 1rem */
    margin-bottom: 0; /* Éliminer la marge du bas */
    padding-bottom: 1rem; /* Juste un peu de padding */
}

/* 2. Optimiser la hauteur de la carte */
.map-wrapper {
    margin-bottom: 1rem; /* Réduire l'espace sous la carte */
}

#map {
    height: 600px; /* Réduire de 700px à 600px */
}

/* 3. Réduire l'espacement des sections */
.controls-section {
    margin-top: 1rem; /* Réduire de 1.5rem */
    margin-bottom: 0.5rem; /* Ajouter une petite marge en bas */
}

.info-grid {
    margin-top: 1.5rem; /* Réduire de 2rem */
    margin-bottom: 1.5rem; /* Définir la marge du bas */
}

/* 4. Mobile : ajustements spécifiques */
@media (max-width: 768px) {
    /* Override du padding de main depuis style.css */
    body main {
        padding: 1rem 0; /* Réduire le padding vertical */
    }
    
    .main-container {
        margin-top: 0.5rem;
        padding: 0 0.75rem; /* Réduire le padding horizontal */
    }
    
    #map {
        height: 450px; /* Hauteur fixe optimisée pour mobile */
        /* Supprimer le 60vh qui causait des problèmes */
    }
    
    .map-wrapper {
        margin-bottom: 0.75rem;
    }
    
    .controls-section {
        margin-top: 0.75rem;
        padding: 0 0.5rem;
    }
    
    .info-grid {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
    
    /* S'assurer que la section SEO ne crée pas d'espace */
    .seo-content {
        margin-bottom: 1rem;
    }
}

/* 5. Très petits écrans */
@media (max-width: 480px) {
    #map {
        height: 400px; /* Encore plus compact */
    }
    
    .main-container {
        padding: 0 0.5rem;
    }
}

/* 6. Fix pour éviter le scroll horizontal */
body {
    overflow-x: hidden;
}

/* 7. S'assurer que le footer ne crée pas d'espace */
body > footer {
    margin-top: auto; /* Pousser le footer en bas */
}

/* === ALTERNATIVE PLUS RADICALE (si le problème persiste) === */

@media (max-width: 768px) {
    body {
        min-height: auto;
    }
    
    body main {
        flex: none;
        padding: 0;
    }
    
    .main-container {
        margin: 0;
        padding: 0.5rem;
    }
    
    #map {
        height: calc(100vh - 300px); // Ajuster selon la hauteur des autres éléments
        max-height: 500px;
        min-height: 350px;
    }
}
*/