:root {
    --primary-color: #6200ee;
    --secondary-color: #03dac6;
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --error-color: #cf6679;
    --on-primary: #ffffff;
    --on-secondary: #000000;
    --on-background: #ffffff;
    --on-surface: #ffffff;
    --on-error: #000000;
    --font-body: 'Roboto', sans-serif;
    --font-display: 'Orbitron', sans-serif;
    --font-mono: 'Geo', monospace;
}

/* Footer Buttons (Auth, Admin, Aide) */
.footer-btn {
    display: inline-block;
    padding: 5px 15px;
    background-color: lightgrey;
    /* Light grey bg */
    color: #000;
    /* Black text */
    border: 2px solid #000;
    /* 2px Border */
    border-radius: 4px;
    font-size: 0.8em;
    cursor: pointer;
    font-family: var(--font-mono);
    /* Same font as footer */
    margin: 0 5px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.footer-btn:hover {
    background-color: yellow;
    color: #000;
}

/* Protected Link Badge */
.badge {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background-color: yellow;
    color: black;
    border: 3px solid black;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.badge .material-symbols-outlined {
    font-size: 20px !important;
    /* Smaller icon inside badge */
    color: black !important;
}

/* Make sure card parent is positioned relative for badge absolute pos */
.button-card {
    position: relative;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: rgba(220, 220, 220, 0.9);
    /* Light grey transparent */
    color: #000;
    /* Black text */
    margin: auto;
    padding: 20px;
    border: 2px solid #000;
    /* Match button border style? Or just standard border */
    width: 300px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

/* Inputs */
input[type=text],
input[type=password] {
    width: 100%;
    padding: 12px 20px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid #000;
    box-sizing: border-box;
    background-color: #333;
    /* Dark grey bg */
    color: #fff;
    /* White text */
    border-radius: 4px;
    font-family: var(--font-mono);
    /* Footer font */
    font-size: 20px;
}

/* Submit Button (Match Footer Buttons) */
.auth-submit {
    background-color: lightgrey;
    color: #000;
    padding: 10px 20px;
    margin: 8px 0;
    border: 2px solid #000;
    cursor: pointer;
    width: 100%;
    font-family: var(--font-mono);
    /* Same font as footer */
    font-size: 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    text-transform: uppercase;
    /* Uppercase text */
}

.auth-submit:hover {
    background-color: yellow;
    color: #000;
}

/* User List in Admin Modal */
.user-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    width: 100%;
}

.user-item {
    display: block;
    /* Vertical list */
    width: 100%;
    /* Full width */
    margin: 5px 0;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #ccc;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1.2rem;
    transition: background-color 0.2s;
    box-sizing: border-box;
    /* Ensure padding doesn't overflow */
}

.user-item:hover {
    background-color: #e0e0e0;
}

/* Close Button */
.close {
    position: absolute;
    right: 15px;
    top: 10px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.container label {
    display: block;
    text-align: left;
    margin-top: 10px;
    font-family: var(--font-body);
}

/* Status Modal (Split Pane) */
.modal-split-content {
    background-color: #2c2c2c;
    /* Dark Grey */
    color: #fff;
    margin: auto;
    border: 1px solid #444;
    width: 800px;
    height: 500px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    overflow: hidden;
    text-align: left;
}

.pane-left {
    width: 200px;
    background-color: #222;
    border-right: 1px solid #444;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

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

.status-menu-btn {
    padding: 15px 20px;
    color: #ccc;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background-color 0.2s, color 0.2s;
    border: none;
    background: none;
    text-align: left;
    width: 100%;
    font-size: 1.1em;
}

.status-menu-btn:hover,
.status-menu-btn.active {
    background-color: #444;
    color: #fff;
}

.status-section {
    display: none;
}

.status-section.active {
    display: block;
}

/* Charts / Bars */
.stat-bar-container {
    background-color: #444;
    border-radius: 4px;
    height: 20px;
    width: 100%;
    margin: 5px 0 15px 0;
    overflow: hidden;
    position: relative;
}

.stat-bar {
    height: 100%;
    background-color: var(--secondary-color);
    width: 0%;
    transition: width 0.5s;
}

.stat-bar-label {
    position: absolute;
    left: 5px;
    top: 0;
    font-size: 0.8em;
    line-height: 20px;
    color: #fff;
    text-shadow: 0 0 2px #000;
}

/* Service Indicators */
.service-indicator {
    display: flex;
    align-items: center;
    margin: 10px 0;
    font-size: 1.1em;
}

.indicator-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
    background-color: #555;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.indicator-dot.online {
    background-color: #00ff00;
    box-shadow: 0 0 8px #00ff00;
}

.indicator-dot.offline {
    background-color: #ff0000;
    box-shadow: 0 0 8px #ff0000;
}

/* Logs */
.log-box {
    background-color: #111;
    border: 1px solid #444;
    padding: 10px;
    font-family: monospace;
    font-size: 0.85em;
    height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    color: #bbb;
}

/* Close Button Override for Dark Modal */
.modal-split-content .close {
    color: #fff;
    z-index: 10;
    right: 10px;
    top: 5px;
}

body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--on-background);
    margin: 0;
    padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: normal;
}

/* Material Icons */
.material-symbols-outlined {
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
    vertical-align: middle;
}

/* Footer Styling */
#footer {
    font-family: var(--font-mono);
    text-align: center;
    padding: 20px;
    font-size: 1.8rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 10;
    color: #000000;
    background-color: rgba(220, 220, 220, 0.8);
}

