/* ==========================================================================
   PD4PM - UNIFIED STYLESHEET v1.0
   Vervangt: pd4pm-menu.css, stylePC.css, swipeable-content.css, 
             p2000-filter.css, en inline CSS uit index.html
   
   Laat APART staan (worden NIET vervangen):
   - vermissingen.css (eigen vm- prefix, geen conflicten)
   - CSS die P2000FRLMap.js inject via createElement('style')
   
   IPHONE SAFE AREA:
   Overal waar top/bottom posities worden gebruikt, wordt 
   env(safe-area-inset-*) meegerekend. Op niet-iPhone apparaten 
   geeft dit 0px terug — er verandert niks.
   ========================================================================== */


/* ==========================================================================
   1. GLOBAL RESET & BASE
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
}


/* ==========================================================================
   2. NAVIGATION BAR - Glassmorphism
   ========================================================================== */

nav.pd4pm-nav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(70px + env(safe-area-inset-top, 0px)) !important;
    z-index: 1000 !important;
    background: rgba(15, 15, 25, 0.65) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: env(safe-area-inset-top, 0px) 20px 0 20px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    overflow: visible !important;
}

/* --- Logo --- */

a.pd4pm-logo {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    text-decoration: none !important;
    flex-shrink: 0 !important;
}

a.pd4pm-logo img {
    width: 44px !important;
    height: 44px !important;
    border-radius: 10px !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

a.pd4pm-logo:hover img {
    transform: scale(1.08) !important;
    box-shadow: 0 0 20px rgba(100, 200, 255, 0.3) !important;
}

span.pd4pm-logo-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    letter-spacing: 1px !important;
    transition: color 0.3s ease !important;
}

a.pd4pm-logo:hover span.pd4pm-logo-text {
    color: #ffffff !important;
}

/* --- Clock --- */

div.pd4pm-clock {
    position: absolute !important;
    left: 50% !important;
    top: calc(50% + (env(safe-area-inset-top, 0px) / 2)) !important;
    transform: translate(-50%, -50%) !important;
    text-align: center !important;
    user-select: none !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

div.pd4pm-time {
    font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace !important;
    font-size: 28px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    letter-spacing: 2px !important;
    text-shadow: 0 0 20px rgba(100, 200, 255, 0.3) !important;
    line-height: 1.2 !important;
}

div.pd4pm-date {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.45) !important;
    letter-spacing: 1px !important;
    margin-top: 2px !important;
    line-height: 1.2 !important;
}

/* --- Action Buttons --- */

div.pd4pm-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 1001 !important;
}

.pd4pm-btn {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.pd4pm-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
}

.pd4pm-btn:active {
    transform: translateY(0) !important;
}

.pd4pm-btn svg {
    width: 22px !important;
    height: 22px !important;
    color: rgba(255, 255, 255, 0.85) !important;
    transition: color 0.3s ease !important;
    flex-shrink: 0 !important;
}

.pd4pm-btn:hover svg {
    color: #ffffff !important;
}

