/* ============================================================
   LOG DEPOT — ETS2 LIVE MAP  |  HUD / Cyber  2026
   ============================================================ */

/* ── BASE ────────────────────────────────────────────────────── */
/* Rajdhani wird per <link> im HTML-Head geladen — kein @import nötig */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: #02040a;
    font-family: 'Rajdhani', 'Segoe UI', -apple-system, sans-serif;
    overflow: hidden;
}

/* ── MAP — muss Höhe haben, sonst rendert Leaflet keine Tiles ── */
#map {
    height: 100vh;
    width: 100vw;
    background: #02040a;
}

/* ── SHARED HUD PANEL ────────────────────────────────────────── */
.hud-panel {
    background: rgba(2, 5, 15, 0.88);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border: 1px solid rgba(51, 214, 255, 0.18);
    border-radius: 14px;
    color: #dce8ff;
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.5),
        0 16px 48px rgba(0,0,0,0.70),
        0 0 30px rgba(51,214,255,0.06);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hud-panel:hover {
    border-color: rgba(51,214,255,0.40);
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.5),
        0 20px 55px rgba(0,0,0,0.75),
        0 0 40px rgba(51,214,255,0.12);
}

/* ── MAP CONTROL BOX (left side) ─────────────────────────────── */
.map-control-box {
    position: absolute;
    top: 20px;
    left: 70px;
    z-index: 1000;
    width: 210px;
    padding: 18px;
    /* extend hud-panel styles inline */
    background: rgba(2, 5, 15, 0.92);
    backdrop-filter: blur(22px) saturate(1.5);
    -webkit-backdrop-filter: blur(22px) saturate(1.5);
    border: 1px solid rgba(51,214,255,0.18);
    border-radius: 16px;
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.6),
        0 20px 55px rgba(0,0,0,0.75),
        0 0 30px rgba(51,214,255,0.06),
        /* left glow stripe */
        inset 3px 0 0 rgba(51,214,255,0.25);
    transition: all 0.3s ease;
    color: #dce8ff;
}

.map-control-box:hover {
    border-color: rgba(51,214,255,0.38);
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.6),
        0 24px 65px rgba(0,0,0,0.80),
        0 0 45px rgba(51,214,255,0.13),
        inset 3px 0 0 rgba(51,214,255,0.45);
}

/* Section header inside control box */
.map-control-box h3 {
    margin: 0 0 14px 0;
    font-size: 0.68rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    font-weight: 900;
    color: var(--neon-cyan, #33D6FF);
    display: flex;
    align-items: center;
    gap: 7px;
}

.map-control-box h3::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(51,214,255,0.40), transparent);
}

/* ── MAP LAYER BUTTONS ───────────────────────────────────────── */
.btn-map {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    margin-top: 6px;
    color: #7a90b8;
    text-decoration: none;
    border-radius: 8px;
    background: rgba(51,214,255,0.04);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.22s ease;
    cursor: pointer;
}

.btn-map::before {
    content: '◈';
    font-size: 0.7rem;
    color: rgba(51,214,255,0.40);
    transition: color 0.2s;
}

.btn-map:hover {
    background: rgba(51,214,255,0.12);
    color: #fff;
    border-color: rgba(51,214,255,0.35);
    box-shadow: 0 0 14px rgba(51,214,255,0.15);
    transform: translateX(3px);
}

.btn-map:hover::before { color: var(--neon-cyan, #33D6FF); }

.active-map {
    background: rgba(51,214,255,0.12) !important;
    border-color: rgba(51,214,255,0.45) !important;
    color: #33D6FF !important;
    box-shadow: 0 0 16px rgba(51,214,255,0.18) !important;
    text-shadow: 0 0 10px rgba(51,214,255,0.55);
}

.active-map::before { color: var(--neon-cyan, #33D6FF) !important; }

/* ── DRIVER LIST ─────────────────────────────────────────────── */
.map-control-box hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(51,214,255,0.25), transparent);
    margin: 14px 0 12px;
}

#driverList {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(51,214,255,0.35) transparent;
}

#driverList::-webkit-scrollbar { width: 3px; }
#driverList::-webkit-scrollbar-thumb {
    background: rgba(51,214,255,0.30);
    border-radius: 99px;
}

