@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&family=Rajdhani:wght@400;600;700&subset=latin-ext&display=swap');

:root {
    --col-bg: #050505;
    --col-text: #e0e0e0;
    --col-accent-1: #00ff9d;
    /* Matrix Green / Low-fi Green */
    --col-accent-2: #ff003c;
    /* Alert Red */
    --col-accent-3: #00f0ff;
    /* Cyber Blue */
    --col-grey-dark: #1a1a1a;
    --col-grey-mid: #333333;

    --font-mono: 'Roboto Mono', monospace;
    --font-ui: 'Rajdhani', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--col-bg);
    color: var(--col-text);
    font-family: var(--font-ui);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* CRT Overlay Effect */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%,
            rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg,
            rgba(255, 0, 0, 0.06),
            rgba(0, 255, 0, 0.02),
            rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 999;
}

.scanline {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    position: absolute;
    z-index: 1000;
    animation: scanline 8s linear infinite;
    top: 0;
    pointer-events: none;
}

@keyframes scanline {
    0% {
        top: -10%;
    }

    100% {
        top: 110%;
    }
}

/* Glitch Utility */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--col-bg);
}

.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 var(--col-accent-2);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 var(--col-accent-3);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% {
        clip: rect(20px, 9999px, 80px, 0);
    }

    20% {
        clip: rect(10px, 9999px, 30px, 0);
    }

    40% {
        clip: rect(50px, 9999px, 90px, 0);
    }

    60% {
        clip: rect(20px, 9999px, 60px, 0);
    }

    80% {
        clip: rect(90px, 9999px, 10px, 0);
    }

    100% {
        clip: rect(30px, 9999px, 50px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(90px, 9999px, 10px, 0);
    }

    20% {
        clip: rect(100px, 9999px, 20px, 0);
    }

    40% {
        clip: rect(10px, 9999px, 80px, 0);
    }

    60% {
        clip: rect(30px, 9999px, 40px, 0);
    }

    80% {
        clip: rect(50px, 9999px, 90px, 0);
    }

    100% {
        clip: rect(20px, 9999px, 30px, 0);
    }
}

/* Common Layouts */
.container-center {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    flex-direction: column;
}

.nav-next-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    background: transparent;
    color: #555;
    border: 1px solid #333;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    opacity: 0.5;
    transition: all 0.3s;
    z-index: 2000;
}

.nav-next-btn:hover {
    opacity: 1;
    color: var(--col-text);
    border-color: var(--col-text);
    background: rgba(255, 255, 255, 0.05);
}

/* Custom Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(2px);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: #000;
    border: 2px solid var(--col-accent-2);
    width: 90%;
    max-width: 500px;
    padding: 2px;
    /* Inner border gap */
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-header {
    background: var(--col-accent-2);
    color: #000;
    padding: 8px 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
}

/* UI Elements */
.floating-ui {
    position: absolute;
    color: var(--col-accent-2);
    font-size: 0.7rem;
    border: 1px solid var(--col-accent-2);
    padding: 4px;
    font-weight: 700;
    /* Bold */
    text-shadow: 0 0 5px var(--col-accent-2);
}

/* Progress Bars */
.bar-container {
    margin-bottom: 25px;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.progress-bg {
    width: 100%;
    height: 6px;
    background: #333;
}

.progress-fill {
    height: 100%;
    background: var(--col-accent-3);
    transition: width 2s cubic-bezier(0.1, 0.7, 1.0, 0.1), background 0.5s;
    position: relative;
}

/* Standard UI Components */
.box {
    border: 1px solid #333;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    margin-bottom: 20px;
}

.box::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 6px;
    height: 6px;
    border-top: 2px solid #555;
    border-left: 2px solid #555;
}

.box::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 6px;
    height: 6px;
    border-bottom: 2px solid #555;
    border-right: 2px solid #555;
}

.box h3 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.modal-content {
    padding: 20px;
    color: var(--col-text);
    text-align: center;
    font-family: var(--font-mono);
}

.modal-footer {
    padding: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
    border-top: 1px solid #333;
}

.modal-btn {
    background: transparent;
    border: 2px solid var(--col-accent-2);
    color: var(--col-accent-2);
    padding: 10px 25px;
    cursor: pointer;
    font-family: var(--font-ui);
    text-transform: uppercase;
    transition: all 0.2s;
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

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

/* Responsive Utilities */
/* Action Button */
.action-btn {
    margin-top: 40px;
    padding: 15px 40px;
    background: transparent;
    border: 2px solid var(--col-accent-2);
    color: var(--col-accent-2);
    font-family: var(--font-ui);
    font-size: 1.2rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: 0.3s;
    font-weight: 700;
}

.action-btn:hover {
    background: var(--col-accent-2);
    color: #000;
    box-shadow: 0 0 20px var(--col-accent-2);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Visualization Nodes */
.connection-lines {
    width: 300px;
    height: 300px;
    border: 2px solid var(--col-text);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: all 1s;
}

.node {
    width: 10px;
    height: 10px;
    background: var(--col-accent-3);
    position: absolute;
    border-radius: 50%;
    box-shadow: 0 0 10px var(--col-accent-3);
}

.center-node {
    width: 20px;
    height: 20px;
    background: white;
    z-index: 10;
}

.n1 {
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
}

.n2 {
    bottom: 20%;
    right: 10%;
}

.n3 {
    bottom: 20%;
    left: 10%;
}

/* Severed State */
.severed .connection-lines {
    border-color: var(--col-accent-2);
    border-style: dashed;
    transform: scale(0.8);
}

.severed .node {
    background: var(--col-accent-2);
    box-shadow: 0 0 10px var(--col-accent-2);
}

.severed .progress-fill {
    background: var(--col-accent-2);
}

/* Responsive Utilities */
@media (max-width: 900px) {

    /* Break grids */
    body {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto 1fr auto auto !important;
        height: auto !important;
        overflow-y: auto !important;
    }

    header {
        grid-column: 1 !important;
    }

    aside.left {
        grid-column: 1 !important;
        border-right: none !important;
        border-bottom: 1px solid #333;
    }

    main {
        grid-column: 1 !important;
        height: 50vh !important;
    }

    aside.right {
        grid-column: 1 !important;
        border-left: none !important;
        border-top: 1px solid #333;
    }

    footer {
        grid-column: 1 !important;
    }

    /* Alert Screen */
    .alert-container {
        grid-template-columns: 1fr !important;
        width: 95% !important;
        padding: 20px !important;
        margin: 20px 0;
    }

    .photo-frame {
        max-width: 200px;
        margin: 0 auto;
    }

    h1 {
        font-size: 2.5rem !important;
    }

    /* Navigation Button */
    .nav-next-btn {
        position: static !important;
        display: block;
        margin: 20px auto;
        text-align: center;
        width: 90%;
    }
}