/* === Louis Massignon Map - Styles === */

#lm-map-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    color: #2d3436;
}

#lm-map-header {
    text-align: center;
    padding: 20px 15px 10px;
}

#lm-map-header h2 {
    font-size: 1.6em;
    margin: 0 0 5px;
    color: #2d3436;
    font-weight: 700;
}

.lm-map-subtitle {
    font-size: 0.95em;
    color: #636e72;
    margin: 0;
}

/* Container principal */
#lm-map-container {
    display: flex;
    gap: 0;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* === Sidebar === */
#lm-map-sidebar {
    width: 300px;
    min-width: 300px;
    max-height: 700px;
    overflow-y: auto;
    border-right: 1px solid #dfe6e9;
    background: #fafafa;
    padding: 0;
}

.lm-filter-section {
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

.lm-filter-title {
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #2d3436;
    display: block;
    margin-bottom: 8px;
}

.lm-filter-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.lm-filter-title-row .lm-filter-title {
    margin-bottom: 0;
}

.lm-toggle-btn {
    background: none;
    border: 1px solid #b2bec3;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.75em;
    color: #636e72;
    cursor: pointer;
    transition: all 0.2s;
}

.lm-toggle-btn:hover {
    background: #dfe6e9;
    color: #2d3436;
}

/* Recherche */
#lm-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dfe6e9;
    border-radius: 6px;
    font-size: 0.9em;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

#lm-search:focus {
    border-color: #74b9ff;
    box-shadow: 0 0 0 3px rgba(116,185,255,0.15);
}

/* Checkboxes */
.lm-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 0.85em;
    cursor: pointer;
    line-height: 1.3;
}

.lm-checkbox-label input[type="checkbox"] {
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
}

.lm-cat-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* Couleurs des catégories */
.lm-cat-color[data-cat="Naissance / Enfance"] { background: #e84393; }
.lm-cat-color[data-cat="Études / Recherche"] { background: #00b894; }
.lm-cat-color[data-cat="Mission diplomatique"] { background: #0984e3; }
.lm-cat-color[data-cat="Pèlerinage / Spirituel"] { background: #6c5ce7; }
.lm-cat-color[data-cat="Conférence / Académique"] { background: #fdcb6e; }
.lm-cat-color[data-cat="Militaire"] { background: #636e72; }
.lm-cat-color[data-cat="Résidence / Séjour"] { background: #e17055; }
.lm-cat-color[data-cat="Autre"] { background: #a29bfe; }

/* Pays list */
#lm-pays-list {
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}

#lm-pays-list::-webkit-scrollbar {
    width: 5px;
}

#lm-pays-list::-webkit-scrollbar-thumb {
    background: #b2bec3;
    border-radius: 3px;
}

/* Slider année */
#lm-year-display {
    text-align: center;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 12px;
    color: #2d3436;
}

#lm-year-slider {
    margin: 0 8px 8px;
}

/* noUiSlider custom */
#lm-year-slider .noUi-connect {
    background: #0984e3;
}

#lm-year-slider .noUi-handle {
    border-radius: 50%;
    width: 20px !important;
    height: 20px !important;
    right: -10px !important;
    top: -8px !important;
    border: 2px solid #0984e3;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    cursor: pointer;
}

#lm-year-slider .noUi-handle::before,
#lm-year-slider .noUi-handle::after {
    display: none;
}

#lm-year-slider .noUi-target {
    background: #dfe6e9;
    border: none;
    box-shadow: none;
    height: 6px;
}

/* Compteur */
.lm-counter-section {
    text-align: center;
    font-size: 0.85em;
    color: #636e72;
    background: #f0f0f0;
}

#lm-visible-count {
    font-weight: 700;
    color: #0984e3;
}

/* === Carte === */
#lm-map {
    flex: 1;
    min-height: 500px;
    z-index: 1;
}

/* Popup Leaflet */
.lm-popup {
    max-width: 350px;
    font-size: 0.88em;
    line-height: 1.5;
}

.lm-popup-title {
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 4px;
    color: #2d3436;
}

.lm-popup-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.lm-popup-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.78em;
    font-weight: 600;
    color: #fff;
}

.lm-popup-year {
    font-size: 0.85em;
    color: #636e72;
    font-weight: 600;
}

.lm-popup-desc {
    color: #2d3436;
    margin-bottom: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.lm-popup-video {
    margin-top: 8px;
}

.lm-popup-video a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #d63031;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85em;
}

.lm-popup-video a:hover {
    text-decoration: underline;
}

/* Leaflet popup override */
.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
}

.leaflet-popup-content {
    margin: 14px 16px !important;
    max-height: 350px;
    overflow-y: auto;
}

/* === Responsive === */
@media (max-width: 900px) {
    #lm-map-container {
        flex-direction: column;
    }

    #lm-map-sidebar {
        width: 100%;
        min-width: unset;
        max-height: 300px;
        border-right: none;
        border-bottom: 1px solid #dfe6e9;
    }

    #lm-map {
        min-height: 450px;
    }
}

@media (max-width: 600px) {
    #lm-map-header h2 {
        font-size: 1.2em;
    }

    .lm-popup {
        max-width: 260px;
    }
}

/* Sidebar scrollbar */
#lm-map-sidebar::-webkit-scrollbar {
    width: 6px;
}

#lm-map-sidebar::-webkit-scrollbar-thumb {
    background: #b2bec3;
    border-radius: 3px;
}