/* Individual driver entry */
.driver-item {
    width: 100%;
    font-family: inherit;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    margin-bottom: 4px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    font-size: 0.80rem;
    font-weight: 600;
    color: #8898b8;
    transition: all 0.20s ease;
    letter-spacing: 0.3px;
}

.driver-item:hover {
    background: rgba(51,214,255,0.09);
    color: #fff;
    border-color: rgba(51,214,255,0.28);
    transform: translateX(3px);
    box-shadow: 0 0 10px rgba(51,214,255,0.08);
}

.driver-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.driver-list-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(51,214,255,0.25);
    flex-shrink: 0;
}

/* ── STATUS DOTS ─────────────────────────────────────────────── */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.moving {
    background: #00FF88;
    box-shadow: 0 0 8px #00FF88, 0 0 16px rgba(0,255,136,0.40);
    animation: dotPulseGreen 2s ease-in-out infinite;
}

.status-dot.standing {
    background: #FFAA00;
    box-shadow: 0 0 8px #FFAA00, 0 0 16px rgba(255,170,0,0.35);
    animation: dotPulseOrange 2.5s ease-in-out infinite;
}

@keyframes dotPulseGreen {
    0%, 100% { box-shadow: 0 0 5px #00FF88, 0 0 12px rgba(0,255,136,0.35); }
    50%       { box-shadow: 0 0 12px #00FF88, 0 0 24px rgba(0,255,136,0.60); }
}

@keyframes dotPulseOrange {
    0%, 100% { box-shadow: 0 0 5px #FFAA00, 0 0 12px rgba(255,170,0,0.30); }
    50%       { box-shadow: 0 0 12px #FFAA00, 0 0 24px rgba(255,170,0,0.55); }
}

/* ── LEAFLET LAYER CONTROL ───────────────────────────────────── */
.leaflet-control-layers {
    background: rgba(2,5,15,0.92) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(51,214,255,0.20) !important;
    border-radius: 12px !important;
    box-shadow: 0 16px 48px rgba(0,0,0,0.70) !important;
    padding: 12px 16px !important;
}

.leaflet-control-layers-list label {
    color: #8898b8 !important;
    font-size: 0.80rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin: 6px 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: color 0.2s;
}

.leaflet-control-layers-list label:hover { color: #33D6FF !important; }

.leaflet-control-layers-list input[type="checkbox"] {
    accent-color: #33D6FF;
    width: 14px; height: 14px;
    cursor: pointer;
}

.leaflet-control-layers-separator {
    border-top: 1px solid rgba(51,214,255,0.12) !important;
    margin: 8px 0 !important;
}

/* ── MAP LABELS ──────────────────────────────────────────────── */
.city-label {
    background: rgba(2,5,15,0.90) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(51,214,255,0.35) !important;
    color: #e8f4ff !important;
    font-weight: 800;
    font-size: 11px;
    font-family: 'Rajdhani', sans-serif;
    padding: 4px 9px;
    border-radius: 6px;
    white-space: nowrap;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 14px rgba(0,0,0,0.60), 0 0 10px rgba(51,214,255,0.08);
}

.leaflet-tooltip-top:before {
    border-top-color: rgba(2,5,15,0.90) !important;
}

.company-label {
    background: rgba(2,5,15,0.88) !important;
    border: 1px solid rgba(51,214,255,0.30) !important;
    color: #33D6FF !important;
    font-size: 10px !important;
    font-weight: 700;
    font-family: 'Rajdhani', sans-serif;
    padding: 3px 7px;
    border-radius: 5px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.45);
}

/* ── TRUCK ICONS ─────────────────────────────────────────────── */
.truck-icon img {
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.truck-icon img:hover {
    transform: scale(1.18);
}

/* Moving — Cyber Green */
.truck-moving img {
    border: 2px solid #00FF88;
    animation: truckPulseGreen 2s ease-in-out infinite;
}

/* Standing — Warm Amber */
.truck-standing img {
    border: 2px solid #FFAA00;
    animation: truckPulseOrange 2.5s ease-in-out infinite;
}

@keyframes truckPulseGreen {
    0%, 100% { box-shadow: 0 0 6px rgba(0,255,136,0.55), 0 0 0 2px rgba(0,255,136,0.12); }
    50%       { box-shadow: 0 0 20px rgba(0,255,136,0.85), 0 0 0 5px rgba(0,255,136,0.15); }
}

@keyframes truckPulseOrange {
    0%, 100% { box-shadow: 0 0 6px rgba(255,170,0,0.55), 0 0 0 2px rgba(255,170,0,0.10); }
    50%       { box-shadow: 0 0 20px rgba(255,170,0,0.82), 0 0 0 5px rgba(255,170,0,0.15); }
}

.popup-flag {
    width: 20px; height: 14px;
    margin-left: 8px;
    vertical-align: middle;
    border-radius: 2px;
    box-shadow: 0 0 4px #000;
}

/* ── DRIVER POPUPS ───────────────────────────────────────────── */
.custom-driver-popup .leaflet-popup-content-wrapper {
    background: rgba(2,5,15,0.93) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    color: #dce8ff !important;
    border: 1px solid rgba(51,214,255,0.35) !important;
    border-radius: 14px !important;
    box-shadow:
        0 20px 55px rgba(0,0,0,0.80),
        0 0 30px rgba(51,214,255,0.14) !important;
    padding: 6px !important;
    font-family: 'Rajdhani', sans-serif;
}

.custom-driver-popup .leaflet-popup-tip {
    background: rgba(2,5,15,0.93) !important;
}

.custom-driver-popup .leaflet-popup-tip-container {
    filter: drop-shadow(0 0 6px rgba(51,214,255,0.2));
}

.popup-header {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(51,214,255,0.15);
    padding-bottom: 9px;
    margin-bottom: 9px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    padding: 6px 0;
    font-size: 0.82rem;
}

.popup-stat-row span {
    color: #4a5e80;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 1px;
    font-weight: 700;
}

.popup-stat-row strong {
    color: #dce8ff;
    font-weight: 700;
    font-size: 0.88rem;
}

/* ── POI & LOGIN MODALS ──────────────────────────────────────── */
.poi-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(1,2,8,0.80);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
}

.poi-modal {
    background: rgba(4,8,22,0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(51,214,255,0.30);
    padding: 28px;
    width: 340px;
    border-radius: 18px;
    box-shadow:
        0 40px 80px rgba(0,0,0,0.85),
        0 0 40px rgba(51,214,255,0.12);
    animation: modalIn 0.3s var(--ease-out, cubic-bezier(0.4,0,0.2,1));
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.poi-modal h3 {
    margin: 0 0 18px 0;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #33D6FF;
    text-shadow: 0 0 14px rgba(51,214,255,0.50);
    border-bottom: 1px solid rgba(51,214,255,0.15);
    padding-bottom: 12px;
}

.poi-modal-body input,
.poi-modal-body select {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 9px;
    color: #dce8ff;
    padding: 11px 14px;
    margin-bottom: 12px;
    font-family: 'Rajdhani', 'Segoe UI', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.22s ease;
}

.poi-modal-body input:focus,
.poi-modal-body select:focus {
    outline: none;
    border-color: #33D6FF;
    background: rgba(51,214,255,0.06);
    box-shadow: 0 0 0 3px rgba(51,214,255,0.12), 0 0 16px rgba(51,214,255,0.07);
    color: #fff;
}

.poi-modal-body input::placeholder { color: #2e3a55; }

.poi-modal-body select option { background: #04060f; color: #dce8ff; }

.poi-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

/* Modal buttons */
.btn-primary {
    background: linear-gradient(135deg, rgba(51,214,255,0.92), rgba(0,170,220,0.92));
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 900;
    font-size: 0.88rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #010813;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 0 18px rgba(51,214,255,0.25);
}

.btn-primary:hover {
    box-shadow: 0 0 28px rgba(51,214,255,0.50);
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    color: #4a5e80;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.22s ease;
}

.btn-secondary:hover {
    border-color: rgba(255,255,255,0.30);
    color: #dce8ff;
    background: rgba(255,255,255,0.05);
}

/* ── HUD STATUS BAR (bottom) ─────────────────────────────────── */
#hudStatusBar {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(2,5,15,0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(51,214,255,0.16);
    border-radius: 99px;
    padding: 8px 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.65), 0 0 20px rgba(51,214,255,0.07);
    white-space: nowrap;
    transition: opacity 0.3s;
}

.hud-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #4a5e80;
}

.hud-stat i { font-size: 0.75rem; }

.hud-stat .hud-val {
    color: #33D6FF;
    font-size: 0.82rem;
    font-weight: 800;
    text-shadow: 0 0 8px rgba(51,214,255,0.50);
}

.hud-divider {
    width: 1px;
    height: 16px;
    background: rgba(51,214,255,0.18);
    border-radius: 1px;
}

/* ── CORNER DECORATIONS ──────────────────────────────────────── */
.hud-corner {
    position: absolute;
    z-index: 999;
    width: 50px;
    height: 50px;
    pointer-events: none;
    opacity: 0.65;
}

.hud-corner::before,
.hud-corner::after {
    content: '';
    position: absolute;
    background: #33D6FF;
    border-radius: 1px;
}

.hud-corner-tl { top: 14px; left: 14px; }
.hud-corner-tl::before { top: 0; left: 0; width: 2px; height: 22px; }
.hud-corner-tl::after  { top: 0; left: 0; width: 22px; height: 2px; }

.hud-corner-tr { top: 14px; right: 14px; }
.hud-corner-tr::before { top: 0; right: 0; width: 2px; height: 22px; }
.hud-corner-tr::after  { top: 0; right: 0; width: 22px; height: 2px; }

.hud-corner-br { bottom: 14px; right: 14px; }
.hud-corner-br::before { bottom: 0; right: 0; width: 2px; height: 22px; }
.hud-corner-br::after  { bottom: 0; right: 0; width: 22px; height: 2px; }

.hud-corner-bl { bottom: 14px; left: 14px; }
.hud-corner-bl::before { bottom: 0; left: 0; width: 2px; height: 22px; }
.hud-corner-bl::after  { bottom: 0; left: 0; width: 22px; height: 2px; }

/* ── LAYER / MAP PANES ───────────────────────────────────────── */
.leaflet-hiddenPane-pane,
.leaflet-truckPane-pane {
    pointer-events: none !important;
}

.leaflet-tile-container { pointer-events: none; }
.leaflet-tile { background-color: transparent !important; }

.hidden-road-layer {
    filter: url(#hidden-road-filter) !important;
    pointer-events: none !important;
}

.leaflet-pane.leaflet-hiddenPane-pane { mix-blend-mode: normal !important; }

/* ── LOGOUT BUTTON ───────────────────────────────────────────── */
.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 13px;
    background: rgba(255, 60, 60, 0.07);
    border: 1px solid rgba(255, 80, 80, 0.20);
    border-radius: 8px;
    color: #c06060;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.22s ease;
}

.btn-logout:hover {
    background: rgba(255, 60, 60, 0.16);
    border-color: rgba(255, 80, 80, 0.50);
    color: #ff6060;
    box-shadow: 0 0 14px rgba(255, 60, 60, 0.15);
    transform: translateX(3px);
}

/* ── VIGNETTE & SCANLINES ────────────────────────────────────── */
#mapVignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 998;
    background: radial-gradient(
        ellipse at center,
        transparent 45%,
        rgba(2,4,10,0.68) 100%
    );
}

#mapScanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 997;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0,0,0,0.05) 3px,
        rgba(0,0,0,0.05) 4px
    );
}

/* ── LEAFLET ZOOM CONTROL ────────────────────────────────────── */
.leaflet-control-zoom {
    border: 1px solid rgba(51,214,255,0.22) !important;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.65), 0 0 20px rgba(51,214,255,0.06) !important;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    background: rgba(2,5,15,0.92) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    color: #33D6FF !important;
    border-bottom: 1px solid rgba(51,214,255,0.14) !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    width: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
    transition: background 0.2s, color 0.2s !important;
}

.leaflet-control-zoom-in:hover,
.leaflet-control-zoom-out:hover {
    background: rgba(51,214,255,0.12) !important;
    color: #fff !important;
}

.leaflet-control-zoom-out {
    border-bottom: none !important;
}

/* ── LEAFLET ATTRIBUTION ─────────────────────────────────────── */
.leaflet-control-attribution {
    background: rgba(2,5,15,0.78) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    color: #2e3a55 !important;
    font-size: 10px !important;
    border-radius: 8px 0 0 0 !important;
    border-top: 1px solid rgba(51,214,255,0.10) !important;
    border-left: 1px solid rgba(51,214,255,0.10) !important;
    padding: 4px 8px !important;
}

.leaflet-control-attribution a { color: rgba(51,214,255,0.40) !important; }
