body {
    background-color: black;
    color: green;
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Prevents scrollbars on body due to screen size */
}
#screen::before {
    content: "";
    position: absolute;
    left: 0; top: 0; width: 100%; height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0,0,0,0) 0px,
        rgba(0,0,0,0.15) 2px,
        rgba(0,0,0,0.03) 4px,
        rgba(0,0,0,0) 6px
    );
    z-index: 2;
}
#screen {
    position: relative;
    width: 95vw; /* Take up most of the viewport width */
    height: 95vh; /* Take up most of the viewport height */
    border: 2px solid green;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto; /* Allow scrolling within the screen if content overflows */
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    box-shadow:
        0 0 40px 6px #21f32177,
        0 0 3px 0 #21f32188 inset,
        0 0 0 8px #001a00 inset,
        0 0 0 24px #0a0a0a inset;
    background: radial-gradient(ellipse at center, #222 80%, #000 100%);
}

#text-display {
    flex-grow: 1;
    white-space: pre-wrap; /* Respects spaces and newlines, crucial for CLI look */
    font-size: 24px; /* Match Python app's font size */
    line-height: 1.2;
    overflow-wrap: break-word; /* Wraps long lines that might overflow pre */
    margin: 0;
    animation: flicker 0.14s infinite;
    text-shadow: 0 0 4px #21f321cc, 0 0 1px #21f321cc;
}

.highlight {
    color: white;
    background-color: green;
}

.error {
    color: red;
}

#input-container {
    margin-top: 10px;
    display: flex;
    align-items: center;
}

#input-prompt {
    font-size: 24px;
    margin-right: 5px;
}

#user-input {
    background-color: black;
    color: green;
    border: 1px solid green;
    font-family: 'Courier New', Courier, monospace;
    font-size: 24px;
    padding: 5px;
    outline: none;
    flex-grow: 1;
}

/* Styles for defrag grid */
.defrag-grid {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px; /* Smaller font for the grid to fit */
    line-height: 1;
    white-space: pre;
}

.defrag-grid .error-block {
    color: red;
}

.progress-bar-container {
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
}

.progress-bar-text {
    font-size: 18px;
    margin-bottom: 5px;
}
/* Glitch animation */
@keyframes glitch {
    0% {
        text-shadow: 2px 0 red, -2px 0 blue;
        color: #00FF00;
    }
    20% {
        text-shadow: -2px 0 red, 2px 0 blue;
        color: #33FF33;
    }
    40% {
        text-shadow: 2px 2px red, -2px -2px blue;
        color: #00FF00;
    }
    60% {
        text-shadow: 2px 0 red, -2px 0 blue;
        color: #55FF55;
    }
    80% {
        text-shadow: -2px 0 red, 2px 0 blue;
        color: #00FF00;
    }
    100% {
        text-shadow: 0 0 0 #000;
        color: #00FF00;
    }
}
.glitch {
    animation: glitch 0.25s linear 2;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    98% { opacity: 0.96; }
}

#boot-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 99;
    pointer-events: none;
    opacity: 1;
    transition: opacity 1s;
}

.crt-screen {
    box-shadow: 0 0 40px 6px #21f32177, 0 0 3px 0 #21f32188 inset, 0 0 0 8px #001a00 inset, 0 0 0 24px #0a0a0a inset;
    background: radial-gradient(ellipse at center, #222 80%, #000 100%);
    border-radius: 16px;
    position: absolute;
    left: 0; top: 0; width: 100%; height: 100%;
    z-index: 99;
    overflow: hidden;
    animation: flicker 0.14s infinite;
}
.crt-screen::before {
    content: "";
    position: absolute;
    left: 0; top: 0; width: 100%; height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0,0,0,0) 0px,
        rgba(0,0,0,0.15) 2px,
        rgba(0,0,0,0.03) 4px,
        rgba(0,0,0,0) 6px
    );
    z-index: 2;
}
@keyframes flicker {
    0%, 100% { opacity: 1; }
    98% { opacity: 0.96; }
}

.boot-fx, .energy-logo {
    color: #21f321 !important;
    text-shadow:
        0 0 6px #21f321,
        0 0 3px #21f321,
        0 0 2px #21f321;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    letter-spacing: 0.07em;
    filter: blur(0.15px);
    line-height: 1.2;
    animation: flicker 0.14s infinite;
}
.boot-fx {
    font-size: 24px;
}
.energy-logo {
    position: absolute;
    top: 15px;
    right: 40px;
    font-size: 32px;
    pointer-events: none;
    z-index: 100;
    user-select: none;
}
.energy-logo span {
    display: block;
    font-size: 12px;
    font-weight: normal;
    margin-top: -2px;
    letter-spacing: 0.03em;
}
