/* ===================================
   Styles pour la Carte Interactive
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --dark-text: #1e293b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--dark-text);
    background-color: var(--light-bg);
}

/* ===================================
   En-tête
   =================================== */

.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: var(--white);
    padding: 2rem 0;
    box-shadow: var(--shadow-lg);
}

.header-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header-content .subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* ===================================
   Conteneur
   =================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ===================================
   Contenu principal
   =================================== */

.main-content {
    padding: 2rem 0;
    flex: 1;
}

/* ===================================
   Barre d'outils
   =================================== */

.toolbar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
    background: var(--white);
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.toolbar-spacer {
    flex: 1;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.loading::before {
    content: '';
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ===================================
   Boutons
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: var(--light-bg);
    color: var(--dark-text);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--white);
    border-color: var(--primary-color);
}

.icon {
    font-size: 1.125rem;
}

/* ===================================
   Conteneur de la carte
   =================================== */

.map-container {
    position: relative;
    width: 100%;
    height: 600px;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    background-color: var(--white);
}

#map {
    width: 100%;
    height: 100%;
}

/* ===================================
   Panneau d'information
   =================================== */

.info-panel {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 300px;
    max-height: 400px;
    background-color: var(--white);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.info-panel.active {
    display: block;
}

.close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background-color: var(--light-bg);
    color: var(--dark-text);
}

.info-panel-content {
    padding-top: 1.5rem;
}

.info-panel-content h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.info-panel-content p {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

/* ===================================
   Grille d'information
   =================================== */

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

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

.info-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.info-card p {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.info-card ul {
    list-style: none;
    padding-left: 0;
}

.info-card li {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.info-card li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* ===================================
   Section de description
   =================================== */

.description-section {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.description-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
}

.description-content h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--dark-text);
}

.description-content p {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.description-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1rem;
}

.description-content li {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.description-content li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* ===================================
   Pied de page
   =================================== */

.footer {
    background-color: var(--dark-text);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
    margin-top: 2rem;
}

.footer p {
    font-size: 0.875rem;
    opacity: 0.8;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.footer a:hover {
    opacity: 0.8;
}

/* ===================================
   Styles Leaflet personnalisés
   =================================== */

.leaflet-container {
    font-family: inherit;
}

.leaflet-popup-content-wrapper {
    background-color: var(--white);
    border-radius: 0.375rem;
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
    font-size: 0.875rem;
    color: var(--dark-text);
}

.leaflet-tooltip {
    background-color: var(--dark-text);
    color: var(--white);
    border: none;
    border-radius: 0.375rem;
    box-shadow: var(--shadow);
}

/* ===================================
   Responsive
   =================================== */

@media (max-width: 768px) {
    .header-content h1 {
        font-size: 1.5rem;
    }

    .header-content .subtitle {
        font-size: 0.875rem;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-spacer {
        display: none;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .map-container {
        height: 400px;
    }

    .info-panel {
        width: calc(100% - 2rem);
        max-height: 300px;
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .description-section {
        padding: 1rem;
    }

    .description-section h2 {
        font-size: 1.5rem;
    }

    .description-content h3 {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.25rem;
    }

    .map-container {
        height: 300px;
    }

    .info-panel {
        width: calc(100% - 1rem);
        max-height: 250px;
        bottom: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
    }
}
