/* =====================================================
   RUINES DZ - CARTE INTERACTIVE
===================================================== */

.ruines-map-page {
    color: #e8edf5;
    padding: 25px;
    font-family: inherit;
}

/* HEADER */

.map-header {
    background: linear-gradient(135deg, #101b2b, #172b43);
    border: 1px solid #263d59;
    border-radius: 14px;
    padding: 25px;
    margin-bottom: 25px;
}

.map-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.map-title {
    display: flex;
    align-items: center;
    gap: 18px;
}

.map-title-icon {
    width: 58px;
    height: 58px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #203b59;
    border: 1px solid #355779;
    border-radius: 12px;
    font-size: 30px;
}

.map-title h1 {
    margin: 0;
    font-size: 28px;
    letter-spacing: 2px;
    font-weight: 900;
}

.map-title p {
    margin: 6px 0 0;
    color: #9eafc5;
    font-size: 14px;
}

.map-header-badge {
    background: rgba(30, 60, 85, 0.7);
    border: 1px solid #365773;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #b9cde0;
}

.map-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #56d18b;
    border-radius: 50%;
    margin-right: 8px;
}

/* LAYOUT */

.map-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 20px;
}

/* SIDEBAR */

.map-sidebar {
    background: #101a28;
    border: 1px solid #26384d;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.map-sidebar-header h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
}

.map-sidebar-header p {
    margin: 6px 0 20px;
    font-size: 13px;
    color: #8fa3ba;
}

/* SEARCH */

.map-search {
    position: relative;
    margin-bottom: 25px;
}

.map-search label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #a8b9cc;
}

.map-search input {
    width: 100%;
    box-sizing: border-box;
    background: #0b1320;
    border: 1px solid #31455d;
    border-radius: 8px;
    padding: 12px;
    color: white;
    outline: none;
}

.map-search input:focus {
    border-color: #4b8cc9;
    box-shadow: 0 0 0 2px rgba(75, 140, 201, 0.15);
}

#mapSearchResults {
    display: none;
    position: absolute;
    z-index: 1000;
    top: 100%;
    left: 0;
    right: 0;
    background: #101a28;
    border: 1px solid #31455d;
    border-radius: 8px;
    margin-top: 5px;
    overflow: hidden;
    max-height: 220px;
    overflow-y: auto;
}

.map-search-result {
    display: block;
    width: 100%;
    padding: 11px;
    background: transparent;
    color: #e8edf5;
    border: none;
    text-align: left;
    cursor: pointer;
}

.map-search-result:hover {
    background: #203750;
}

.map-search-empty {
    padding: 12px;
    color: #899caf;
    font-size: 13px;
}

/* FILTERS */

.map-filter-section {
    margin-bottom: 25px;
}

.map-filter-section h3 {
    color: #69839e;
    font-size: 10px;
    letter-spacing: 1.5px;
    margin: 0 0 13px;
}

.map-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #152235;
    border: 1px solid #22374e;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: 0.2s;
}

.map-filter:hover {
    background: #1c3048;
}

.map-filter input {
    accent-color: #4d91d1;
}

.filter-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #203750;
    border-radius: 6px;
    font-size: 15px;
}

/* INFO */

.map-info-box {
    display: flex;
    gap: 12px;
    background: #172536;
    border: 1px solid #344a60;
    border-radius: 8px;
    padding: 13px;
    margin-top: auto;
}

.map-info-icon {
    font-size: 20px;
}

.map-info-box strong {
    display: block;
    font-size: 12px;
    margin-bottom: 5px;
}

.map-info-box p {
    color: #9baec1;
    font-size: 11px;
    line-height: 1.5;
    margin: 0;
}

.map-sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-top: 1px solid #26384d;
    padding-top: 18px;
    margin-top: 20px;
    font-size: 10px;
    font-weight: 800;
    color: #71869d;
    letter-spacing: 1px;
}

