@font-face {
    font-family: 'PrintChar21';
    src: url('fonts/PrintChar21.ttf') format('truetype');
}

@font-face {
    font-family: 'Berkelium';
    src: url('../../tools/fontbook_01/fonts/berkelium/Berkelium1541.ttf') format('truetype');
}

@font-face {
    font-family: 'Shaston';
    src: url('../../tools/fontbook_01/fonts/shaston/ShastonHi640.ttf') format('truetype');
}

:root {
    --primary-color: #36f9f6;
    --secondary-color: #ff2400;
    --highlight-color: #f6f930;
    --bg-color: #000609;
    --text-color: rgba(54, 249, 246, 0.9);
    --grid-color: rgba(54, 249, 246, 0.15);
    --warning-color: #ff2400;
    --success-color: #00ff7f;
    --error-color: #ff2400;
    --recovery-color: #00ff7f;
}

body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    font-family: 'Berkelium', 'PrintChar21', monospace;
    color: var(--text-color);
    overflow: hidden;
    line-height: 1.2;
}

.container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.scan-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent, rgba(54, 249, 246, 0.15), transparent);
    background-size: 100% 10px;
    pointer-events: none;
    opacity: 0.5;
    animation: scan 8s linear infinite;
    z-index: 100;
}

.boot-sequence {
    width: 90%;
    max-width: 900px;
    height: 90%;
    border: 2px solid var(--primary-color);
    background-color: rgba(0, 6, 9, 0.95);
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 0 20px rgba(54, 249, 246, 0.5), inset 0 0 10px rgba(54, 249, 246, 0.2);
    overflow: hidden;
}

.boot-sequence::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at center, transparent 95%, var(--primary-color) 100%),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(54, 249, 246, 0.03) 2px, rgba(54, 249, 246, 0.03) 4px);
    pointer-events: none;
}

.logo {
    font-family: 'Shaston', 'PrintChar21', monospace;
    font-size: 2.5rem;
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color);
    animation: pulse 2s infinite alternate;
}

.status-text {
    font-size: 1.2rem;
    margin-bottom: 15px;
    height: 75px;
    overflow: hidden;
}

.progress-container {
    width: 100%;
    height: 20px;
    background-color: rgba(54, 249, 246, 0.1);
    border: 1px solid var(--primary-color);
    margin-bottom: 20px;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
    transition: width 0.3s ease-in-out;
}

.system-info {
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.diagnostics {
    font-size: 0.9rem;
    margin-bottom: 20px;
    height: 150px;
    overflow-y: auto;
    border: 1px solid rgba(54, 249, 246, 0.3);
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(0, 0, 0, 0.2);
}

.diagnostics::-webkit-scrollbar {
    width: 6px;
}

.diagnostics::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.diagnostics::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 2px;
}

.visual-display {
    flex-grow: 1;
    width: 100%;
    position: relative;
    border: 1px solid rgba(54, 249, 246, 0.5);
    background-color: rgba(0, 0, 0, 0.8);
    margin-top: auto;
    overflow: hidden;
}

canvas {
    width: 100%;
    height: 100%;
}

.warning-text {
    color: var(--warning-color);
    animation: blink 1s infinite;
}

.success-text {
    color: var(--success-color);
}

/* Error and recovery styles */
.error-message {
    color: var(--error-color);
    animation: errorBlink 0.5s infinite;
    font-weight: bold;
}

.recovery-message {
    color: var(--recovery-color);
    font-weight: bold;
}

.buffer-overflow {
    color: var(--error-color);
    word-break: break-all;
    font-family: monospace;
    font-size: 0.8rem;
    opacity: 0.7;
    animation: fadeIn 0.3s ease-in;
}

.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

/* Visual distortion effects */
.distorted {
    position: relative;
    animation: distort 0.5s infinite;
}

.distorted::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        rgba(255, 36, 0, 0.2) 1px,
        transparent 2px,
        transparent 10px
    );
    pointer-events: none;
    z-index: 5;
    animation: scanlines 2s linear infinite;
}

.glitch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 36, 0, 0.15);
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 10;
    animation: glitchFlash 0.5s ease-out;
}

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

@keyframes blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0.2;
    }
}

@keyframes errorBlink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0.6;
    }
}

@keyframes pulse {
    0% {
        text-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color);
    }
    100% {
        text-shadow: 0 0 2px var(--primary-color), 0 0 20px var(--primary-color), 0 0 30px var(--primary-color);
    }
}

@keyframes distort {
    0% {
        transform: skewX(0deg);
    }
    20% {
        transform: skewX(2deg);
    }
    40% {
        transform: skewX(-2deg);
    }
    60% {
        transform: skewX(1deg);
    }
    80% {
        transform: skewX(-1deg);
    }
    100% {
        transform: skewX(0deg);
    }
}

@keyframes scanlines {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(100%);
    }
}

@keyframes glitchFlash {
    0% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 0.7;
    }
}

@keyframes fadeOut {
    0% {
        opacity: 0.7;
    }
    100% {
        opacity: 0;
    }
}

.typing {
    border-right: 0.15em solid var(--primary-color);
    animation: typing 1s steps(1) infinite;
}

@keyframes typing {
    50% {
        border-color: transparent;
    }
}

.glitch {
    position: relative;
}

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

.glitch::before {
    color: var(--secondary-color);
    z-index: -1;
    animation: glitch-effect 3s infinite;
}

.glitch::after {
    color: var(--highlight-color);
    z-index: -2;
    animation: glitch-effect 2s infinite reverse;
}

@keyframes glitch-effect {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-3px, 3px);
    }
    40% {
        transform: translate(-3px, -3px);
    }
    60% {
        transform: translate(3px, 3px);
    }
    80% {
        transform: translate(3px, -3px);
    }
    100% {
        transform: translate(0);
    }
}