/* public/assets/css/style.css */
:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --primary-color: #ffffff;
    --secondary-color: #888888;
    --alert-color: #ffffff;
    /* Monochrome alert */
    --panel-bg: rgba(0, 0, 0, 0.95);
    --border-color: #333333;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
}

/* Typography & General */
h1,
h2,
h3,
h4 {
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    font-weight: normal;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Layout Utilities */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.flex {
    display: flex;
}

.col {
    flex-direction: column;
}

.center {
    align-items: center;
    justify-content: center;
}

.between {
    justify-content: space-between;
}

.gap-20 {
    gap: 20px;
}

/* Components */
.ctos-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    position: relative;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.ctos-panel::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
}

.ctos-panel::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
}

.ctos-header {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.ctos-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 20px;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.ctos-btn:hover {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 15px var(--primary-color);
}

.input-group {
    margin-bottom: 15px;
}

input[type="text"],
input[type="password"] {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    border-left: 2px solid var(--primary-color);
    color: #fff;
    padding: 10px;
    width: 100%;
    font-family: inherit;
    box-sizing: border-box;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

/* Animations */
@keyframes loading {
    0% {
        width: 0;
    }

    100% {
        width: 100%;
    }
}

.loader-bar {
    height: 2px;
    background: var(--primary-color);
    width: 0;
    animation: loading 2s linear infinite;
}

/* Specific Pages */
.login-wrapper {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: 400px;
    padding: 40px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--panel-bg);
    border: 1px solid var(--primary-color);
    color: var(--text-color);
    padding: 15px 20px;
    min-width: 250px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateX(50px);
    animation: slideIn 0.3s forwards;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toast.success {
    border-color: var(--primary-color);
}

.toast.error {
    border-color: var(--alert-color);
    color: var(--alert-color);
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(50px);
    }
}

/* Sidebar Specific Styles */
.search-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.8rem;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    color: #fff;
    border-left: 2px solid var(--primary-color);
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section h3 {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
    padding-left: 5px;
    border-left: 2px solid var(--secondary-color);
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu li {
    margin-bottom: 5px;
}

.nav-menu a {
    display: block;
    padding: 10px 15px;
    border: 1px solid transparent;
    transition: all 0.2s;
    font-size: 0.9rem;
    color: #aaa;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.logout-btn:hover {
    color: var(--alert-color) !important;
    border-color: var(--alert-color) !important;
}

.sys-info {
    margin-top: auto;
    font-size: 0.7rem;
    color: #666;
    border-top: 1px solid #333;
    padding-top: 10px;
}

/* Map Popups */
.ctos-popup .leaflet-popup-content-wrapper {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--primary-color);
    border-radius: 0;
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
}

.ctos-popup .leaflet-popup-tip {
    background: var(--primary-color);
}

.ctos-popup .leaflet-popup-close-button {
    color: var(--primary-color) !important;
}

/* Global Layout Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    grid-template-rows: auto 1fr;
    height: 100vh;
    gap: 20px;
    padding: 20px;
    box-sizing: border-box;
}

.dashboard-grid.with-right-panel {
    grid-template-columns: 250px 1fr 300px;
}

/* Map Infrastructure Markers */
.infra-marker {
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
    border: 2px solid #000;
    transition: transform 0.2s;
    cursor: pointer;
}

.infra-marker:hover {
    transform: scale(1.5);
    z-index: 9999;
}

/* --- Restored Page Layout Styles --- */

.header-bar {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 15px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Dashboard Widgets */
.stat-card {
    background: rgba(0, 20, 30, 0.8);
    border: 1px solid #333;
    padding: 15px;
}

.stat-card.warning {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.stat-card.critical {
    border-color: var(--alert-color);
    color: var(--alert-color);
}

.monitor-screen {
    background: #000;
    border: 1px solid var(--primary-color);
    height: 300px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#map-container {
    width: 100%;
    height: 100%;
    background: #000;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.cctv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
    overflow-y: auto;
}

/* Marker Glow */
.infra-marker-glow {
    filter: drop-shadow(0 0 5px currentColor);
    transition: transform 0.2s;
    cursor: pointer;
}

.infra-marker-glow:hover {
    transform: scale(1.5);
}

/* Visual Traffic Light Inspector */
.traffic-light {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 12px;
    border: 2px solid #333;
    transition: all 0.3s;
}

.traffic-light.red {
    background-color: #ff3333;
    box-shadow: 0 0 10px #ff3333;
    color: #fff;
}

.traffic-light.green {
    background-color: #33ff33;
    box-shadow: 0 0 10px #33ff33;
    color: #000;
}

.traffic-light.yellow {
    background-color: #ffaa00;
    box-shadow: 0 0 10px #ffaa00;
    color: #000;
}

.intersection-center {
    width: 20px;
    height: 20px;
    background: #333;
    margin: auto;
    border-radius: 2px;
}