/* ANSI Color Code Styles for NextGen BBS */

/* ANSI Color Classes */
.ansi-black { color: #000000; }
.ansi-red { color: #FF0000; }
.ansi-green { color: #00FF00; }
.ansi-yellow { color: #FFFF00; }
.ansi-blue { color: #0000FF; }
.ansi-magenta { color: #FF00FF; }
.ansi-cyan { color: #00FFFF; }
.ansi-white { color: #FFFFFF; }

.ansi-bright-black { color: #808080; }
.ansi-bright-red { color: #FF8080; }
.ansi-bright-green { color: #80FF80; }
.ansi-bright-yellow { color: #FFFF80; }
.ansi-bright-blue { color: #8080FF; }
.ansi-bright-magenta { color: #FF80FF; }
.ansi-bright-cyan { color: #80FFFF; }
.ansi-bright-white { color: #FFFFFF; }

/* ANSI Background Colors */
.ansi-bg-black { background-color: #000000; color: #FFFFFF; }
.ansi-bg-red { background-color: #FF0000; color: #FFFFFF; }
.ansi-bg-green { background-color: #00FF00; color: #000000; }
.ansi-bg-yellow { background-color: #FFFF00; color: #000000; }
.ansi-bg-blue { background-color: #0000FF; color: #FFFFFF; }
.ansi-bg-magenta { background-color: #FF00FF; color: #FFFFFF; }
.ansi-bg-cyan { background-color: #00FFFF; color: #000000; }
.ansi-bg-white { background-color: #FFFFFF; color: #000000; }

.ansi-bg-bright-black { background-color: #808080; color: #FFFFFF; }
.ansi-bg-bright-red { background-color: #FF8080; color: #000000; }
.ansi-bg-bright-green { background-color: #80FF80; color: #000000; }
.ansi-bg-bright-yellow { background-color: #FFFF80; color: #000000; }
.ansi-bg-bright-blue { background-color: #8080FF; color: #FFFFFF; }
.ansi-bg-bright-magenta { background-color: #FF80FF; color: #000000; }
.ansi-bg-bright-cyan { background-color: #80FFFF; color: #000000; }
.ansi-bg-bright-white { background-color: #FFFFFF; color: #000000; }

/* ANSI Style Classes */
.ansi-bold { font-weight: bold; }
.ansi-dim { opacity: 0.6; }
.ansi-underline { text-decoration: underline; }
.ansi-blink { 
    animation: blink 1s infinite;
}

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

.ansi-reverse { 
    background-color: currentColor;
    color: #000000;
}

/* PETSCII Graphics Classes */
.petscii-graphic {
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.petscii-color-black { color: #000000; }
.petscii-color-white { color: #FFFFFF; }
.petscii-color-red { color: #FF0000; }
.petscii-color-green { color: #00FF00; }
.petscii-color-blue { color: #0000FF; }
.petscii-color-orange { color: #FF8000; }
.petscii-color-brown { color: #804000; }
.petscii-color-pink { color: #FF80FF; }
.petscii-color-gray { color: #808080; }
.petscii-color-light-gray { color: #C0C0C0; }
.petscii-color-light-green { color: #80FF80; }
.petscii-color-light-blue { color: #8080FF; }
.petscii-color-purple { color: #8000FF; }
.petscii-color-yellow { color: #FFFF00; }
.petscii-color-cyan { color: #00FFFF; }

.petscii-special {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #FFFF00;
}

/* Terminal Effects */
.terminal-glow {
    text-shadow: 0 0 5px currentColor;
}

.terminal-flicker {
    animation: flicker 0.15s infinite linear;
}

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

.terminal-scanlines {
    position: relative;
}

.terminal-scanlines::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 0, 0.03) 2px,
        rgba(0, 255, 0, 0.03) 4px
    );
    pointer-events: none;
}

/* Cursor Styles */
.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background-color: currentColor;
    animation: blink 1s infinite;
    margin-left: 2px;
}

.terminal-cursor-block {
    display: inline-block;
    width: 8px;
    height: 14px;
    background-color: currentColor;
    animation: blink 1s infinite;
    margin-left: 2px;
}

.terminal-cursor-underline {
    display: inline-block;
    width: 8px;
    height: 2px;
    background-color: currentColor;
    animation: blink 1s infinite;
    margin-left: 2px;
}

/* Terminal Window Effects */
.terminal-window {
    position: relative;
    background: #000000;
    border: 2px solid #00FF00;
    box-shadow: 
        0 0 20px rgba(0, 255, 0, 0.3),
        inset 0 0 20px rgba(0, 255, 0, 0.1);
}

.terminal-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(0, 255, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 255, 0, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Retro CRT Effect */
.crt-effect {
    position: relative;
    background: #000000;
    overflow: hidden;
}

.crt-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(transparent 50%, rgba(0, 255, 0, 0.03) 50%),
        radial-gradient(ellipse at center, transparent 0%, rgba(0, 255, 0, 0.1) 100%);
    background-size: 100% 4px, 100% 100%;
    pointer-events: none;
    z-index: 1;
}

.crt-effect::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 255, 0, 0.02);
    pointer-events: none;
    z-index: 2;
}

/* Glitch Effects */
.glitch {
    position: relative;
    color: #00FF00;
}

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

.glitch::before {
    animation: glitch1 0.5s infinite;
    color: #FF0000;
    z-index: -1;
}

.glitch::after {
    animation: glitch2 0.5s infinite;
    color: #0000FF;
    z-index: -2;
}

@keyframes glitch1 {
    0%, 14%, 15%, 49%, 50%, 99%, 100% {
        transform: translate(0);
    }
    15%, 49% {
        transform: translate(-2px, 0);
    }
}

@keyframes glitch2 {
    0%, 20%, 21%, 62%, 63%, 99%, 100% {
        transform: translate(0);
    }
    21%, 62% {
        transform: translate(2px, 0);
    }
}

/* Matrix Rain Effect */
.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.matrix-column {
    position: absolute;
    top: -100%;
    color: #00FF00;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.2;
    animation: matrix-fall linear infinite;
    opacity: 0.7;
}

@keyframes matrix-fall {
    0% {
        top: -100%;
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* Terminal Typing Effect */
.typing-effect {
    overflow: hidden;
    border-right: 2px solid #00FF00;
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #00FF00; }
}

/* Retro Progress Bar */
.retro-progress {
    width: 100%;
    height: 20px;
    background: #001100;
    border: 1px solid #00FF00;
    position: relative;
    overflow: hidden;
}

.retro-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00FF00, #80FF80, #00FF00);
    background-size: 20px 100%;
    animation: progress-shine 2s linear infinite;
    transition: width 0.3s ease;
}

@keyframes progress-shine {
    0% { background-position: -20px 0; }
    100% { background-position: 20px 0; }
}

/* Terminal Alert */
.terminal-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #001100;
    border: 2px solid #00FF00;
    padding: 20px;
    color: #00FF00;
    font-family: 'Courier New', monospace;
    z-index: 1000;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
    animation: alert-pulse 2s infinite;
}

@keyframes alert-pulse {
    0%, 100% { box-shadow: 0 0 30px rgba(0, 255, 0, 0.5); }
    50% { box-shadow: 0 0 50px rgba(0, 255, 0, 0.8); }
}

/* Responsive ANSI Colors */
@media (max-width: 768px) {
    .ansi-blink {
        animation: none; /* Disable blinking on mobile */
    }
    
    .terminal-cursor,
    .terminal-cursor-block,
    .terminal-cursor-underline {
        width: 6px;
        height: 12px;
    }
    
    .typing-effect {
        font-size: 12px;
    }
}
