:root {
    --primary-color: #d4af37;
    /* Gold */
    --primary-hover: #b4932a;
    --secondary-color: #002347;
    /* Dark Navy Blue */
    --background-color: #f4f6f9;
    --text-color: #333;
    --sidebar-width: 250px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--secondary-color);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 20px;
    flex-shrink: 0;
    /* Prevent shrinking */
    overflow-y: auto;
}

.sidebar h2 {
    margin-bottom: 30px;
    font-size: 1.5rem;
    text-align: center;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 15px;
}

.sidebar a {
    color: #ccc;
    text-decoration: none;
    font-size: 1.1rem;
    display: block;
    padding: 10px;
    border-radius: 5px;
    transition: all 0.3s;
}

.sidebar a:hover,
.sidebar a.active {
    background-color: var(--primary-color);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

h1,
h2,
h3 {
    color: var(--secondary-color);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* Buttons */
.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    color: white;
    /* Trying white first, if gold is dark enough, else #002347 */
    background-color: var(--secondary-color);
    /* Use Dark Blue for primary actions instead of Gold for better readability? User said follow logo. Let's use Dark Blue for Buttons and Gold for Accents? Or Gold Buttons? */
    /* Let's stick to the variables but swap them if needed. 
       Actually, standard usage: Primary Action = Brand Color. 
       If I set --primary-color to Gold, buttons become Gold. 
       Let's override .btn to use --secondary-color (Blue) for main buttons, 
       and maybe use Gold for specific calls to action or hover.
       OR, use --secondary-color as the main button color since it's the "Official" color.
    */
    background-color: var(--secondary-color);
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #003366;
    /* Lighter Blue */
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th,
td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    color: var(--secondary-color);
    font-weight: 600;
}

tr:hover {
    background-color: #f1f1f1;
}

/* Login Page Support */
body.login-page {
    justify-content: center;
    align-items: center;
    background-color: var(--secondary-color);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-box h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 50%;
    border-radius: 8px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}


/* Responsive Design */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow-y: auto;
        /* Enable body scroll on mobile */
    }

    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        overflow-x: auto;
        align-items: center;
        padding: 10px;
        flex-shrink: 0;
    }

    .sidebar h2 {
        font-size: 1rem;
        margin: 0;
        margin-left: 10px;
        margin-right: 20px;
    }

    .sidebar img {
        width: 40px !important;
    }

    .sidebar ul {
        display: flex;
        flex-direction: row;
        gap: 10px;
    }

    .sidebar li {
        margin-bottom: 0;
    }

    .sidebar a {
        padding: 5px 10px;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .main-content {
        overflow-y: visible;
    }

    /* Stack Grid on Mobile */
    #viewHome>div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

.d-none {
    display: none !important;
}

/* Threat Map Styles */
.attack-line {
    stroke-dasharray: 10, 20;
    /* Dash pattern */
    stroke-dashoffset: 200;
    animation: dash 2s linear infinite;
    filter: drop-shadow(0 0 2px #ff0000);
}

@keyframes dash {
    to {
        stroke-dashoffset: 0;
    }
}