/* Add scanlines */
/*
body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 2px,
        transparent 5px
    );
}
*/

:root {
    /*Green*/
    /*
    --theme-backgroundColour: #000000;
    --theme-fontColour: #00ff00;
    --theme-borderColour: green;
    --theme-colourLight: #27b803;
    --theme-colourMid: #004d00;
    --theme-colourDark: #003300;
    */
    --theme-backgroundColour: #000000;
    --theme-fontColour: #1fb7f8;
    --theme-borderColour: #151C40;
    --theme-colourLight: #0321b8;
    --theme-colourMid: #021057;
    --theme-colourDark: #030033;
}

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

a:hover {
    text-decoration: underline;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th,
td {
    border: 2px solid var(--theme-borderColour);
    padding: 5px;
    text-align: center;
}

th {
    background-color: var(--theme-colourDark);
}

body {
    background-color: var(--theme-backgroundColour);
    color: var(--theme-fontColour);
    font-family: "Courier New", Courier, monospace;
    font-size: 16px;
    line-height: 1.2;
    text-shadow: 0 0 1px var(--theme-fontColour), 0 0 2px var(--theme-fontColour);
    height: 100%;
    overflow-x: hidden;
}

.header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    border-bottom: 2px solid var(--theme-borderColour);
    text-align: center;
    width: 100%;
}

/* Container grid layout */
/*
.header {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    font-size: 14px;
    border-bottom: 2px solid var(--theme-borderColour);
}
*/

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

.header .logo {
    width: 50%;
    min-width: 200px;
    height: auto;
}

/* Align text to the left in the grid cells */
.left-align {
    justify-self: start;
}

/* Align text to the right in the grid cells */
.right-align {
    justify-self: end;
}

/* Main Content Area */
.content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0px, 1fr));
    padding: 5px;
    overflow-x: hidden; /* Prevent horizontal overflow */
    max-width: 100%;
}


.camera-column {
    grid-column: 1;
    grid-row: 1;
    padding: 10px;
}

.io-table {
    grid-column: 2;
    grid-row: 1;
    padding: 10px;
}

.image-list {
    grid-column: 1 / span 2;
    grid-row: 2;
    padding: 10px;
}

.footer {
    font-weight: bold;
    text-align: right;
    }

@media (max-width: 980px) {
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .header .user-info {
        text-align: center;
        margin-top: 10px;
    }
    
    .content {
        grid-template-columns: minmax(0px, 1fr);
        max-width: 100%;
        font-size: 9px;
        line-height: 1.0;
    }

    .camera-column {
        grid-column: 1;
        grid-row: 1;
        padding: 0px;
    }

    .io-table {
        grid-column: 1;
        grid-row: 2;
        max-width: 100%;
        padding: 0px;
    }

    .image-list {
        grid-column: 1;
        grid-row: 3;
        padding: 0px;
    }

    .footer {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

.camera-column img {
    width: 100%;
}

/* Status Indicators */
.circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
}

.off {
    background-color: var(--theme-colourDark);
}

.on {
    background-color: var(--theme-fontColour);
    box-shadow: 0 0 10px var(--theme-fontColour);
    animation: flash 1s infinite alternate;
}

.normal {
    background-color: var(--theme-colourDark);
}

.fault {
    background-color: #ff8c00;
    box-shadow: 0 0 10px #ff8c00;
    animation: flash 2s infinite alternate;
}

.alarm {
    background-color: #ff0000;
    box-shadow: 0 0 10px #ff0000;
    animation: flash 0.5s infinite alternate;
}

.armed {
    background-color: #1014f1;
    box-shadow: 0 0 10px #1014f1;
}

/* Flashing Text */
.text_active {
    color: var(--theme-fontColour);
    font-weight: bold;
    animation: flash 1s infinite alternate;
}

.text_inactive {
    color: var(--theme-colourLight);
    font-weight: bold;
    text-shadow: 0 0 1px var(--theme-borderColour);
}

@keyframes flash {
    0% {
        opacity: 0.2;
    }

    100% {
        opacity: 1;
    }
}

.button {
    background-color: #0a0a0a;
    color: var(--theme-fontColour);
    border: 2px solid var(--theme-borderColour);
    padding: 5px 15px;
    font-family: "Courier New", Courier, monospace;
    font-size: 14px;
    cursor: pointer; /* Pointer cursor for interactivity */
    text-shadow: 0 0 1px var(--theme-fontColour), 0 0 2px var(--theme-fontColour);
    transition: background-color 0.3s, color 0.3s; /* Smooth hover transition */
}

.button:hover {
    background-color: var(--theme-colourDark);
    color: var(--theme-fontColour);
    box-shadow: 0 0 10px var(--theme-fontColour); /* Glow effect */
}

.button:active {
    background-color: var(--theme-colourMid);
    color: var(--theme-fontColour);
}

.form-group {
    margin-bottom: 15px; /* Space between input groups */
}

input[type="text"],
input[type="password"],
input[type="email"] {
    background-color: val(--theme-colourMid);
    color: var(--theme-fontColour);
    border: 2px solid var(--theme-borderColour) !important;
    padding: 6px;
    font-family: "Courier New", Courier, monospace;
    font-size: 14px;
    text-shadow: 0 0 1px var(--theme-fontColour);
}

input[type="text"]:-webkit-autofill,
input[type="password"]:-webkit-autofill,
input[type="email"]:-webkit-autofill {
    background-color: var(--theme-colourMid) !important;
    -webkit-box-shadow: 0 0 0px 1000px var(--theme-colourMid) inset !important;
    box-shadow: 0 0 0px 1000px var(--theme-colourMid) inset !important;
    color: var(--theme-fontColour) !important;
    caret-color: var(--theme-fontColour);
    -webkit-text-fill-color: var(--theme-fontColour) !important;
}

/* Focused Input Fields */
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    background-color: var(--theme-colourMid);
    outline: none;
    border-color: var(--theme-fontColour);
    box-shadow: 0 0 5px var(--theme-fontColour);

}

/* Placeholder Text */
input::placeholder {
    color: var(--theme-colourMid);
    background-color: rgba(0, 128, 0, 0.2);
    font-style: italic;
}

/* Auto Refresh Section */
.auto-refresh {
    display: flex;
    /*align-items: left;*/
    gap: 10px;
    justify-self: start;
    align-items: center;
}

.auto-refresh label {
    color: var(--theme-fontColour);
    font-family: "Courier New", Courier, monospace;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 1px var(--theme-fontColour), 0 0 2px var(--theme-fontColour);
}

/* Checkbox styled as a glowing circle */
.auto-refresh input[type="checkbox"] {
    appearance: none;  /* Remove default checkbox styling */
    width: 20px;
    height: 20px;
    margin-right: 10px;
    box-sizing: border-box;
    border-radius: 0; /* Round shape */
    display: inline-block;
    background-color: var(--theme-colourLight);
    box-shadow: none;  /* No glow when OFF */
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer; /* Pointer for interactivity */
}

.auto-refresh input[type="checkbox"]:checked {
    background-color: var(--theme-fontColour);
    box-shadow: 0 0 10px var(--theme-fontColour); /* Glow effect for ON */
    animation: flash 1s infinite alternate; /* Flash animation for ON */
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    font-family: sans-serif;
}

.modal-content {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.modal-message {
    margin-bottom: 10px;
}

.spinner {
    border: 4px solid #ccc;
    border-top: 4px solid #333;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.footer {
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    border-top: 2px solid var(--theme-borderColour);
    margin-top: 20px;
}