/* Button hover kleuren per type */
button.pd4pm-btn.pd4pm-btn--settings:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
}
button.pd4pm-btn.pd4pm-btn--settings:hover svg { color: #60a5fa !important; }

a.pd4pm-btn.pd4pm-btn--log:hover {
    background: rgba(251, 146, 60, 0.2) !important;
    border-color: rgba(251, 146, 60, 0.4) !important;
}
a.pd4pm-btn.pd4pm-btn--log:hover svg { color: #fb923c !important; }

div.pd4pm-btn.pd4pm-btn--menu:hover {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
}
div.pd4pm-btn.pd4pm-btn--menu:hover svg { color: #34d399 !important; }

/* --- Tooltip --- */

.pd4pm-btn[data-tooltip]::before {
    content: attr(data-tooltip) !important;
    position: absolute !important;
    bottom: -36px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    padding: 6px 12px !important;
    background: rgba(0, 0, 0, 0.9) !important;
    color: white !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.2s ease !important;
    pointer-events: none !important;
    z-index: 1003 !important;
}

.pd4pm-btn[data-tooltip]:hover::before {
    opacity: 1 !important;
    visibility: visible !important;
    bottom: -40px !important;
}

div.pd4pm-btn.pd4pm-btn--menu:hover::before {
    opacity: 0 !important;
    visibility: hidden !important;
}


/* ==========================================================================
   3. DROPDOWN MENU
   ========================================================================== */

div.pd4pm-dropdown {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    min-width: 220px !important;
    background: rgba(20, 20, 35, 0.9) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden !important;
    padding: 8px !important;
    z-index: 1002 !important;
    display: block !important;
    float: none !important;
    margin: 0 !important;
}

div.pd4pm-btn.pd4pm-btn--menu:hover div.pd4pm-dropdown,
div.pd4pm-dropdown:hover {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

div.pd4pm-dropdown-header {
    padding: 12px 14px 8px !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.4) !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    margin: 0 !important;
    line-height: 1.4 !important;
}

.pd4pm-dropdown-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 14px !important;
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    border: none !important;
    background: none !important;
    width: 100% !important;
    text-align: left !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    line-height: 1.4 !important;
}

.pd4pm-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    transform: translateX(4px) !important;
}

.pd4pm-dropdown-item svg {
    width: 18px !important;
    height: 18px !important;
    opacity: 0.6 !important;
    flex-shrink: 0 !important;
}

div.pd4pm-dropdown-divider {
    height: 1px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    margin: 8px 14px !important;
    border: none !important;
    padding: 0 !important;
}

/* Dropdown hover kleuren per item type */
.pd4pm-dropdown-item.pd4pm-dropdown-item--friesland:hover  { background: rgba(59, 130, 246, 0.15) !important; }
.pd4pm-dropdown-item.pd4pm-dropdown-item--groningen:hover  { background: rgba(245, 158, 11, 0.15) !important; }
.pd4pm-dropdown-item.pd4pm-dropdown-item--drenthe:hover    { background: rgba(16, 185, 129, 0.15) !important; }
.pd4pm-dropdown-item.pd4pm-dropdown-item--news:hover       { background: rgba(239, 68, 68, 0.15) !important; }
.pd4pm-dropdown-item.pd4pm-dropdown-item--info:hover       { background: rgba(168, 85, 247, 0.15) !important; }
.pd4pm-dropdown-item.pd4pm-dropdown-item--settings:hover   { background: rgba(59, 130, 246, 0.15) !important; }
.pd4pm-dropdown-item.pd4pm-dropdown-item--log:hover        { background: rgba(251, 146, 60, 0.15) !important; }

/* Provincie vlaggen in dropdown */
.pd4pm-dropdown-flag {
    width: 24px !important;
    height: 16px !important;
    border-radius: 3px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
    background-color: white !important;
    padding: 2px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Mobile-only dropdown items */
.pd4pm-dropdown-mobile-only {
    display: none !important;
}


/* ==========================================================================
   4. MAP & MAIN LAYOUT
   ========================================================================== */

.container {
    position: relative;
    height: calc(100vh - 70px);
    width: 100vw;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100%;
    z-index: 1;
    background-color: black;
}


/* ==========================================================================
   5. LIST CONTAINER (sidebar / bottom panel)
   ========================================================================== */

#list-container {
    position: fixed;
    top: calc(70px + env(safe-area-inset-top, 0px));
    right: 0;
    width: 30%;
    height: calc(100vh - 70px - env(safe-area-inset-top, 0px));
    background-color: rgba(180, 180, 180, 0.6);
    z-index: 2;
    user-select: none;
    box-sizing: border-box;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 0 !important;
    border: none !important;
    scrollbar-color: white transparent;
    scrollbar-width: thin;
}

#list-container::-webkit-scrollbar { width: 5px; }
#list-container::-webkit-scrollbar-track { background: transparent; border-radius: 10px; }
#list-container::-webkit-scrollbar-thumb { background: white; border-radius: 10px; }
#list-container::-webkit-scrollbar-thumb:hover { background: #ddd; }
#list-container::-webkit-scrollbar-button { display: none; }

.list-item {
    padding: 10px;
    border-bottom: 1px solid rgba(200, 200, 200, 0.2);
}


/* ==========================================================================
   6. TAB BAR + GRIP HANDLE - Glassmorphism
   ========================================================================== */

.tab-navigation {
    display: flex !important;
    flex-direction: column !important;
    flex-shrink: 0 !important;
    background: rgba(15, 15, 25, 0.65) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Grip handle zone */
.tab-navigation::before {
    content: '' !important;
    display: block !important;
    height: 10px !important;
    width: 100% !important;
    cursor: ns-resize !important;
    position: relative !important;
    background: transparent !important;
}

/* Grip streepje */
.tab-navigation::after {
    content: '' !important;
    position: absolute !important;
    top: 3px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 32px !important;
    height: 4px !important;
    background: rgba(255, 255, 255, 0.3) !important;
    border-radius: 2px !important;
    transition: background 0.2s ease !important;
    pointer-events: none !important;
}

.tab-navigation:hover::after {
    background: rgba(255, 255, 255, 0.5) !important;
}

/* Tab buttons container */
.tab-buttons {
    display: flex !important;
    flex: 1 !important;
    width: 100% !important;
    height: 28px !important;
}

.tab-button {
    flex: 1 1 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 28px !important;
    padding: 0 4px !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    cursor: pointer !important;
    position: relative !important;
    transition: color 0.2s, background 0.2s !important;
}

.tab-button:hover {
    color: rgba(255, 255, 255, 0.8) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.tab-button.active {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.tab-button.active::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 28px !important;
    height: 2px !important;
    background: linear-gradient(90deg, #3b82f6, #60a5fa) !important;
    border-radius: 1px !important;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5) !important;
}

/* Oude resize handle verbergen */
.resize-handle { display: none !important; }


/* ==========================================================================
   7. PAGE CONTAINERS (P2000, HeliData, Scanner)
   ========================================================================== */

#p2000-container {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 6px !important;
    min-height: 0 !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(255,255,255,0.3) transparent !important;
}

#p2000-container::-webkit-scrollbar { width: 4px !important; }
#p2000-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3) !important; border-radius: 2px !important; }

/* Verberg oude voorlezen checkbox */
#p2000-container > label { display: none !important; }

/* Iframe containers */
#helidata-container,
#scanner-container {
    flex: 1 1 auto !important;
    position: relative !important;
    overflow: hidden !important;
    min-height: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

#helidata-container iframe,
#scanner-container iframe,
.content-iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* ==========================================================================
   8. DATUM PICKER & MODUS INDICATOR - Glassmorphism
   ========================================================================== */

#datum-picker {
    position: absolute;
    top: calc(80px + env(safe-area-inset-top, 0px));
    left: 10px;
    z-index: 1000;
    background: rgba(20, 22, 35, 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: none !important;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    font-size: 12px;
    font-weight: 500;
    color-scheme: dark;
    padding: 8px 10px;
    width: auto;
    min-width: unset;
    cursor: pointer;
    transition: all 0.2s ease;
}

#datum-picker:hover {
    background: rgba(30, 32, 50, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

#datum-picker:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

#datum-picker::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
}

#modus-indicator {
    position: absolute;
    top: calc(80px + env(safe-area-inset-top, 0px));
    left: 160px;
    z-index: 1000;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s;
}


/* ==========================================================================
   9. LEAFLET MAP CONTROLS - Glassmorphism
   ========================================================================== */

.leaflet-top.leaflet-left {
    top: calc(110px + env(safe-area-inset-top, 0px)) !important;
}

/* Popup styling */
.leaflet-popup.custom-popup .leaflet-popup-content-wrapper {
    background-color: rgba(255, 255, 255, 0.01) !important;
    color: Black !important;
    text-shadow: 0 0 9px rgba(255, 255, 255, 0.9);
    border-radius: 0px !important;
    box-shadow: none !important;
    border-color: black;
}

.leaflet-popup.custom-popup .leaflet-popup-tip-container { display: none !important; }
.leaflet-popup.custom-popup .leaflet-popup-close-button { display: none !important; }

/* Layer control */
.leaflet-control-layers {
    background: rgba(20, 22, 35, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.leaflet-control-layers-toggle {
    background-color: transparent !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.85)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 2 7 12 12 22 7 12 2'/%3E%3Cpolyline points='2 17 12 22 22 17'/%3E%3Cpolyline points='2 12 12 17 22 12'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 20px 20px !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
}

.leaflet-control-layers-toggle::before { content: '' !important; display: none !important; }
.leaflet-control-layers-toggle:hover { background-color: rgba(255, 255, 255, 0.1) !important; }

.leaflet-control-layers-expanded {
    padding: 8px 12px !important;
    background: rgba(20, 22, 35, 0.95) !important;
}

.leaflet-control-layers-base label,
.leaflet-control-layers-overlays label {
    color: rgba(255, 255, 255, 0.85) !important;
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 8px 10px !important;
    margin: 2px 0 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    transition: background 0.15s ease !important;
}

.leaflet-control-layers-base label:hover,
.leaflet-control-layers-overlays label:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

/* Custom checkboxes in layer control */
.leaflet-control-layers input[type="checkbox"],
.leaflet-control-layers input[type="radio"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 4px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    cursor: pointer !important;
    position: relative !important;
    transition: all 0.15s ease !important;
    flex-shrink: 0 !important;
}

.leaflet-control-layers input[type="checkbox"]:checked,
.leaflet-control-layers input[type="radio"]:checked {
    background: rgba(59, 130, 246, 0.8) !important;
    border-color: rgba(59, 130, 246, 0.8) !important;
}

.leaflet-control-layers input[type="checkbox"]:checked::after {
    content: '' !important;
    position: absolute !important;
    left: 5px !important;
    top: 2px !important;
    width: 4px !important;
    height: 8px !important;
    border: solid white !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) !important;
}

/* Zoom controls */
.leaflet-control-zoom {
    border: none !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

.leaflet-control-zoom a {
    background: rgba(20, 22, 35, 0.8) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 34px !important;
    font-size: 18px !important;
    transition: all 0.15s ease !important;
}

.leaflet-control-zoom a:first-child { border-radius: 10px 10px 0 0 !important; border-bottom: none !important; }
.leaflet-control-zoom a:last-child  { border-radius: 0 0 10px 10px !important; }
.leaflet-control-zoom a:hover       { background: rgba(40, 45, 60, 0.9) !important; color: white !important; }

/* Attribution */
.leaflet-control-attribution {
    background: rgba(20, 22, 35, 0.6) !important;
    backdrop-filter: blur(8px) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 10px !important;
    padding: 4px 8px !important;
    border-radius: 6px 0 0 0 !important;
}

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


/* ==========================================================================
   10. P2000 INCIDENT TILES
   ========================================================================== */

.tile-container {
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 1px;
    margin: 20px;
}

.tile {
    position: relative !important;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f4f4f4;
    padding: 14px 20px 14px 10px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 1.1);
    margin: 15px 0;
    width: 100%;
    box-sizing: border-box;
}

.tile > img {
    width: 75px;
    height: 80px;
    margin: 0 16px;
    flex-shrink: 0;
}

.tile .content {
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
    background-color: transparent;
    flex-direction: column;
    padding: 6px 8px 6px 4px;
}

.tile h2 { margin: 2px 3px 4px; font-size: 14px; }
.tile p  { margin: 4px 0 0; font-size: 12px; color: #666; text-align: left; }
.tile hr { margin: 4px 0; }

/* --- Dienst-specifieke tile kleuren --- */

#Proefallarm {
    background: linear-gradient(180deg, #f2f2f2, #d9d9d9, #b3b3b3);
    border-color: black;
    border-width: 4px;
}
#Proefallarm h2 { color: black; }
#Proefallarm p  { color: black; }
#Proefallarm hr { border: none; border-top: 2px solid black; width: 100%; }

#MEDIC01,
#MEDIC01\20\20 {
    background: linear-gradient(0deg, #FFD54F, #FFEB3B, #FFC107, #FFEB3B, #FFD54F);
    border-color: Blue;
    border-width: 4px;
}
#MEDIC01 h2 { color: blue; text-transform: uppercase; }
#MEDIC01 p  { color: blue; }
#MEDIC01 hr { border: none; border-top: 2px solid Blue; width: 100%; }

#Lifeliner1, #Lifeliner3, #Lifeliner4 {
    background: linear-gradient(0deg, #FFD54F, #FFEB3B, #FFC107, #FFEB3B, #FFD54F);
    border-color: Red;
    border-width: 3px;
}
#Lifeliner1 h2, #Lifeliner3 h2, #Lifeliner4 h2 { color: blue; }
#Lifeliner1 p,  #Lifeliner3 p,  #Lifeliner4 p  { color: blue; }
#Lifeliner1 hr, #Lifeliner3 hr, #Lifeliner4 hr { border: none; border-top: 2px solid Red; width: 100%; }

#Politie {
    background: linear-gradient(0deg, #0044cc, #0055ff, #007bff, #0055ff, #0044cc);
    border-color: darkblue;
    border-width: 2px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 8.5);
}
#Politie h2 { color: white; }
#Politie p  { color: white; }
#Politie hr { border: none; border-top: 2px solid White; width: 100%; }

#Ambulance, #MMT {
    background: linear-gradient(0deg, #FFD54F, #FFEB3B, #FFC107, #FFEB3B, #FFD54F);
    border-color: gold;
    border-width: 2px;
}
#Ambulance h2, #MMT h2 { color: blue; }
#Ambulance p,  #MMT p  { color: blue; }
#Ambulance hr, #MMT hr { border: none; border-top: 2px solid Blue; width: 100%; }

#Brandweer {
    background: linear-gradient(0deg, #7A1A1A, #B71C1C, #C62828, #B71C1C, #7A1A1A);
    border-color: darkred;
    border-width: 2px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 8.5);
}
#Brandweer h2 { color: Gold; }
#Brandweer p  { color: Gold; }
#Brandweer hr { border: none; border-top: 2px solid gold; width: 100%; }

