/* ── Wrapper plein écran ─────────────────────────────────────────────────── */
#mc-map-wrapper {
    position: relative;
    height: calc(100vh - 5rem);
    height: calc(100dvh - 5rem);
    overflow: hidden;
    background: #080e1a;
}

/* ── Carte Leaflet ───────────────────────────────────────────────────────── */
#mc-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #080e1a;
    z-index: 1;
}
.leaflet-container { background: #080e1a !important; }

/* Masquer zoom natif Leaflet (remplacé par nos boutons) */
.leaflet-control-zoom { display: none !important; }

/* Attribution */
.leaflet-control-attribution {
    background: rgba(8, 14, 26, 0.88) !important;
    color: #475569 !important;
    font-size: 10px !important;
    border-radius: 8px 0 0 0 !important;
    padding: 3px 7px !important;
    backdrop-filter: blur(8px);
    border: 0 !important;
}
.leaflet-control-attribution a { color: #64748b !important; }

/* ── Popups ──────────────────────────────────────────────────────────────── */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: #151d2e;
    color: #dce2f6;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.leaflet-popup-content {
    margin: 10px 13px;
    font-size: 12px;
    line-height: 1.5;
}

/* ── Tooltip ─────────────────────────────────────────────────────────────── */
.leaflet-tooltip.mc-tooltip {
    background: rgba(8, 14, 26, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: #f0f4ff;
    border-radius: 10px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.leaflet-tooltip-top.mc-tooltip::before    { border-top-color: rgba(8, 14, 26, 0.97); }
.leaflet-tooltip-bottom.mc-tooltip::before { border-bottom-color: rgba(8, 14, 26, 0.97); }

/* ── Panneau flottant (fond verre) ───────────────────────────────────────── */
.mc-panel {
    position: absolute;
    z-index: 800;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mc-panel--left  { left: 12px; top: 12px; width: 216px; }
.mc-panel--right { right: 12px; top: 12px; }
.mc-panel--zoom  { right: 12px; bottom: 24px; gap: 6px; }

.mc-panel-card {
    background: rgba(8, 14, 26, 0.93);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden;
}

/* Branding */
.mc-panel-branding {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}
.mc-brand-icon {
    font-size: 18px;
    color: #f97316;
    flex-shrink: 0;
}
.mc-brand-title {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #fff;
    line-height: 1;
}
.mc-brand-sub {
    margin-top: 2px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #475569;
    line-height: 1;
}

/* Section label */
.mc-section-label {
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: #475569;
}

/* ── Boutons couches ─────────────────────────────────────────────────────── */
.mc-layer-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 8px;
    border-radius: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, opacity 0.2s;
}
.mc-layer-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}
.mc-layer-btn[data-active="true"] {
    background: rgba(255, 255, 255, 0.05);
}
.mc-layer-btn[data-active="false"] {
    opacity: 0.38;
}
.mc-layer-btn[data-active="false"] .mc-layer-dot {
    background: #374151 !important;
}

.mc-layer-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background 0.2s;
}
.mc-layer-label {
    flex: 1;
    font-size: 12px;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1;
}
.mc-layer-count {
    font-size: 10px;
    font-weight: 900;
    color: #94a3b8;
    min-width: 20px;
    text-align: right;
}

/* ── Boutons contrôles (zoom, locate, tiles) ─────────────────────────────── */
.mc-ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 14, 26, 0.93);
    color: #94a3b8;
    cursor: pointer;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.1s;
}
.mc-ctrl-btn:hover {
    color: #f97316;
    border-color: rgba(249, 115, 22, 0.35);
    background: rgba(20, 28, 46, 0.97);
}
.mc-ctrl-btn:active { transform: scale(0.93); }
.mc-ctrl-btn .material-symbols-outlined { font-size: 18px; }

/* ── Loader ──────────────────────────────────────────────────────────────── */
.mc-loader {
    position: absolute;
    bottom: 24px;
    left: 12px;
    z-index: 800;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 12px;
    background: rgba(8, 14, 26, 0.93);
    border: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    pointer-events: none;
}
.mc-loader.is-visible { display: flex; }
.mc-loader-spin {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 2px solid rgba(249, 115, 22, 0.3);
    border-top-color: #f97316;
    animation: mc-spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes mc-spin { to { transform: rotate(360deg); } }

/* ── Tile label (toast discret) ──────────────────────────────────────────── */
.mc-tile-label {
    position: absolute;
    right: 56px;
    top: 12px;
    z-index: 800;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(8, 14, 26, 0.93);
    border: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    backdrop-filter: blur(14px);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s, transform 0.2s;
}
.mc-tile-label.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Pin trace (teardrop) ────────────────────────────────────────────────── */
.mc-trace-pin { position: relative; width: 26px; height: 34px; }
.mc-trace-pin-body {
    position: absolute;
    top: 0; left: 0;
    width: 26px; height: 26px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(255, 255, 255, 0.1);
}
.mc-trace-pin-inner {
    position: absolute;
    top: 6px; left: 6px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
}

/* ── Badge météo ─────────────────────────────────────────────────────────── */
.mc-weather-icon { background: transparent; border: 0; }
.mc-weather-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    min-height: 46px;
    padding: 5px 8px;
    border-radius: 12px;
    background: rgba(8, 14, 26, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
}
.mc-weather-temp {
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    color: #f0f4ff;
}
.mc-weather-meta {
    margin-top: 3px;
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.mc-weather-badge.is-good    { border-color: rgba(34, 197, 94, 0.4); }
.mc-weather-badge.is-warning { border-color: rgba(249, 115, 22, 0.4); }
.mc-weather-badge.is-danger  { border-color: rgba(239, 68, 68, 0.45); }
.mc-weather-badge.is-good .mc-weather-temp    { color: #86efac; }
.mc-weather-badge.is-warning .mc-weather-temp { color: #fb923c; }
.mc-weather-badge.is-danger .mc-weather-temp  { color: #f87171; }

/* ── Badge état route ────────────────────────────────────────────────────── */
.mc-road-icon { background: transparent; border: 0; }
.mc-road-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(8, 14, 26, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    font-size: 13px;
    font-weight: 900;
    color: #e2e8f0;
}
.mc-road-badge.is-danger  { border-color: rgba(239, 68, 68, 0.55); color: #f87171; }
.mc-road-badge.is-warning { border-color: rgba(249, 115, 22, 0.5); color: #fb923c; }
.mc-road-badge.is-neutral { border-color: rgba(100, 116, 139, 0.35); color: #94a3b8; }

/* ── Mobile : ajustements ────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .mc-panel--left { width: 170px; }
    .mc-brand-title { font-size: 10px; }
    .mc-layer-label { font-size: 11px; }
}
