body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: #0f1116;
    color: #fff;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 240px;
    background-color: #1a1d24;
    display: flex;
    flex-direction: column;
}

/* Sidebar styling for agency header (unchanging between pages) */
.agency-header {
    display: block;
    padding: 20px;
    text-decoration: none;
    color: #fff;
    border-bottom: 1px solid #2a2f3a;
    background-color: #1f232c;
    text-align: center !important; /* Ensures text alignment is consistent */
}

.agency-header h2 {
    margin: 0;
    font-size: 18px !important; /* Forces the font size for the agency name */
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

.agency-header p {
    margin: 3px 0 0 0;
    font-size: 12px !important; /* Forces the font size for the location */
    color: #aaa !important;
    line-height: 1.2 !important;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header styling for consistency across pages */
.header {
    background: linear-gradient(90deg, #12151c, #1f232c);
    height: 110px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #2a2f3a;
}

.header img {
    height: 90px;
    margin-right: 15px;
}

.header h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    flex: 1;
    text-align: center;
}

/* Logout button */
.logout-btn {
    color: white;
    background-color: #c0392b;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    margin-left: 20px;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background-color: #e74c3c;
}

.dashboard {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    background-color: #1a1d24;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

.scroll-feed {
    height: 400px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
}
.card h3 {
    margin-top: 0;
}

.scroll-feed {
    max-width: 350px;
    height: 400px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
}

#map {
    height: 400px;
    border-radius: 8px;
}

/* Info Panel */
.info-panel {
    position: fixed;
    top: 0;
    right: -100%; /* Panel starts off-screen */
    width: 400px;
    height: 100%;
    background-color: #1a1d24;
    box-shadow: -2px 0 5px rgba(0,0,0,0.5);
    padding: 20px;
    overflow-y: auto;
    transition: right 0.5s ease; /* Smooth transition */
    z-index: 2000;
}

.info-panel.show {
    right: 0; /* This makes it visible */
}

/* You can add this for some better UX for the info panel */
.panel-header {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}
.panel-header > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* Alerts in the header */
#panelAlerts {
    background-color: #ffbd2e;  /* Example: Yellow for alerts */
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    color: #fff;
    display: inline-block;
}
.panel-section {
    margin-bottom: 20px;
    max-height: 150px; /* Ensure each section stays within bounds */
    overflow-y: auto;  /* Allows scrolling in case of overflow */
}
/* Ensure that the last section (like Wi-Fi or RF activity) gets the remaining space if needed */
.panel-section:last-child {
    flex-grow: 1;  /* Allow the last section to take any remaining space in the panel */
}
/* Additional fixes */
body {
    overflow: hidden; /* Ensure no body scroll bar is present when panel is visible */
}

.main {
    overflow: auto; /* Allow scrolling in the main section if the panel is open */
}
.mini-map {
    height: 150px;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.mini-map.visible {
    opacity: 1;
}

.last-update {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}
/* ===== Map Marker Glow ===== */

/* Online: green, fast gentle pulse */
.leaflet-interactive[stroke="#27c93f"] {
    animation: pulseGlowGreen 2s infinite ease-in-out;
}
@keyframes pulseGlowGreen {
    0%, 100% {
        filter: drop-shadow(0 0 6px rgba(39, 201, 63, 0.9));
    }
    50% {
        filter: drop-shadow(0 0 12px rgba(39, 201, 63, 1));
    }
}

/* Offline: red, static glow */
.leaflet-interactive[stroke="#ff5f56"] {
    filter: drop-shadow(0 0 6px rgba(255, 95, 86, 0.9));
}

/* Idle: yellow, slow heartbeat */
.leaflet-interactive[stroke="#ffbd2e"] {
    animation: pulseGlowYellow 4s infinite ease-in-out;
}
@keyframes pulseGlowYellow {
    0%, 100% {
        filter: drop-shadow(0 0 4px rgba(255, 189, 46, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 10px rgba(255, 189, 46, 1));
    }
}

/* ===== Agency Units Table ===== */
/* Agency Units Table */
#agencyTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: #ccc;
}

#agencyTable th, #agencyTable td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #2a2f3a;
}

#agencyTable th {
    color: #aaa;
    font-weight: normal;
}