#OMS {
    background: black;
    border-color: darkred;
    border-width: 4px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 8.5);
}
#OMS h2 { color: Gold; }
#OMS p  { color: Gold; }
#OMS hr { border: none; border-top: 2px solid darkred; width: 100%; }

#KNRM {
    background: White;
    border-color: Orange;
    border-width: 8px;
    text-shadow: 2px 2px 8px rgba(255, 255, 255, 0.7);
}
#KNRM h2 { color: Black; }
#KNRM p  { color: Black; }
#KNRM hr { border: none; border-top: 4px solid Orange; width: 100%; }

#Overig {
    background: linear-gradient(0deg, #7A1A1A, #B71C1C, #C62828, #B71C1C, #7A1A1A);
    border-color: darkred;
    border-width: 2px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 8.5);
}
#Overig h2 { color: Gold; }
#Overig p  { color: Gold; }
#Overig hr { border: none; border-top: 2px solid gold; width: 100%; }


/* GRIP alarm */
.tile[data-prioriteit="GRIP"] {
    background-color: black;
    border: 4px solid red;
    color: gold;
    animation: knipperen 2s infinite;
}
.tile[data-prioriteit="GRIP"] hr {
    border: none;
    border-top: 2px solid #FF4500;
    width: 100%;
    animation: knipperende-hr 2s infinite;
}