/* MAIN */

.map-main {
    background: #101a28;
    border: 1px solid #26384d;
    border-radius: 12px;
    overflow: hidden;
    min-width: 0;
}

.map-toolbar {
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    background: #152235;
    border-bottom: 1px solid #26384d;
}

.map-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.map-toolbar-label {
    color: #71869d;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

.map-toolbar-value {
    font-size: 12px;
    font-weight: 800;
}

.map-reset-button {
    background: #203750;
    color: #d9e7f5;
    border: 1px solid #365775;
    padding: 9px 13px;
    border-radius: 7px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
}

.map-reset-button:hover {
    background: #2c4d70;
}

/* CARTE */

#chernarusMap {
    width: 100%;
    height: 75vh;
    min-height: 500px;
    background: #080e17;
    position: relative;
}

.leaflet-container {
    background: #080e17;
    font-family: inherit;
}

.leaflet-control-zoom a {
    background: #152235 !important;
    color: white !important;
    border-color: #31455d !important;
}

.leaflet-popup-content-wrapper {
    background: #101a28;
    color: #e8edf5;
    border: 1px solid #31455d;
    border-radius: 8px;
}

.leaflet-popup-tip {
    background: #101a28;
}

.ruines-popup h3 {
    margin: 0 0 7px;
    font-size: 15px;
}

.ruines-popup span {
    color: #9baec1;
    font-size: 12px;
}

/* MARQUEURS */

.ruines-map-marker {
    background: transparent;
    border: none;
}

.marker-icon {
    box-sizing: border-box;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid #ffffff;
    font-size: 9px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.ruines-map-marker.military .marker-icon {
    background: #6e4e25;
}

.ruines-map-marker.train .marker-icon {
    background: #245c83;
}

.ruines-map-marker.police .marker-icon {
    background: #315a92;
}

.ruines-map-marker.city .marker-icon {
    background: #455d70;
}

/* LÉGENDE */

.map-bottom-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 15px 20px;
    background: #152235;
    border-top: 1px solid #26384d;
}

.map-bottom-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #b0c1d3;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.military-dot {
    background: #a87c43;
}

.train-dot {
    background: #438ac0;
}

.police-dot {
    background: #5a8bd0;
}

.city-dot {
    background: #829aaf;
}

/* CHARGEMENT */

.map-loading,
.map-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    color: #b0c1d3;
}

.map-loading-icon,
.map-error-icon {
    font-size: 45px;
    margin-bottom: 15px;
}

.map-loading h2,
.map-error h2 {
    color: #e8edf5;
    font-size: 20px;
}

.map-loading p,
.map-error p {
    font-size: 13px;
    line-height: 1.7;
}

.map-error strong {
    color: #70a9dd;
}

/* RESPONSIVE */

@media (max-width: 900px) {

    .map-layout {
        grid-template-columns: 1fr;
    }

    .map-sidebar {
        order: 2;
    }

    .map-main {
        order: 1;
    }

    #chernarusMap {
        height: 60vh;
        min-height: 400px;
    }

    .map-header-content {
        flex-direction: column;
        align-items: flex-start;
    }

}

