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

body {
    background: #000;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    overflow: hidden;
}

.crt-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #000;
}

.crt-screen {
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #001100 0%, #000000 100%);
    position: relative;
    overflow: hidden;
    animation: flicker 3s infinite;
}

@keyframes flicker {
    0% { opacity: 0.98; }
    50% { opacity: 1; }
    100% { opacity: 0.98; }
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #00ff00;
    background: rgba(0, 255, 0, 0.05);
    text-shadow: 0 0 10px #00ff00;
}

.terminal-title {
    font-size: 16px;
    letter-spacing: 3px;
    font-weight: bold;
    text-transform: uppercase;
    color: #ff0000;
    animation: warningPulse 3s ease-in-out infinite;
    text-shadow: 0 0 20px #ff0000, 0 0 40px #ff0000;
}

@keyframes warningPulse {
    0%, 100% { 
        opacity: 0.8;
        text-shadow: 0 0 20px #ff0000, 0 0 40px #ff0000;
    }
    50% { 
        opacity: 1;
        text-shadow: 0 0 30px #ff0000, 0 0 60px #ff0000, 0 0 80px #ff0000;
    }
}

@keyframes glow {
    from { text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00; }
    to { text-shadow: 0 0 20px #00ff00, 0 0 30px #00ff00, 0 0 40px #00ff00; }
}

.terminal-status {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    background: #00ff00;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px #00ff00;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.cost-tracker {
    font-size: 14px;
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
}

.terminal-output {
    height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.terminal-output::-webkit-scrollbar {
    width: 10px;
}

.terminal-output::-webkit-scrollbar-track {
    background: #001100;
}

.terminal-output::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 5px;
}

.boot-sequence {
    margin-bottom: 20px;
}

.boot-line {
    margin: 5px 0;
    opacity: 0;
    animation: typeIn 0.5s forwards;
    animation-delay: calc(var(--line-index, 0) * 0.5s);
}

.boot-line:nth-child(1) { --line-index: 0; }
.boot-line:nth-child(2) { --line-index: 1; }
.boot-line:nth-child(3) { --line-index: 2; }
.boot-line:nth-child(4) { --line-index: 3; }
.boot-line:nth-child(5) { --line-index: 4; }
.boot-line:nth-child(6) { --line-index: 5; }
.boot-line:nth-child(7) { --line-index: 6; }
.boot-line:nth-child(8) { --line-index: 7; }

@keyframes typeIn {
    to { opacity: 1; }
}

.terminal-input-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    padding: 20px;
    background: rgba(0, 255, 0, 0.05);
    border-top: 2px solid #00ff00;
}

.prompt {
    color: #00ff00;
    margin-right: 10px;
    text-shadow: 0 0 5px #00ff00;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #00ff00;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    text-shadow: 0 0 5px #00ff00;
    /* Optimize input performance */
    will-change: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.terminal-input:disabled {
    color: #005500;
    cursor: not-allowed;
    text-shadow: none;
}

.terminal-line {
    margin: 5px 0;
    white-space: pre-wrap;
}

.user-input {
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
}

.ai-response {
    color: #ff00ff;
    text-shadow: 0 0 5px #ff00ff;
    animation: glitch 0.3s;
}

@keyframes glitch {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-2px); }
    40% { transform: translateX(2px); }
    60% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
}

.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    animation: scanlines 20s linear infinite;
}

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

.crt-screen::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 2px;
    pointer-events: none;
    z-index: 1;
}

.crt-screen::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 255, 0, 0.01);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    animation: vignette 6s infinite;
}

@keyframes vignette {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Static noise effect */
.static-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-radial-gradient(circle at 0 0, transparent 0, rgba(255, 255, 255, 0.1) 1px, transparent 2px, transparent 3px);
    background-size: 3px 3px;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    mix-blend-mode: screen;
}

.static-active {
    animation: staticNoise 0.2s steps(10) infinite;
}

@keyframes staticNoise {
    0% { 
        opacity: 0.8;
        background-position: 0 0;
        filter: hue-rotate(0deg);
    }
    10% { 
        background-position: -5% -10%;
    }
    20% { 
        background-position: -15% 5%;
    }
    30% { 
        background-position: 7% -15%;
        filter: hue-rotate(90deg);
    }
    40% { 
        background-position: 20% 10%;
    }
    50% { 
        background-position: -10% 15%;
        filter: hue-rotate(180deg);
    }
    60% { 
        background-position: 15% 0%;
    }
    70% { 
        background-position: 0% 15%;
        filter: hue-rotate(270deg);
    }
    80% { 
        background-position: 3% -10%;
    }
    90% { 
        background-position: -10% 0%;
    }
    100% { 
        opacity: 0;
        background-position: 0 0;
        filter: hue-rotate(360deg);
    }
}

.error-message {
    color: #ff0000;
    text-shadow: 0 0 10px #ff0000;
    animation: errorFlash 0.5s;
}

@keyframes errorFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.system-message {
    color: #888888;
    font-style: italic;
    text-shadow: none;
}

/* Login Screen Styles */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
}

.login-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
}

.login-header {
    text-align: center;
    margin-bottom: 60px;
}

.warning-symbol {
    font-size: 80px;
    color: #ff0000;
    text-shadow: 0 0 30px #ff0000, 0 0 60px #ff0000;
    animation: warningPulse 2s ease-in-out infinite;
    margin-bottom: 20px;
}

.login-title {
    font-size: 28px;
    letter-spacing: 4px;
    font-weight: bold;
    color: #ff0000;
    margin: 20px 0;
    text-shadow: 0 0 20px #ff0000, 0 0 40px #ff0000;
    animation: warningPulse 3s ease-in-out infinite;
}

.login-subtitle {
    font-size: 18px;
    letter-spacing: 3px;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
}

.login-body {
    text-align: center;
}

.access-warning {
    margin-bottom: 40px;
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
}

.access-warning p {
    margin: 10px 0;
    font-size: 14px;
    letter-spacing: 2px;
}

.login-button {
    background: transparent;
    border: 2px solid #00ff00;
    color: #00ff00;
    padding: 20px 40px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    letter-spacing: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.login-button:hover {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.8), inset 0 0 20px rgba(0, 255, 0, 0.2);
    text-shadow: 0 0 10px #00ff00;
}

.login-button:active {
    transform: scale(0.98);
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.4), transparent);
    transition: left 0.5s;
}

.login-button:hover::before {
    left: 100%;
}

.button-text {
    position: relative;
    z-index: 1;
    animation: glow 2s ease-in-out infinite alternate;
}

/* Terminal Screen */
.terminal-screen {
    width: 100vw;
    height: 100vh;
}

/* Fade transitions */
.fade-out {
    animation: fadeOut 0.5s forwards;
}

.fade-in {
    animation: fadeIn 0.5s forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}