/* Main Container Adjustment */
#main {
    padding: 20px;
    text-align: center;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#main:before {
    display: none !important;
}

/* Links */
a {
    color: var(--on-primary);
    /* Better contrast on transparent bg? or stick to theme */
    text-decoration: none;
    transition: all 0.3s;
}

a:hover {
    color: var(--primary-color);
}

/* List Styling */
ul {
    list-style: none;
    padding: 0;
}

li {
    display: inline-block;
    vertical-align: top;
    /* Align cards properly */
    margin: 15px;
}

.label {
    display: block;
    margin-top: 10px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9em;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Link Cards Styling */
.button-card {
    display: flex;
    flex-direction: column;
    /* Stack icon and text */
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    background-color: rgba(200, 200, 200, 0.2);
    /* Light grey transparent */
    border-radius: 12px;
    /* Rounded corners */
    backdrop-filter: blur(5px);
    /* Glass effect */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.button-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.5);
    background-color: rgba(200, 200, 200, 0.3);
}

.button-card .material-symbols-outlined {
    font-size: 48px;
    color: #fff;
    /* White icon stand out better on transp bg */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    transition: color 0.3s;
}

.button-card:hover .material-symbols-outlined {
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
}

/* Links Container Sequence */
#links-container {
    opacity: 0;
    transition: opacity 1.5s ease-in;
}

#links-container.visible {
    opacity: 1;
}


/* Background Animation */
#bg {
    width: 100% !important;
    height: 100% !important;
    background-image: url('../images/bg.jpg') !important;
    background-size: auto 100% !important;
    background-repeat: repeat-x !important;
    transform: none !important;
    animation: slide-bg 60s linear infinite !important;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
}

@keyframes slide-bg {
    0% {
        background-position-x: 0;
    }

    100% {
        background-position-x: -300vh;
    }
}

/* Heading Animations */
#header h1 {
    font-size: 60px;
    margin: 0;
    line-height: 1.2;
    margin-bottom: 20px;
    /* Space before cards */
}

#header h1.glowing {
    animation: glow 3s infinite alternate;
}

#header h1 span {
    display: inline-block;
    opacity: 0;
    font-size: 200px;
    animation: zoomOut 1s ease forwards;
}

@keyframes zoomOut {
    0% {
        font-size: 200px;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    100% {
        font-size: 60px;
        opacity: 1;
    }
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px #fff, 0 0 20px #fff;
    }

    to {
        text-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--secondary-color);
    }
}

/* Mobile Responsiveness */
/* Mobile Responsiveness */
@media only screen and (max-width: 768px) {

    /* Grid layout for Link Cards */
    #links-container {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        /* Force 3 columns */
        gap: 10px !important;
        justify-content: center !important;
        width: 100% !important;
        padding: 0 5px !important;
        box-sizing: border-box !important;
    }

    li {
        display: flex !important;
        justify-content: center !important;
        margin: 0 !important;
        width: auto !important;
    }

    .button-card {
        width: 100% !important;
        max-width: none !important;
        /* Remove max-width constraint to fill grid cell */
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
        margin: 0 !important;
    }

    /* Footer Buttons 3x bigger */
    #footer {
        padding: 30px !important;
        height: auto !important;
        position: relative !important;
        /* Unfix footer on mobile if content is long, or keep fixed but ensure space? User didn't ask to unfix. */
    }

    .footer-btn {
        font-size: 1.5rem !important;
        padding: 20px 40px !important;
        /* Large padding */
        margin: 10px auto !important;
        display: block !important;
        /* Stack them */
        width: 90% !important;
        /* Nearly full width */
        box-sizing: border-box !important;
    }

    /* Login inputs bigger */
    input[type=text],
    input[type=password] {
        font-size: 1.2rem !important;
        padding: 15px !important;
    }


    /* Adjust header for mobile */
    #header h1 {
        font-size: 40px !important;
    }

    #header h1 span {
        font-size: 40px !important;
    }

    /* Optimize container width for mobile grid */
    #main {
        padding: 5px !important;
        /* Reduce padding to give more space */
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    #links-container {
        width: 95vw !important;
        /* Use 95% viewport width */
        padding: 0 !important;
        gap: 5px !important;
        /* Reduce gap to fit 3 items better */
    }
}

/* User Connected Overrides - Strong Selectors */
html body.user-connected #header h1 {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

html body.user-connected #footer .copyright,
html body.user-connected #footer .ip-address {
    display: none !important;
}

html body.user-connected .footer-btn {
    transform: scale(0.8);
    margin: 0 5px;
    transform-origin: center;
}

html body.user-connected .button-card {
    transform: none !important;
    /* Ensure cards are NOT scaled down */
}

/* User Not Connected Overrides */
html body:not(.user-connected) #header h1 {
    font-size: calc(60px - 5px) !important;
}