/* Tile filtering */
.tile.filtered { display: none !important; }

/* Share knop zichtbaar op lichte tiles (ambulance, lifeliner) */
.tile-share-btn {
    right: 6px !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
}

#Ambulance .tile-share-btn,
#MMT .tile-share-btn,
#MEDIC01 .tile-share-btn,
#Lifeliner1 .tile-share-btn,
#Lifeliner3 .tile-share-btn,
#Lifeliner4 .tile-share-btn,
#Proefallarm .tile-share-btn,
#KNRM .tile-share-btn {
    color: rgba(0, 0, 0, 0.5) !important;
    text-shadow: none !important;
}

#Ambulance .tile-share-btn:hover,
#MMT .tile-share-btn:hover,
#MEDIC01 .tile-share-btn:hover,
#Lifeliner1 .tile-share-btn:hover,
#Lifeliner3 .tile-share-btn:hover,
#Lifeliner4 .tile-share-btn:hover,
#Proefallarm .tile-share-btn:hover,
#KNRM .tile-share-btn:hover {
    color: rgba(0, 0, 0, 0.8) !important;
    background: rgba(0, 0, 0, 0.1) !important;
}


/* ==========================================================================
   11. NEWS INDICATOR & POPUP
   ========================================================================== */

.news-indicator {
    display: inline-block;
    cursor: pointer;
    font-size: 16px;
    vertical-align: middle;
    position: relative;
}

.news-indicator::before {
    content: "📰";
    padding: 4px;
    transition: transform 0.2s ease;
}

.news-indicator:hover::before { transform: scale(1.1); }

.news-popup {
    display: none;
    position: absolute;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    padding: 8px 0;
    min-width: 200px;
    max-width: 280px;
    z-index: 999999;
    right: 10px;
}

.news-popup::before {
    content: "";
    position: absolute;
    top: -8px;
    right: 55px;
    width: 12px;
    height: 15px;
    background: #1f2937;
    border-left: 1px solid #374151;
    border-top: 1px solid #374151;
    transform: rotate(45deg);
}

.news-popup a {
    display: block;
    padding: 10px 16px;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s ease;
    line-height: 1.4;
    white-space: nowrap;
}

.news-popup a:hover {
    background: #374151;
    color: #60a5fa;
    padding-left: 20px;
}


/* ==========================================================================
   12. ADSB EMERGENCY SQUAWKS
   ========================================================================== */

.emergency-7700::before,
.emergency-7600::before,
.emergency-7500::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: emergencyPulse 1.2s infinite;
    z-index: -1;
    pointer-events: none;
}

.emergency-7700::before { background: rgba(255, 0, 0, 0.7); }
.emergency-7600::before { background: rgba(255, 165, 0, 0.7); }
.emergency-7500::before { background: rgba(255, 255, 0, 0.7); }


/* ==========================================================================
   13. SETTINGS OVERLAY - Glassmorphism
   ========================================================================== */

#settings-overlay {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 340px !important;
    max-width: 100vw !important;
    z-index: 2000 !important;
    background: rgba(15, 15, 25, 0.92) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.5) !important;
    transform: translateX(100%) !important;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
}

#settings-overlay.visible { transform: translateX(0) !important; }
#settings-overlay.hidden  { transform: translateX(100%) !important; }

/* Settings container */
.settings-container {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    color: white !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Settings header */
.pd4pm-settings-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 24px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    flex-shrink: 0 !important;
}

.pd4pm-settings-header h2 {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
}

.pd4pm-close-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px !important;
    color: rgba(255, 255, 255, 0.8) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
}

.pd4pm-close-btn svg { width: 18px !important; height: 18px !important; }
.pd4pm-close-btn:hover { background: rgba(255, 255, 255, 0.12) !important; color: #ffffff !important; }

/* Settings tabs */
.pd4pm-tabs {
    display: flex !important;
    padding: 0 24px !important;
    gap: 4px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    flex-shrink: 0 !important;
}

.pd4pm-tab {
    flex: 1 !important;
    padding: 14px 8px !important;
    background: none !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
}

.pd4pm-tab:hover { color: rgba(255, 255, 255, 0.8) !important; }
.pd4pm-tab.active { color: #ffffff !important; }

.pd4pm-tab.active::after {
    content: '' !important;
    position: absolute !important;
    bottom: -1px !important;
    left: 0 !important;
    right: 0 !important;
    height: 2px !important;
    background: #3b82f6 !important;
    border-radius: 2px 2px 0 0 !important;
}

.pd4pm-tab-icon { width: 16px !important; height: 16px !important; opacity: 0.7 !important; }
.pd4pm-tab-icon svg { width: 16px !important; height: 16px !important; }
.pd4pm-tab.active .pd4pm-tab-icon { opacity: 1 !important; }

/* Tab content */
.pd4pm-tab-content {
    flex: 1 !important; overflow-y: auto !important; padding: 16px !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(255,255,255,0.15) transparent !important;
}
.pd4pm-tab-content::-webkit-scrollbar { width: 6px !important; }
.pd4pm-tab-content::-webkit-scrollbar-track { background: transparent !important; }
.pd4pm-tab-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15) !important; border-radius: 3px !important; }
.pd4pm-tab-content::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25) !important; }
.pd4pm-tab-panel { display: none !important; }
.pd4pm-tab-panel.active { display: block !important; }

