:root {
    --title: "Surveillance UI";
    --author: "Pan Optikum";
    --contact: "artur_loves_pan@none-of-your.business";
    --description: "A responsive, interactive security camera monitoring system with dynamic neon glitch effects, system logging, and real-time feed interference. Features offline cameras, color/monochrome toggling, and grid layout options.";
    --keywords: "surveillance, security cameras, glitch effects, CCTV, monitoring system, cyberpunk, neon glitches, system log, RGB split, interactive controls, responsive design, feed interference, matrix effects, camera grid, real-time logging";
    --last-modified: "2077-03-19";
    --content-language: "en";
    --generator: "HTML5, CSS3, JavaScript, dynamic glitch effects, real-time event logging, responsive grid layouts, video manipulation, neon color effects, scanline animations, RGB channel splitting, customizable viewing modes";

    --primary-bg: #0e0e12;
    --feed-bg: #121218;
    --accent-color: #2196f3;
    --error-color: #f44336;
    --success-color: #4caf50;
    --text-color: #e0e0e0;
    --grid-gap: 10px;
    --border-radius: 4px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-color);
    font-family: "Share Tech Mono", monospace;
    overflow-x: hidden;
    padding: 15px;
    line-height: 1.2;
    font-size: 14px;
}

.security-system {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.system-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* Align items to the top instead of center */
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border-bottom: 1px solid var(--accent-color);
}

.system-title h1 {
    font-size: 24px;
    letter-spacing: 2px;
    position: relative;
    margin: 0;
    color: var(--accent-color);
}

.glitch-text {
    position: relative;
    display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
    content: "μSYN LABS";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
}

.glitch-text::before {
    left: -1px;
    text-shadow: 1px 0 var(--error-color);
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: 1px;
    text-shadow: -1px 0 var(--accent-color);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.subtitle {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 4px;
}

.status-alert {
    color: var(--error-color);
    font-weight: bold;
}

.status-panel {
    display: flex;
    gap: 20px;
    margin-top: 8px;
    /* Add margin to push it down */
}

.status-item {
    font-size: 12px;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 5px 10px;
    border-radius: 3px;
}

.status-label {
    opacity: 0.8;
    margin-right: 5px;
}

.status-value {
    color: var(--accent-color);
    font-weight: bold;
}

#uptime-display {
    color: var(--error-color);
}

.camera-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--grid-gap);
}

.camera-feed {
    background-color: var(--feed-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    height: 190px;
}

.camera-feed:hover {
    transform: scale(1.02);
    border-color: var(--accent-color);
    z-index: 10;
}

.camera-header,
.camera-footer {
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    z-index: 2;
}

.camera-status {
    color: var(--error-color);
    position: relative;
}

.camera-status::before {
    content: "●";
    margin-right: 3px;
    animation: blink 1s infinite;
}

.camera-content {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: #000;
}

.camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) contrast(1.2) brightness(0.9);
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(255, 255, 255, 0.04) 50%,
            transparent 100%);
    background-size: 100% 4px;
    z-index: 1;
    pointer-events: none;
    animation: scan-line-move 8s linear infinite;
}

.noise-overlay {
    position: absolute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: 0.03;
    z-index: 1;
    pointer-events: none;
}

.glitch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: transparent;
    z-index: 2;
    pointer-events: none;
}

.color-distortion {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    mix-blend-mode: hard-light;
    opacity: 0;
    z-index: 3;
    pointer-events: none;
}

.control-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    margin-top: 10px;
}

.log-terminal {
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: var(--border-radius);
    border: 1px solid rgba(33, 150, 243, 0.3);
    height: 148px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.terminal-header {
    padding: 5px 10px;
    background-color: var(--accent-color);
    color: #000;
    font-size: 11px;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    flex-shrink: 0;
}

.terminal-content {
    padding: 8px;
    font-size: 11px;
    line-height: 1.4;
    overflow-y: auto;
    flex-grow: 1;
    max-height: calc(148px - 24px);
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-btn {
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: var(--border-radius);
    padding: 8px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    transition: all 0.2s;
}

.control-btn:hover {
    background-color: var(--accent-color);
    color: #000;
}

/* Animation keyframes */
@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

@keyframes scan-line-move {
    0% {
        background-position: 0 0;
        opacity: 0.1;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        background-position: 0 100%;
        opacity: 0.1;
    }
}

@keyframes glitch-anim-1 {
    0% {
        clip-path: inset(40% 0 61% 0);
        transform: translate(-2px, 2px);
    }

    20% {
        clip-path: inset(72% 0 28% 0);
        transform: translate(-1px, 1px);
    }

    40% {
        clip-path: inset(54% 0 46% 0);
        transform: translate(1px, 3px);
    }

    60% {
        clip-path: inset(20% 0 80% 0);
        transform: translate(3px, -1px);
    }

    80% {
        clip-path: inset(66% 0 34% 0);
        transform: translate(-3px, -2px);
    }

    100% {
        clip-path: inset(91% 0 9% 0);
        transform: translate(2px, 2px);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip-path: inset(13% 0 87% 0);
        transform: translate(3px, -1px);
    }

    20% {
        clip-path: inset(25% 0 75% 0);
        transform: translate(-3px, 1px);
    }

    40% {
        clip-path: inset(63% 0 37% 0);
        transform: translate(1px, 3px);
    }

    60% {
        clip-path: inset(42% 0 58% 0);
        transform: translate(3px, 2px);
    }

    80% {
        clip-path: inset(74% 0 26% 0);
        transform: translate(2px, -3px);
    }

    100% {
        clip-path: inset(50% 0 50% 0);
        transform: translate(-2px, 2px);
    }
}

/* Fullscreen camera */
.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    border-radius: 0;
}

.camera-feed.fullscreen .camera-content {
    height: calc(100% - 60px);
}

/* Grid size controls */
.camera-grid.three-per-row {
    grid-template-columns: repeat(3, 1fr);
}

.camera-grid.two-per-row {
    grid-template-columns: repeat(2, 1fr);
}

.camera-grid.single-column {
    grid-template-columns: 1fr;
}

/* Filter toggle */
.camera-video.color-mode {
    filter: contrast(1.2) brightness(0.9);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .scan-line {
        animation: none;
        background-size: 100% 8px;
        opacity: 0.2;
    }

    .glitch-text::before,
    .glitch-text::after {
        animation: none;
    }

    .system-title h1::after,
    .camera-status::before {
        animation: none;
        opacity: 0.8;
    }
}

@keyframes rgb-shift {
    0% {
        transform: translate(0);
        filter: hue-rotate(0deg);
    }

    20% {
        transform: translate(3px, -2px);
        filter: hue-rotate(90deg);
    }

    40% {
        transform: translate(-3px, 1px);
        filter: hue-rotate(180deg);
    }

    60% {
        transform: translate(2px, 3px);
        filter: hue-rotate(270deg);
    }

    80% {
        transform: translate(-2px, -2px);
        filter: hue-rotate(360deg);
    }

    100% {
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
}

@keyframes neon-pulse {
    from {
        opacity: 0.8;
    }

    to {
        opacity: 1;
        box-shadow: 0 0 15px rgba(0, 255, 255, 0.8),
            inset 0 0 5px rgba(255, 0, 255, 0.8);
    }
}

@keyframes scan-move {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

.camera-status.offline {
    color: var(--success-color);
}

.camera-status.offline::before {
    content: "●";
    margin-right: 3px;
    animation: none;
    /* Removes the blinking animation */
    color: var(--success-color);
}