.agency-unit-row {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.agency-unit-row:hover {
    background-color: #292d36;
    cursor: pointer;
}

.status-text {
    font-weight: bold;
}

.status-online {
    color: #27c93f; /* Green for online */
}

.status-idle {
    color: #ffbd2e; /* Yellow for idle */
}

.status-offline {
    color: #ff5f56; /* Red for offline */
}

.card h3 {
    font-size: 18px;
    color: #aaa;
    margin-bottom: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Card container */
.card {
    background-color: #1a1d24;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    margin-bottom: 20px;
}

.card:last-child {
    margin-bottom: 0;
}

/* Card container */
.card {
    background-color: #1a1d24;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    margin-bottom: 20px;
}

.card:last-child {
    margin-bottom: 0;
}

/* Card container */
.card {
    background-color: #1a1d24;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    margin-bottom: 20px;
}

.card:last-child {
    margin-bottom: 0;
}

/* Lock RF and Wi-Fi chart panel heights */
.panel-section canvas {
    max-height: 100%;
    height: 100%;
    width: 100%;
    display: block;
    object-fit: contain;
}

/* Ensure scroll doesn't break layout */
.panel-section {
    overflow: hidden;
    height: 150px;

/* Make the Wi-Fi activity panel scrollable */
.panel-section {
    margin-bottom: 20px;
    max-height: 150px; /* Ensure it's a fixed height */
    overflow-y: auto;  /* Allow scrolling */
}

/* Specific adjustment for Wi-Fi chart */
#wifiChart {
    max-height: 120px; /* Ensure the chart fits */
}
}

/* Optional: Make sure chart containers behave */
#rf-chart, #wifi-chart {
    height: 100% !important;
}

.row {
    display: flex !important;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.row > .card:nth-child(1) {
    flex: 0 0 360px; /* Threat Feed fixed width */
    max-width: 360px;
}

.row > .card:nth-child(2) {
    flex: 1 1 auto;  /* Map takes the rest */
}

/*ADDED FOR LOGS PAGES *?
/* Additional styles for log pages */
body {
    background-color: #12151c;
    color: white;
    padding: 20px;
}

h1 {
    color: #ccc;
    text-align: center;
}

ul {
    list-style: none;
    padding-left: 0;
}

li {
    background-color: #1f232c;
    margin: 10px 0;
    padding: 10px;
    border-radius: 8px;
}

a {
    color: #27c93f;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.download-btn {
    color: #ffbd2e;
}

.pre {
    background-color: #1f232c;
    padding: 20px;
    border-radius: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Sidebar Link Style */
.sidebar a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
    margin-left: 10px;  /* Add margin for spacing between icon and text */
}

/* Optionally adjust the icon size for better visual alignment */
.sidebar i {
    margin-right: 10px;
    font-size: 18px; /* You can tweak this value to align the icons with the text */
}

/* Default: hidden */
#sidebarToggle {
    display: none;
}

/* Show only on screens 767px or smaller (common mobile breakpoint) */
@media (max-width: 767px) {
    #sidebarToggle {
        display: block;
        background-color: #2c2c2c; /* match sidebar bg */
        color: white;
        border: none;
        padding: 8px 12px;
        cursor: pointer;
    }
}

    /* Make logo and header smaller */
    .header img {
        height: 70px; /* Smaller logo */
    }

    .header h1 {
        font-size: 18px;
    }

    /* Adjusting Cards and Grid Layout */
    .card {
        padding: 15px;
        margin-bottom: 15px;
        font-size: 14px; /* Smaller font size for cards */
        box-shadow: 0 0 5px rgba(0,0,0,0.4);
    }

    .grid {
        display: block; /* Stack the grid items vertically */
    }

    .row {
        display: block;
    }

    .card h3 {
        font-size: 16px;
    }

    /* Map */
    #map {
        width: 100%;
        height: 250px; /* Reduced map height for smaller screens */
    }

    /* Ensure buttons are tappable */
    .logout-btn {
        padding: 10px;
        font-size: 14px;
    }


    /* Agency Units table */
    table {
        width: 100%;
        font-size: 12px;
    }

    th, td {
        padding: 8px;
        text-align: left;
    }

    /* Smaller Status Bar */
    .status-text {
        font-size: 12px;
        margin-left: 5px;
    }

    /* Make unit rows in agency table more compact */
    .agency-unit-row td {
        padding: 10px;
    }

    /* Make unit status more compact */
    .status-text {
        font-size: 13px;
    }
}
    #sidebar.collapsed {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

