/* --- MODERN UI THEME v5.0 --- */

:root { 
    --bg-app: #000000;
    --glass-bg: rgba(20, 20, 20, 0.90); /* Iets donkerder voor leesbaarheid */
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #888888;
    
    /* Kleuren */
    --neon-blue: #007aff;
    --neon-red: #ff3b30;
    --neon-orange: #ff9500;
    --neon-green: #30d158;
    --closure-color: #d63031; /* Donkerrood voor wegafsluiting */
    
    --radius: 16px;
    --shadow: 0 10px 40px rgba(0,0,0,0.6);
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg-app: #f0f2f5;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: 1px solid rgba(0, 0, 0, 0.05);
    --text-main: #1c1e21;
    --text-muted: #65676b;
}

body, html { margin: 0; padding: 0; height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg-app); color: var(--text-main); overflow: hidden; }

.app-container { display: flex; height: 100vh; width: 100vw; position: relative; }

/* --- SIDEBAR --- */
.sidebar { 
    width: 380px; 
    background-color: var(--glass-bg);
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    display: flex; flex-direction: column; 
    border-right: var(--glass-border); 
    z-index: 1000; 
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.header { padding: 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: var(--glass-border); }
.logo-group { display: flex; align-items: center; gap: 12px; }
.logo-box { background: linear-gradient(135deg, #00c6ff, #0072ff); color: white; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.4rem; }
.title-group h1 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.subtitle { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }

.theme-btn { background: transparent; border: 1px solid var(--text-muted); color: var(--text-main); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0.7; }

/* --- FILTERS --- */
.filters { padding: 15px 20px; display: flex; gap: 10px; }

.filter-card {
    background: rgba(125,125,125,0.08); border: var(--glass-border); color: var(--text-muted);
    padding: 12px; border-radius: 14px; cursor: pointer; flex: 1; 
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    font-size: 0.75rem; font-weight: 600; transition: all 0.2s;
}
.filter-card:hover { background: rgba(125,125,125,0.15); }
.filter-card .icon-glow { font-size: 1.2rem; margin-bottom: 2px; }

/* Active Colors */
.filter-card.active[data-type="fixed"] { border-color: var(--neon-red); color: var(--text-main); background: rgba(255, 59, 48, 0.1); }
.filter-card.active[data-type="fixed"] .icon-glow { color: var(--neon-red); text-shadow: 0 0 10px var(--neon-red); }

.filter-card.active[data-type="incident"] { border-color: var(--neon-orange); color: var(--text-main); background: rgba(255, 149, 0, 0.1); }
.filter-card.active[data-type="incident"] .icon-glow { color: var(--neon-orange); text-shadow: 0 0 10px var(--neon-orange); }

.filter-card.active[data-type="jam"] { border-color: var(--neon-blue); color: var(--text-main); background: rgba(0, 122, 255, 0.1); }
.filter-card.active[data-type="jam"] .icon-glow { color: var(--neon-blue); text-shadow: 0 0 10px var(--neon-blue); }

/* --- LIJST --- */
.incident-list { flex: 1; overflow-y: auto; padding: 0 20px 20px; }
.empty-state { text-align: center; color: var(--text-muted); margin-top: 40px; }

.incident-card { 
    background: rgba(125,125,125,0.05); border: var(--glass-border);
    padding: 14px; margin-bottom: 8px; border-radius: 12px; 
    cursor: pointer; position: relative; overflow: hidden;
}
.incident-card::before { content:''; position: absolute; top:0; bottom:0; left:0; width: 4px; }

/* Type Styling */
.incident-card.fixed::before { background: var(--neon-red); }
.incident-card.incident::before { background: var(--neon-orange); }
.incident-card.jam::before { background: var(--neon-blue); }
.incident-card.closure::before { background: var(--closure-color); } /* Wegafsluiting */

.card-top { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 4px; font-size: 0.9rem; }
.card-desc { font-size: 0.8rem; color: var(--text-muted); }

/* --- MAP --- */
#map { flex: 1; height: 100%; background: #111; }
.custom-icon { display: flex; align-items: center; justify-content: center; border-radius: 50%; color: white; background: #333; box-shadow: 0 3px 8px rgba(0,0,0,0.5); font-size: 14px; border: 2px solid white; }
.bg-fixed { background: var(--neon-red); }
.bg-incident { background: var(--neon-orange); }
.bg-jam { background: var(--neon-blue); }
.bg-closure { background: var(--closure-color); color: #fff; }

.user-dot { width: 14px; height: 14px; background: #007aff; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.7); animation: softPulse 2s infinite; }
@keyframes softPulse { 70% { box-shadow: 0 0 0 20px rgba(0, 122, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0); } }

/* --- CONTROLS --- */
.recenter-btn { position: absolute; bottom: 30px; right: 20px; z-index: 999; background: var(--neon-blue); color: #fff; border: none; width: 50px; height: 50px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; box-shadow: 0 5px 15px rgba(0, 122, 255, 0.3); display: none; align-items: center; justify-content: center; }
.status-bar { position: absolute; top: 15px; right: 15px; z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.pill { background: var(--glass-bg); color: var(--text-main); padding: 5px 12px; border-radius: 20px; font-size: 0.75rem; border: 1px solid var(--text-muted); backdrop-filter: blur(5px); display: flex; align-items: center; gap: 6px; }
.led { width: 6px; height: 6px; border-radius: 50%; }
.led.green { background: #30d158; } .led.red { background: #ff453a; } .led.yellow { background: #ff9f0a; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.4; } }

/* --- MOBIELE WEERGAVE (Bottom Sheet) --- */
.mobile-toggle-area { display: none; }

@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    #map { height: 100vh; width: 100%; position: absolute; top: 0; left: 0; z-index: 1; }
    
    .sidebar { 
        width: 100%; 
        height: auto;
        min-height: 140px; /* Alleen filters zichtbaar */
        max-height: 70vh;  /* Maximaal 70% van scherm */
        
        position: absolute; bottom: 0; left: 0; z-index: 1000;
        
        border-right: none; border-top: var(--glass-border);
        border-radius: 20px 20px 0 0;
        
        /* Standaard status: INGEKLAPT (Alleen filters) */
        transform: translateY(calc(100% - 140px)); 
    }
    
    /* Wanneer sidebar open is */
    .sidebar.open { transform: translateY(0); }

    /* De hendel zichtbaar maken */
    .mobile-toggle-area {
        display: flex; align-items: center; justify-content: center;
        width: 100%; height: 25px; cursor: pointer;
    }
    .drag-pill { width: 40px; height: 5px; background: var(--text-muted); border-radius: 10px; opacity: 0.5; }

    .header { padding: 5px 20px; border: none; }
    .title-group { display: none; }
    .theme-btn { border: none; font-size: 1.1rem; }

    .filters { padding: 0 20px 10px; }
    .filter-card { padding: 8px; flex-direction: row; justify-content: center; }
    .filter-card .icon-glow { font-size: 1rem; margin-right: 5px; margin-bottom: 0; }
    .filter-card span { display: inline-block; }

    .recenter-btn { bottom: 160px; right: 15px; } /* Boven het menu */
    .status-bar { top: 60px; }
}