body, html {
    margin: 0; padding: 0; width: 100%; height: 100%;
    overflow: hidden; font-family: 'Segoe UI', Roboto, sans-serif;
}
#map { width: 100%; height: 100%; }

/* --- En-tête principal --- */
.map-header {
    position: absolute; top: 16px; left: 16px;
    background: rgba(15, 23, 42, 0.95); color: #fff;
    padding: 10px 16px; border-radius: 10px; z-index: 10;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3); border: 1px solid #334155;
    display: flex; align-items: center; gap: 12px;
}
.map-header h1 { margin: 0; font-size: 14px; color: #38bdf8; font-weight: 700; }
.map-header p { margin: 2px 0 0 0; font-size: 11px; color: #94a3b8; }

.btn-menu-drawer {
    background: #0284c7; color: #fff; border: none;
    padding: 8px 12px; border-radius: 6px; font-size: 13px; font-weight: 700;
    cursor: pointer; transition: background 0.2s;
}
.btn-menu-drawer:hover { background: #0369a1; }

/* --- Barre d'outils (Bas-gauche) --- */
.map-tools-bar {
    position: absolute; bottom: 10px; left: 54px; z-index: 10;
    display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.btn-tool {
    background: rgba(15, 23, 42, 0.92); color: #f8fafc; border: 1px solid #334155;
    padding: 7px 11px; border-radius: 8px; font-size: 11px; font-weight: 700;
    cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.3); transition: all 0.2s;
}
.btn-tool:hover { background: #0284c7; color: #fff; border-color: #38bdf8; }
.maplibregl-ctrl-bottom-left { bottom: 10px !important; left: 10px !important; }

/* --- Tiroir Rétractable (Menu Gauche) --- */
.drawer-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(2px); z-index: 1000;
}
.drawer-overlay.open { display: block; }

.left-drawer {
    position: fixed; top: 0; left: 0; width: 320px; max-width: 85vw; height: 100vh;
    background: rgba(15, 23, 42, 0.97); color: #f8fafc; backdrop-filter: blur(12px);
    box-shadow: 4px 0 25px rgba(0,0,0,0.5); z-index: 1001;
    transform: translateX(-100%); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto; padding: 20px; box-sizing: border-box; display: flex; flex-direction: column;
    border-right: 1px solid #334155;
}
.left-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #334155; padding-bottom: 12px; margin-bottom: 12px; }
.drawer-header h3 { margin: 0; font-size: 15px; color: #38bdf8; }
.close-drawer-btn { background: none; border: none; color: #94a3b8; font-size: 22px; cursor: pointer; }

.drawer-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #38bdf8; margin: 14px 0 6px 0; border-bottom: 1px solid #1e293b; padding-bottom: 4px; }
.drawer-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.drawer-btn-item {
    background: rgba(30, 41, 59, 0.7); color: #e2e8f0; border: 1px solid #334155;
    padding: 8px 12px; border-radius: 6px; font-size: 12px; text-align: left;
    cursor: pointer; transition: all 0.2s; display: flex; justify-content: space-between; align-items: center;
}
.drawer-btn-item:hover { background: #0284c7; color: #ffffff; border-color: #38bdf8; }

.layer-group { background: rgba(30, 41, 59, 0.5); border: 1px solid #334155; padding: 10px; border-radius: 8px; }
.layer-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; cursor: pointer; font-size: 12px; font-weight: 500; color: #cbd5e1; }
.layer-item:last-child { margin-bottom: 0; }
.layer-item input { accent-color: #0284c7; width: 15px; height: 15px; }
.drawer-credits-footer { margin-top: 20px; padding-top: 12px; border-top: 1px solid #334155; text-align: center; }
.btn-credits-link { background: none; border: none; color: #94a3b8; font-size: 11px; cursor: pointer; text-decoration: underline; }

/* --- Panneau d'Information (Panneau Droit) --- */
.side-panel {
    position: fixed; top: 0; right: 0; width: 450px; max-width: 90vw; height: 100vh;
    background: #ffffff; box-shadow: -4px 0 25px rgba(0,0,0,0.3); z-index: 1000;
    transform: translateX(100%); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto; padding: 24px; box-sizing: border-box; display: flex; flex-direction: column;
}
.side-panel.open { transform: translateX(0); }
.close-btn {
    position: absolute; top: 16px; right: 16px; background: #f1f5f9; border: none;
    width: 32px; height: 32px; border-radius: 50%; font-size: 20px; cursor: pointer; color: #475569;
}

/* --- Cards UI --- */
.card-tech { background: #f8fafc; border: 1px solid #e2e8f0; padding: 14px; border-radius: 8px; margin-bottom: 12px; }
.card-eau { background: #f0f9ff; border: 1px solid #bae6fd; padding: 14px; border-radius: 8px; margin-bottom: 12px; }
.card-chauffage { background: #fff7ed; border: 1px solid #ffedd5; padding: 14px; border-radius: 8px; margin-bottom: 12px; }
.card-vmc { background: #f0fdf4; border: 1.5px solid #86efac; padding: 14px; border-radius: 8px; margin-bottom: 12px; }
.card-loge { background: #fefce8; border: 1px solid #fef08a; padding: 14px; border-radius: 8px; margin-bottom: 12px; }
.card-urgance-coupure { background: #fef2f2; border: 1.5px solid #ef4444; padding: 14px; border-radius: 8px; margin-bottom: 12px; }

.card-tech h4, .card-eau h4, .card-chauffage h4, .card-vmc h4, .card-loge h4, .card-urgance-coupure h4 {
    margin: 0 0 8px 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
.card-tech h4 { color: #334155; }
.card-eau h4 { color: #0369a1; }
.card-chauffage h4 { color: #c2410c; }
.card-vmc h4 { color: #15803d; }
.card-loge h4 { color: #a16207; }
.card-urgance-coupure h4 { color: #dc2626; }

.tech-list { list-style: none; padding: 0; margin: 0; font-size: 13px; color: #334155; line-height: 1.6; }
.tech-list li { display: flex; justify-content: space-between; border-bottom: 1px dashed #cbd5e1; padding: 4px 0; }
.tech-list li:last-child { border-bottom: none; }

.btn-gps {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 12px; background: #0284c7; color: #ffffff;
    border: none; border-radius: 8px; font-size: 13px; font-weight: 600;
    cursor: pointer; text-decoration: none; margin-top: 16px; transition: background 0.2s;
}
.btn-gps:hover { background: #0369a1; }

.btn-fermer-panel {
    display: block; width: 100%; padding: 14px; margin-top: auto;
    background: #e2e8f0; color: #334155; border: 1px solid #cbd5e1;
    border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; text-align: center;
}
.btn-fermer-panel:hover { background: #cbd5e1; }

.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(4px); z-index: 2000;
    align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: #ffffff; width: 90%; max-width: 500px; padding: 24px;
    border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); position: relative;
}

@media (max-width: 768px) {
    .map-header { top: 10px; left: 10px; padding: 8px 12px; }
    .map-header p { display: none; }
    .map-tools-bar { bottom: 50px; left: 10px; }
    .side-panel { 
        top: auto; bottom: 10px; left: 10px; right: 10px; width: auto; max-width: none; height: auto; max-height: 75vh; 
        border-radius: 16px; transform: translateY(150%);
    }
    .side-panel.open { transform: translateY(0); }
}