@media (max-width: 600px) {

    .ruines-map-page {
        padding: 12px;
    }

    .map-title h1 {
        font-size: 22px;
    }

    .map-header {
        padding: 18px;
    }

    .map-toolbar {
        padding: 0 10px;
    }

    .map-reset-button {
        font-size: 10px;
        padding: 8px;
    }

    #chernarusMap {
        min-height: 350px;
    }

}
/* =====================================================
   RUINES DZ - MARQUEURS ET GESTION STAFF
===================================================== */
.map-filter-section { margin: 4px 0 22px; }
.map-staff-note { padding: 12px 13px; margin: 0 0 18px; border: 1px solid #496b4e; border-radius: 8px; background: rgba(49, 91, 55, .18); color: #d8ead7; font-size: 12px; line-height: 1.55; }
.map-staff-note strong { display: inline-block; margin-bottom: 4px; color: #a9e0ad; }
.map-staff-note span { color: #b5c8b6; }
.map-player-note { border-color: #344a60; background: #172536; color: #c6d4e2; }
.map-player-note strong { color: #e0eaf4; }
.map-player-note span { color: #9baec1; }
.ruines-map-marker { background: transparent; border: 0; }
.ruines-map-marker .marker-icon { box-sizing: border-box; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border: 1px solid #fff; border-radius: 50%; font-size: 9px; box-shadow: 0 2px 5px rgba(0,0,0,.6); }
.ruines-map-marker.military .marker-icon { background: #80602f; }
.ruines-map-marker.train .marker-icon { background: #245c83; }
.ruines-map-marker.police .marker-icon { background: #315a92; }
.ruines-popup p { margin: 8px 0 0; color: #b8c7d6; font-size: 12px; line-height: 1.5; }
.ruines-popup small { display: block; margin-top: 8px; color: #80b6e5; font-size: 10px; }
.map-modal-backdrop[hidden] { display: none !important; }
.map-modal-backdrop { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(3, 8, 14, .78); }
.map-point-modal { width: min(100%, 460px); padding: 22px; border: 1px solid #3b536b; border-radius: 13px; background: #101a28; color: #e8edf5; box-shadow: 0 18px 60px rgba(0,0,0,.5); }
.map-modal-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 20px; }
.map-modal-heading span { color: #8ba2b9; font-size: 10px; font-weight: 800; letter-spacing: 1.4px; }
.map-modal-heading h2 { margin: 5px 0 0; font-size: 21px; }
.map-modal-close { width: 36px; height: 36px; border: 1px solid #344a60; border-radius: 8px; background: #1a2a3d; color: #fff; font-size: 24px; cursor: pointer; }
.map-point-modal label { display: block; margin: 13px 0 7px; color: #b8c8d8; font-size: 12px; font-weight: 700; }
.map-point-modal input, .map-point-modal select, .map-point-modal textarea { box-sizing: border-box; width: 100%; min-height: 43px; padding: 11px 12px; border: 1px solid #344a60; border-radius: 7px; outline: none; background: #0b1320; color: #edf3f8; font: inherit; font-size: 14px; }
.map-point-modal textarea { resize: vertical; min-height: 82px; }
.map-point-modal input:focus, .map-point-modal select:focus, .map-point-modal textarea:focus { border-color: #5796ce; box-shadow: 0 0 0 2px rgba(75,140,201,.16); }
.map-modal-coords { margin-top: 12px; color: #91a7bc; font-size: 11px; }
.map-modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.map-modal-actions button { min-height: 40px; padding: 9px 13px; border-radius: 7px; font-size: 12px; font-weight: 800; cursor: pointer; }
.map-modal-save { border: 1px solid #477eac; background: #28577e; color: #fff; }
.map-modal-cancel { border: 1px solid #40536a; background: #1a2a3d; color: #dce6ef; }
.map-modal-delete { margin-right: auto; border: 1px solid #8c4141; background: #542b31; color: #ffe3e3; }
.map-modal-message { min-height: 17px; margin: 10px 0 0; color: #e8c58b; font-size: 12px; }
.map-modal-actions button:disabled { opacity: .55; cursor: wait; }
@media (max-width: 600px) { .map-point-modal { padding: 17px; } .map-modal-actions { justify-content: stretch; } .map-modal-actions button { flex: 1 1 auto; } }


/* AJOUT DE POINTS - FLUX STAFF */
.map-add-point-panel { display: flex; flex-direction: column; gap: 9px; padding: 14px; margin: 0 0 16px; border: 1px solid #496b4e; border-radius: 9px; background: rgba(49, 91, 55, .16); }
.map-add-point-panel > strong { color: #a9e0ad; font-size: 10px; letter-spacing: 1.2px; }
.map-add-point-panel label { color: #b8c8d8; font-size: 11px; font-weight: 700; }
.map-add-point-panel select { width: 100%; min-height: 42px; box-sizing: border-box; padding: 9px 10px; border: 1px solid #40566c; border-radius: 7px; background: #0b1320; color: #edf3f8; font: inherit; font-size: 12px; }
.map-add-point-panel button { min-height: 42px; padding: 10px 12px; border: 1px solid #4b8655; border-radius: 7px; background: #285b35; color: #fff; font-size: 12px; font-weight: 800; cursor: pointer; }
.map-add-point-panel button.is-active { border-color: #d5a64c; background: #76551f; }
.map-add-point-panel button#mapCancelAddMode { border-color: #526176; background: #202e40; }
.map-add-point-panel button[hidden] { display: none !important; }
.map-add-point-panel p { margin: 0; color: #a9bacb; font-size: 11px; line-height: 1.5; }
#chernarusMap.map-placement-active { cursor: crosshair; }
#chernarusMap.map-placement-active .leaflet-interactive { cursor: crosshair; }

/* Information automatique lors de l'ajout d'un point */
.map-point-auto-info {
    margin: -4px 0 12px;
    color: var(--map-muted, #aeb8c5);
    font-size: 0.88rem;
    line-height: 1.45;
}

/* LOCALITÉS OFFICIELLES BOHEMIA */
.map-filter-divider { height: 1px; margin: 12px 0; background: #2b4056; }
.map-filter-subtitle { display: block; margin: 0 0 9px; color: #91a8bf; font-size: 10px; letter-spacing: 1.2px; }
.ruines-locality-icon { background: transparent; border: 0; white-space: nowrap; pointer-events: auto; }
.ruines-locality-icon span {
    display: inline-block; transform: translate(-50%, -50%); padding: 2px 5px;
    border: 1px solid rgba(190, 207, 219, .45); border-radius: 4px;
    background: rgba(9, 18, 29, .78); color: #e5edf4; font-size: 10px;
    font-weight: 650; line-height: 1.25; text-shadow: 0 1px 2px #000;
    box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.ruines-locality-icon.capital span { border-color: rgba(238,195,104,.85); color: #ffe0a0; font-size: 14px; font-weight: 900; padding: 3px 7px; }
.ruines-locality-icon.city span { border-color: rgba(190,207,219,.75); color: #f1f5f8; font-size: 12px; font-weight: 800; }
.ruines-locality-icon.village span { color: #dce8ef; font-size: 10px; }
.ruines-locality-icon.local span, .ruines-locality-icon.other span { background: rgba(9,18,29,.68); color: #c2d0dc; font-size: 9px; font-weight: 550; }
\n

/* Hiérarchie et lisibilité des localités officielles */
.ruines-locality-icon {
    z-index: 450;
    white-space: nowrap;
}
.ruines-locality-icon span {
    transition: opacity .15s ease, background .15s ease, border-color .15s ease;
    max-width: 240px;
}
.ruines-locality-icon.capital span {
    letter-spacing: .15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .55);
}
.ruines-locality-icon.city span {
    box-shadow: 0 2px 6px rgba(0, 0, 0, .48);
}
.ruines-locality-icon.village span {
    background: rgba(9, 18, 29, .82);
}
.ruines-locality-icon.local span,
.ruines-locality-icon.other span {
    background: rgba(9, 18, 29, .76);
}


/* RÉSEAU ROUTIER CHERNARUS */
.map-road-filter {
    border-color: #5a5a4b;
    background: #1b2630;
}
.map-road-filter .filter-icon {
    color: #e0d2ae;
    background: #3b3a30;
}

/* Les styles globaux du site ne doivent pas redimensionner les tuiles Leaflet. */
#chernarusMap .leaflet-tile {
    max-width: none !important;
    max-height: none !important;
}
