/* Import the VT323 font */
@font-face {
    font-family: 'VT323';
    src: url('../fonts/VT323-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

#matrixCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.07;
    pointer-events: none;
}


#matrixCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.4;
    pointer-events: none;
    background-color: transparent;
}

.terminal {
    position: relative;
    z-index: 1;
}

@keyframes flicker {
    0% { opacity: 1; }
    50% { opacity: 0.95; }
    51% { opacity: 0.93; }
    52% { opacity: 0.95; }
    53% { opacity: 0.93; }
    54% { opacity: 0.95; }
    100% { opacity: 1; }
}

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

@keyframes reveal {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

body {
    margin: 0;
    padding: 0;
    background-color: #000000;
    color: #cccccc;
    font-family: 'VT323', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    animation: flicker 10s infinite;
    position: relative;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.03),
        rgba(255, 255, 255, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    animation: scanline 8s linear infinite;
    pointer-events: none;
}

.container {
    width: 40%;
    min-width: 500px;
    margin: 0 auto;
    padding: 2rem;
    background-color: rgba(32, 32, 32, 0.7);
    border: 1px solid #444;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
    text-align: center;
}

.terminal-header {
    text-align: left;
    padding: 0.5rem 0;
    border-bottom: 1px solid #444;
    margin-bottom: 1rem;
}

.terminal-title {
    color: #0f0;
    font-size: 0.9em;
    opacity: 0.7;
}

.terminal-body {
    text-align: left;
}

.title {
    font-size: 1.4em;
    margin: 0 0 24px 0;
    color: #ffffff;
    padding: 8px 0;
    text-transform: uppercase;
    border-bottom: 1px solid #444;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.chapter-text {
    font-size: 1.1em;
    line-height: 1.8;
    white-space: pre-wrap;
    color: #cccccc;
    margin: 20px auto;
    padding: 0;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.2);
    position: relative;
    max-width: 90%;
    text-align: left;
}

.chapter-text::before {
    content: '>';
    position: absolute;
    left: -20px;
    color: #666;
    opacity: 0.7;
}

.input-line {
    display: flex;
    align-items: center;
    margin-top: 1rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #444;
}

.prompt {
    color: #0f0;
    margin-right: 0.5rem;
    opacity: 0.8;
}

#command-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #0f0;
    caret-color: #0f0;
    font-family: 'VT323', monospace;
    font-size: 1em;
}

.navigation {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    animation: reveal 1s ease-in-out 5s forwards;
}

.nav-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: transparent;
    color: #cccccc;
    text-decoration: none;
    border: 1px solid #444;
    font-family: 'VT323', monospace;
    cursor: pointer;
    font-size: 1em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.nav-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    border-color: #666;
}

.nav-button:active {
    background-color: rgba(255, 255, 255, 0.15);
}

@media (max-width: 768px) {
    .container {
        width: 80%;
        min-width: auto;
        margin: 1rem;
        padding: 1rem;
    }

    .title {
        font-size: 1.2em;
    }

    .chapter-text {
        font-size: 1em;
        line-height: 1.6;
    }

    .nav-button {
        padding: 6px 12px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .container {
        width: 90%;
        margin: 0.5rem;
        padding: 0.5rem;
    }

    .title {
        font-size: 1.1em;
    }

    .chapter-text {
        font-size: 0.9em;
        max-width: 95%;
    }
}
