/* filename: css/main.css */

:root {
    --scan-strength: 0.16;   /* Calculated for 40% strength */
    --flicker-strength: 0.92; /* Calculated for 40% strength */
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* CRT Flicker Effect */
.crt-flicker { 
    animation: flicker 0.15s infinite; 
    pointer-events: none; 
    position: fixed; 
    inset: 0; 
    z-index: 60; 
    background: rgba(18, 16, 16, 0.02); 
    display: none; 
}
.crt-active .crt-flicker { display: block; }

@keyframes flicker {
    0% { opacity: var(--flicker-strength); }
    50% { opacity: 1.0; }
    100% { opacity: var(--flicker-strength); }
}

/* Scanlines Effect */
.scanlines {
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 50%,
        rgba(0,0,0,var(--scan-strength)) 50%,
        rgba(0,0,0,var(--scan-strength))
    );
    background-size: 100% 4px;
    position: fixed;
    inset: 0; 
    z-index: 59;
    pointer-events: none;
    display: none;
}
.crt-active .scanlines { display: block; }

/* Trace Alarm Animation */
@keyframes trace-pulse {
    0%, 100% { border-color: rgba(239, 68, 68, 0.3); box-shadow: 0 0 10px rgba(239, 68, 68, 0.1); }
    50% { border-color: rgba(239, 68, 68, 1); box-shadow: 0 0 20px rgba(239, 68, 68, 0.5) inset; }
}
.trace-active {
    animation: trace-pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    border-width: 2px;
    border-style: solid;
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    z-index: 50;
    background: transparent;
}

/* Top Edge */
.resize-n {
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    cursor: n-resize;
}

/* Bottom Edge */
.resize-s {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    cursor: s-resize;
}

/* East (Right) Edge */
.resize-e {
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: e-resize;
}

/* West (Left) Edge */
.resize-w {
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    cursor: w-resize;
}

/* Southeast (Corner) Handle */
.resize-se {
    width: 15px;
    height: 15px;
    bottom: 0;
    right: 0;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, #475569 50%);
}

/* Map specific overrides */
#wifi-map {
    background-color: #0f172a; 
    width: 100%;
    height: 100%;
}
/* Leaflet Control Overrides for Dark Mode */
.leaflet-bar a {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
    border-bottom: 1px solid #334155 !important;
}
.leaflet-bar a:hover {
    background-color: #334155 !important;
}

/* Base Overrides */
html { height: 100%; overscroll-behavior: none; }
body { height: 100%; overscroll-behavior: none; }

/* MOBILE SPECIFIC OVERRIDES */
@media (max-width: 768px) {
    .resize-handle {
        display: none !important;
    }
}