/* Sections */
.pd4pm-section { margin-bottom: 20px !important; }
.pd4pm-section:last-child { margin-bottom: 0 !important; }

.pd4pm-section-title {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.4) !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    margin: 0 0 10px 0 !important;
}

/* Province filter table */
.pd4pm-filter-table { width: 100% !important; border-collapse: collapse !important; }

.pd4pm-filter-table thead th {
    font-size: 11px !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.5) !important;
    text-align: center !important;
    padding: 0 0 6px 0 !important;
}
.pd4pm-filter-table thead th:first-child { text-align: left !important; }

.pd4pm-filter-table tbody td { padding: 6px 0 !important; vertical-align: middle !important; }
.pd4pm-filter-table tbody td:not(:first-child) { text-align: center !important; }
.pd4pm-filter-table tbody tr { border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important; }
.pd4pm-filter-table tbody tr:last-child { border-bottom: none !important; }

/* Province labels & dots */
.pd4pm-province-label {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.pd4pm-province-dot { width: 10px !important; height: 10px !important; border-radius: 50% !important; flex-shrink: 0 !important; }
.pd4pm-province-dot--friesland  { background: #3b82f6 !important; }
.pd4pm-province-dot--groningen  { background: #22c55e !important; }
.pd4pm-province-dot--drenthe    { background: #f97316 !important; }
.pd4pm-province-dot--overijssel { background: #e11d48 !important; }

/* Sub-tabs (Kaart & Lijst / Push) */
.pd4pm-subtabs { display: flex !important; gap: 4px !important; padding: 0 0 10px 0 !important; border-bottom: 1px solid rgba(255,255,255,0.06) !important; margin-bottom: 14px !important; }
.pd4pm-subtab { flex: 1 !important; padding: 8px 12px !important; background: transparent !important; border: none !important; color: rgba(255,255,255,0.4) !important; font-family: inherit !important; font-size: 13px !important; font-weight: 500 !important; cursor: pointer !important; border-bottom: 2px solid transparent !important; transition: all 0.2s !important; }
.pd4pm-subtab:hover { color: rgba(255,255,255,0.7) !important; }
.pd4pm-subtab.active { color: #ff4400 !important; border-bottom-color: #ff4400 !important; }
.pd4pm-subtab-panel { display: none !important; }
.pd4pm-subtab-panel.active { display: block !important; }

/* Section description */
.pd4pm-section-desc { font-size: 11px !important; color: rgba(255,255,255,0.35) !important; margin: -6px 0 10px !important; line-height: 1.4 !important; }

/* Marker timer slider */
.pd4pm-slider-row { display: flex !important; align-items: center !important; gap: 12px !important; }
.pd4pm-slider { flex: 1 !important; -webkit-appearance: none !important; appearance: none !important; height: 4px !important; background: rgba(255,255,255,0.12) !important; border-radius: 2px !important; outline: none !important; }
.pd4pm-slider::-webkit-slider-thumb { -webkit-appearance: none !important; width: 18px !important; height: 18px !important; border-radius: 50% !important; background: #ff4400 !important; cursor: pointer !important; border: 2px solid rgba(0,0,0,0.3) !important; box-shadow: 0 1px 4px rgba(0,0,0,0.3) !important; }
.pd4pm-slider::-moz-range-thumb { width: 18px !important; height: 18px !important; border-radius: 50% !important; background: #ff4400 !important; cursor: pointer !important; border: 2px solid rgba(0,0,0,0.3) !important; box-shadow: 0 1px 4px rgba(0,0,0,0.3) !important; }
.pd4pm-slider::-webkit-slider-runnable-track { height: 4px !important; border-radius: 2px !important; }
.pd4pm-slider::-moz-range-track { height: 4px !important; background: rgba(255,255,255,0.12) !important; border-radius: 2px !important; border: none !important; }
.pd4pm-slider-value { min-width: 50px !important; text-align: right !important; font-size: 14px !important; font-weight: 600 !important; color: #ff4400 !important; white-space: nowrap !important; }


/* Toggle switches */
.pd4pm-toggle {
    position: relative !important;
    display: inline-block !important;
    width: 44px !important;
    height: 24px !important;
    cursor: pointer !important;
}

.pd4pm-toggle input { opacity: 0 !important; width: 0 !important; height: 0 !important; position: absolute !important; }

.pd4pm-toggle-slider {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 24px !important;
    transition: all 0.3s ease !important;
}

.pd4pm-toggle-slider::before {
    content: '' !important;
    position: absolute !important;
    width: 18px !important; height: 18px !important;
    left: 3px !important; bottom: 3px !important;
    background: white !important;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.pd4pm-toggle input:checked + .pd4pm-toggle-slider { background: #3b82f6 !important; }
.pd4pm-toggle input:checked + .pd4pm-toggle-slider::before { transform: translateX(20px) !important; }
.pd4pm-toggle--push input:checked + .pd4pm-toggle-slider { background: #22c55e !important; }
.pd4pm-toggle--small { transform: scale(0.8); transform-origin: right center; }

/* Radio buttons */
.pd4pm-radio-group { display: flex !important; flex-direction: column !important; gap: 8px !important; }

.pd4pm-radio-option {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 14px 16px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.pd4pm-radio-option:hover { background: rgba(255, 255, 255, 0.06) !important; border-color: rgba(255, 255, 255, 0.1) !important; }
.pd4pm-radio-option:has(input:checked) { background: rgba(59, 130, 246, 0.1) !important; border-color: rgba(59, 130, 246, 0.3) !important; }
.pd4pm-radio-option input { display: none !important; }

.pd4pm-radio-button {
    width: 20px !important; height: 20px !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    position: relative !important;
    transition: all 0.2s ease !important;
}

.pd4pm-radio-option:has(input:checked) .pd4pm-radio-button { border-color: #3b82f6 !important; }

.pd4pm-radio-button::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important; left: 50% !important;
    transform: translate(-50%, -50%) scale(0) !important;
    width: 10px !important; height: 10px !important;
    background: #3b82f6 !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
}

.pd4pm-radio-option:has(input:checked) .pd4pm-radio-button::after { transform: translate(-50%, -50%) scale(1) !important; }

.pd4pm-radio-label { display: flex !important; flex-direction: column !important; gap: 2px !important; }
.pd4pm-radio-title { font-size: 14px !important; font-weight: 500 !important; color: rgba(255, 255, 255, 0.9) !important; }
.pd4pm-radio-desc  { font-size: 12px !important; color: rgba(255, 255, 255, 0.4) !important; }

/* Setting rows */
.pd4pm-setting-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 14px 16px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.pd4pm-setting-label {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.pd4pm-setting-icon { width: 20px !important; height: 20px !important; color: rgba(255, 255, 255, 0.5) !important; }
.pd4pm-setting-icon svg { width: 20px !important; height: 20px !important; }

/* Push notification status */
.pd4pm-push-status {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 14px 16px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    font-size: 13px !important;
    color: rgba(255, 255, 255, 0.7) !important;
}

.pd4pm-push-status-icon { width: 18px !important; height: 18px !important; flex-shrink: 0 !important; }
.pd4pm-push-status-icon svg { width: 18px !important; height: 18px !important; }

.pd4pm-push-status--enabled  { border-color: rgba(34, 197, 94, 0.2) !important; background: rgba(34, 197, 94, 0.08) !important; }
.pd4pm-push-status--enabled .pd4pm-push-status-icon { color: #22c55e !important; }
.pd4pm-push-status--disabled { border-color: rgba(239, 68, 68, 0.2) !important; background: rgba(239, 68, 68, 0.08) !important; }
.pd4pm-push-status--disabled .pd4pm-push-status-icon { color: #ef4444 !important; }

/* Push filter UI */
.pd4pm-push-prov-group { margin-bottom: 2px; border-radius: 6px; overflow: hidden; }

.pd4pm-push-prov-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px; cursor: pointer;
    background: rgba(255,255,255,0.03);
    transition: background 0.15s; user-select: none;
}
.pd4pm-push-prov-header:hover { background: rgba(255,255,255,0.06); }
.pd4pm-push-prov-toggle { display: flex; align-items: center; gap: 8px; }
.pd4pm-push-chevron { color: rgba(255,255,255,0.4); font-size: 12px; transition: transform 0.2s; width: 14px; text-align: center; }

.pd4pm-push-prov-diensten {
    padding: 4px 10px 8px 28px;
    display: flex; flex-wrap: wrap; gap: 4px 12px;
    background: rgba(255,255,255,0.02);
}

.pd4pm-push-dienst-label { display: flex; align-items: center; gap: 5px; cursor: pointer; padding: 3px 0; min-width: 90px; }
.pd4pm-push-dienst-cb { width: 15px; height: 15px; accent-color: #3b82f6; cursor: pointer; }
.pd4pm-push-dienst-name { font-size: 12px; color: rgba(255,255,255,0.75); }

/* Capcodes/keywords extra headers */
.pd4pm-push-extra-header { border-top: 1px solid rgba(255,255,255,0.06); margin-top: 4px; }
.pd4pm-push-extra-icon { font-size: 14px; margin-right: 4px; }
.pd4pm-push-extra-content { padding: 8px 10px 10px; background: rgba(255,255,255,0.02); }

/* Chips */
.pd4pm-push-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 4px; }

.pd4pm-push-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px;
    background: rgba(59,130,246,0.2); border: 1px solid rgba(59,130,246,0.3);
    border-radius: 12px; font-size: 12px; color: rgba(255,255,255,0.85);
    font-family: 'JetBrains Mono', monospace;
}

.pd4pm-push-chip-remove { background: none; border: none; color: rgba(255,255,255,0.5); font-size: 11px; cursor: pointer; padding: 0 2px; line-height: 1; }
.pd4pm-push-chip-remove:hover { color: #ef4444; }

.pd4pm-push-add-row { display: flex; gap: 6px; }
.pd4pm-text-input--small { flex: 1; padding: 5px 8px !important; font-size: 12px !important; }
.pd4pm-btn--small { padding: 5px 12px !important; font-size: 14px !important; font-weight: bold; min-width: auto; }

/* Warning box */
.pd4pm-warning {
    display: flex !important; align-items: flex-start !important; gap: 10px !important;
    padding: 12px 14px !important;
    background: rgba(251, 146, 60, 0.12) !important;
    border: 1px solid rgba(251, 146, 60, 0.25) !important;
    border-radius: 10px !important;
    margin-top: 14px !important;
    font-size: 13px !important; color: rgba(255, 255, 255, 0.9) !important; line-height: 1.4 !important;
}

.pd4pm-warning-icon { width: 18px !important; height: 18px !important; color: #fb923c !important; flex-shrink: 0 !important; }
.pd4pm-warning-icon svg { width: 18px !important; height: 18px !important; }
.pd4pm-warning.hidden { display: none !important; }

/* Push provinces section */
.pd4pm-push-provinces {
    margin-top: 16px !important; padding: 16px !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border-radius: 12px !important; border: 1px solid rgba(255, 255, 255, 0.04) !important;
    transition: opacity 0.3s ease !important;
}
.pd4pm-push-provinces--disabled { opacity: 0.5 !important; pointer-events: none !important; }
.pd4pm-push-provinces-label { font-size: 12px !important; color: rgba(255, 255, 255, 0.5) !important; margin: 0 0 12px 0 !important; }
.pd4pm-push-table { margin: 0 !important; }
.pd4pm-push-table tbody td { padding: 8px 0 !important; }
.pd4pm-push-main-toggle { margin-bottom: 12px !important; }

/* Reset button */
.pd4pm-reset-btn {
    width: 100% !important; padding: 14px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 14px !important; font-weight: 500 !important;
    font-family: inherit !important; cursor: pointer !important;
    transition: all 0.2s ease !important;
}
.pd4pm-reset-btn:hover { background: rgba(255, 255, 255, 0.08) !important; border-color: rgba(255, 255, 255, 0.12) !important; color: #ffffff !important; }
.pd4pm-reset-btn:active { transform: scale(0.98) !important; }

/* Text input */
.pd4pm-text-input {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 8px !important; padding: 10px 12px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-family: inherit !important; font-size: 14px !important;
    width: 100% !important; transition: all 0.2s ease !important;
    box-sizing: border-box !important;
}
.pd4pm-text-input::placeholder { color: rgba(255, 255, 255, 0.35) !important; }
.pd4pm-text-input:focus { outline: none !important; border-color: rgba(59, 130, 246, 0.5) !important; background: rgba(255, 255, 255, 0.08) !important; }

/* Username popup */
.pd4pm-username-popup {
    position: absolute !important; top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    background: rgba(0, 0, 0, 0.6) !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    z-index: 100 !important; padding: 20px !important;
}
.pd4pm-username-popup.hidden { display: none !important; }

.pd4pm-username-popup-content {
    background: rgba(25, 28, 45, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 16px !important; padding: 24px !important;
    width: 100% !important; max-width: 280px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}
.pd4pm-username-popup-content p { margin: 0 0 10px 0 !important; font-size: 14px !important; color: rgba(255, 255, 255, 0.8) !important; line-height: 1.4 !important; }
.pd4pm-username-popup-content .pd4pm-text-input { margin-bottom: 16px !important; }
.pd4pm-username-popup-buttons { display: flex !important; gap: 10px !important; }

/* Settings buttons (in popup) - Note: .pd4pm-btn is also used for nav buttons, 
   the popup variant gets flex:1 from being inside .pd4pm-username-popup-buttons */
.pd4pm-username-popup-buttons .pd4pm-btn { flex: 1 !important; padding: 12px 16px !important; border-radius: 10px !important; font-size: 14px !important; font-weight: 500 !important; font-family: inherit !important; cursor: pointer !important; transition: all 0.2s ease !important; border: none !important; }
.pd4pm-btn--primary { background: #3b82f6 !important; color: white !important; }
.pd4pm-btn--primary:hover { background: #2563eb !important; }
.pd4pm-btn--secondary { background: rgba(255, 255, 255, 0.08) !important; color: rgba(255, 255, 255, 0.8) !important; border: 1px solid rgba(255, 255, 255, 0.12) !important; }
.pd4pm-btn--secondary:hover { background: rgba(255, 255, 255, 0.12) !important; color: white !important; }


/* ==========================================================================
   14. USER IDENTIFIER (inline styles van index.html)
   ========================================================================== */

.user-identifier-section { margin-bottom: 15px; }
.user-identifier-section label { display: block; margin-bottom: 5px; font-weight: bold; }

#user-identifier {
    width: 100%; max-width: 250px;
    padding: 8px; border: 1px solid #ccc;
    border-radius: 4px; font-size: 14px;
}

.info-text { display: block; margin-top: 5px; color: #666; font-size: 12px; font-style: italic; }


/* ==========================================================================
   15. HIDE OLD/UNUSED ELEMENTS
   ========================================================================== */

.filter-table-container,
.filter-table,
.filter-controls,
.bulk-filter-actions,
.construction-notice,
.push-notification-settings,
#settings-button,
.checkmark-label,
.toggle-switch:not(.pd4pm-toggle),
#apply-filters,
#text-filter,
.settings-section:not(.pd4pm-section),
#close-settings:not(.pd4pm-close-btn) {
    display: none !important;
}


/* ==========================================================================
   16. KEYFRAME ANIMATIONS
   ========================================================================== */

/* Slide-in animatie voor nieuwe tiles */
/* Scroll naar top knop in incidenten lijst */
#scroll-to-top-btn {
    position: fixed;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.9);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 999;
}

#scroll-to-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

#scroll-to-top-btn:hover {
    transform: scale(1.1);
    background: rgba(249, 115, 22, 1);
}

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

.tile-new {
    animation: tileSlideIn 0.35s ease-out forwards;
}

@keyframes knipperen {
    0%   { border-color: #FF4500; border-width: 4px; }
    20%  { border-color: #FFA500; border-width: 4px; }
    40%  { border-color: #FFD700; border-width: 4px; }
    60%  { border-color: #FFEA00; border-width: 4px; }
    80%  { border-color: #FF8C00; border-width: 4px; }
    100% { border-color: #FF4500; border-width: 4px; }
}

@keyframes knipperende-hr {
    0%   { border-color: #FF4500; }
    20%  { border-color: #FFA500; }
    40%  { border-color: #FFD700; }
    60%  { border-color: #FFEA00; }
    80%  { border-color: #FF8C00; }
    100% { border-color: #FF4500; }
}

@keyframes emergencyPulse {
    0%   { transform: translate(-50%, -50%) scale(0.7); opacity: 0.8; }
    50%  { transform: translate(-50%, -50%) scale(1.4); opacity: 0.3; }
    100% { transform: translate(-50%, -50%) scale(0.7); opacity: 0.8; }
}


/* ==========================================================================
   17. RESPONSIVE - TABLET (≤ 768px)
   ========================================================================== */

@media (max-width: 768px) {
    
    /* List container -> bottom panel */
    #list-container {
        width: 100vw !important;
        height: 40vh;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    
    .container {
        height: calc(100vh - 70px);
    }
    
    /* Tab navigation -> vertical met grip boven */
    .tab-navigation {
        flex-direction: column !important;
        position: relative !important;
    }
    
    .tab-navigation::before {
        height: 10px !important;
        width: 100% !important;
        cursor: ns-resize !important;
        flex-shrink: 0 !important;
    }
    
    .tab-navigation::after {
        top: 3px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 32px !important;
        height: 4px !important;
    }
    
    .tab-buttons { height: 28px !important; width: 100% !important; }
    
    #list-container { width: 100vw !important; right: 0 !important; left: 0 !important; }
    .tab-navigation { width: 100% !important; }
    
    /* Datum picker & modus indicator */
    #datum-picker {
        top: calc(80px + env(safe-area-inset-top, 0px));
        left: 8px;
        font-size: 11px;
        padding: 7px 8px;
    }
    
    #modus-indicator {
        top: calc(80px + env(safe-area-inset-top, 0px));
        left: 148px;
        font-size: 10px;
        padding: 6px 10px;
    }
    
    /* Leaflet controls kleiner */
    .leaflet-control-layers-toggle { width: 36px !important; height: 36px !important; background-size: 18px 18px !important; }
    .leaflet-control-zoom a { width: 32px !important; height: 32px !important; line-height: 30px !important; font-size: 16px !important; }
    
    /* Tiles mobiel */
    .tile-container { padding: 10px; gap: 1px; margin: 1px; }
    .tile { margin: 8px 0; padding: 12px 16px 12px 8px; }
    .tile > img { width: 60px; height: 60px; border-radius: 10px; margin: 0 12px; }
    .tile .content { padding: 4px 6px 4px 2px; width: 100%; }
    .tile h2 { margin: 1px 2px 3px; font-size: 10px; }
    .tile p  { font-size: 8px; margin: 3px 0 0; }
    
    /* Settings overlay fullscreen op mobiel */
    #settings-overlay { width: 100% !important; border-left: none !important; }
    .pd4pm-tabs { padding: 0 16px !important; }
    .pd4pm-tab-content { padding: 20px 16px !important; padding-bottom: 40px !important; }
    .pd4pm-settings-header { padding: 16px !important; }
}


/* ==========================================================================
   18. RESPONSIVE - PORTRAIT MOBILE (≤ 768px portrait)
   ========================================================================== */

@media (max-width: 768px) and (orientation: portrait) {
    #list-container {
        width: 100vw !important;
        height: 40vh;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
    }
}


/* ==========================================================================
   19. RESPONSIVE - LANDSCAPE MOBILE (≤ 1000px landscape)
   ========================================================================== */

@media (max-width: 1000px) and (orientation: landscape) {
    #list-container { display: none !important; }
}


/* ==========================================================================
   20. RESPONSIVE - SMALL MOBILE (≤ 500px)
   ========================================================================== */

@media (max-width: 500px) {
    /* Hide logo text en desktop-only buttons */
    span.pd4pm-logo-text { display: none !important; }
    button.pd4pm-btn.pd4pm-btn--settings,
    a.pd4pm-btn.pd4pm-btn--log { display: none !important; }
    
    /* Show mobile dropdown items */
    .pd4pm-dropdown-mobile-only { display: block !important; }
    
    /* Compactere dropdown */
    div.pd4pm-dropdown { padding: 6px !important; max-height: 80vh !important; overflow-y: auto !important; }
    .pd4pm-dropdown-item { padding: 10px 12px !important; font-size: 13px !important; gap: 10px !important; }
    .pd4pm-dropdown-item svg { width: 16px !important; height: 16px !important; }
    div.pd4pm-dropdown-header { padding: 8px 12px 6px !important; font-size: 9px !important; }
    div.pd4pm-dropdown-divider { margin: 6px 12px !important; }
}


/* ==========================================================================
   21. RESPONSIVE - EXTRA SMALL (≤ 480px)
   ========================================================================== */

@media (max-width: 480px) {
    nav.pd4pm-nav { padding: env(safe-area-inset-top, 0px) 12px 0 12px !important; }
    div.pd4pm-time { font-size: 24px !important; }
    div.pd4pm-date { font-size: 10px !important; }
    
    .pd4pm-btn { width: 42px !important; height: 42px !important; min-width: 42px !important; min-height: 42px !important; border-radius: 10px !important; }
    .pd4pm-btn svg { width: 20px !important; height: 20px !important; }
    a.pd4pm-logo img { width: 40px !important; height: 40px !important; }
    div.pd4pm-actions { gap: 6px !important; }
    .pd4pm-btn[data-tooltip]::before { display: none !important; }
    
    div.pd4pm-dropdown { min-width: 200px !important; right: -8px !important; max-width: calc(100vw - 24px) !important; }
    
    /* Datum picker nog kleiner */
    #datum-picker { font-size: 10px; padding: 6px 7px; border-radius: 6px; }
    #modus-indicator { left: 135px; font-size: 9px; padding: 5px 8px; }
}


/* ==========================================================================
   22. RESPONSIVE - TINY (≤ 360px)
   ========================================================================== */

@media (max-width: 360px) {
    nav.pd4pm-nav { padding: env(safe-area-inset-top, 0px) 8px 0 8px !important; }
    
    .pd4pm-btn { width: 38px !important; height: 38px !important; min-width: 38px !important; min-height: 38px !important; }
    .pd4pm-btn svg { width: 18px !important; height: 18px !important; }
    div.pd4pm-time { font-size: 22px !important; }
    a.pd4pm-logo img { width: 36px !important; height: 36px !important; }
    div.pd4pm-actions { gap: 4px !important; }
    
    div.pd4pm-dropdown { min-width: 180px !important; right: -4px !important; }
}


/* ==========================================================================
   23. DESKTOP - Tab bar & grip overrides (> 768px)
   ========================================================================== */

@media (min-width: 769px) {
    .tab-navigation {
        flex-direction: row !important;
        height: 32px !important;
        position: relative !important;
    }
    
    /* Grip zone links */
    .tab-navigation::before {
        width: 10px !important;
        height: 100% !important;
        flex-shrink: 0 !important;
        cursor: ew-resize !important;
    }
    
    /* Grip indicator verticaal links */
    .tab-navigation::after {
        top: 50% !important;
        left: 3px !important;
        transform: translateY(-50%) !important;
        width: 4px !important;
        height: 24px !important;
    }
    
    .tab-buttons { height: 32px !important; }
    .tab-button  { height: 32px !important; }
}