/* Advanced terminal styling with CRT effects */

/* CRT Monitor simulation */
#terminal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        transparent 50%, 
        rgba(0, 255, 65, 0.03) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
}

/* Scanlines effect */
#terminal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 65, 0.05) 2px,
        rgba(0, 255, 65, 0.05) 4px
    );
    pointer-events: none;
    z-index: 5;
}

/* Terminal glow and flicker */
#terminal {
    animation: flicker 0.15s infinite linear;
    filter: contrast(1.1) brightness(1.1);
}

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

/* Text glow effects */
#output, #input {
    text-shadow: 
        0 0 5px rgba(0, 255, 65, 0.8),
        0 0 10px rgba(0, 255, 65, 0.4),
        0 0 15px rgba(0, 255, 65, 0.2);
}

/* Enhanced prompt styling */
.prompt {
    text-shadow: 
        0 0 5px rgba(255, 0, 255, 0.8),
        0 0 10px rgba(255, 0, 255, 0.4);
    font-weight: bold;
}

/* Command line interface styling */
.command-line {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

.command-line .timestamp {
    color: #666;
    font-size: 14px;
    margin-right: 10px;
}

/* Progress bars */
.progress-bar {
    display: inline-block;
    border: 1px solid #00ff41;
    width: 200px;
    height: 20px;
    background: transparent;
    overflow: hidden;
    margin: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff41, #40ff00);
    width: 0%;
    transition: width 0.3s ease;
    animation: pulse 1s infinite;
}

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

/* Status indicators */
.status-ok::before {
    content: '✓ ';
    color: #40ff00;
}

.status-error::before {
    content: '✗ ';
    color: #ff0040;
}

.status-warning::before {
    content: '⚠ ';
    color: #ff8800;
}

.status-info::before {
    content: 'ℹ ';
    color: #00aaff;
}

/* Loading animations */
.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    animation: loading 1s infinite;
}

@keyframes loading {
    0% { content: '⠋'; }
    12.5% { content: '⠙'; }
    25% { content: '⠹'; }
    37.5% { content: '⠸'; }
    50% { content: '⠼'; }
    62.5% { content: '⠴'; }
    75% { content: '⠦'; }
    87.5% { content: '⠧'; }
    100% { content: '⠇'; }
}

/* ASCII art containers */
.ascii-header {
    color: #00ff41;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1;
    margin: 10px 0;
    text-align: center;
}

.ascii-border {
    color: #40ff00;
    font-weight: bold;
}

/* Matrix effect */
.matrix-text {
    color: #00ff41;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    animation: matrix 0.1s infinite;
}

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

/* Glitch effect */
.glitch {
    position: relative;
    animation: glitch 0.3s infinite;
}

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

.glitch::before {
    color: #ff0040;
    z-index: -1;
    animation: glitch-1 0.3s infinite;
}

.glitch::after {
    color: #00aaff;
    z-index: -2;
    animation: glitch-2 0.3s infinite;
}

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

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

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

/* Retro computer startup styling */
.boot-sequence {
    color: #00ff41;
    font-family: 'VT323', monospace;
    font-size: 16px;
}

.boot-sequence .boot-line {
    margin: 2px 0;
}

.boot-sequence .boot-ok {
    color: #40ff00;
}

.boot-sequence .boot-fail {
    color: #ff0040;
}

/* File system styling */
.filesystem {
    color: #00ff41;
    font-family: 'VT323', monospace;
}

.filesystem .directory {
    color: #40ccff;
    font-weight: bold;
}

.filesystem .file {
    color: #00ff41;
}

.filesystem .executable {
    color: #ff8800;
    font-weight: bold;
}

.filesystem .link {
    color: #ff00ff;
}

/* Interactive elements */
.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable:hover {
    text-shadow: 
        0 0 10px currentColor,
        0 0 20px currentColor;
    transform: scale(1.02);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    #terminal::before,
    #terminal::after {
        display: none; /* Disable CRT effects on mobile for performance */
    }
    
    #terminal {
        animation: none; /* Disable flicker on mobile */
    }
    
    .progress-bar {
        width: 150px;
        height: 15px;
    }
}
