/* ========================================
   Retro CRT Terminal Styles
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

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

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
    font-family: 'VT323', monospace;
    overflow: hidden;
}

.crt-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.crt {
    position: relative;
    width: 700px;
    height: 500px;
    background: #0a0a0a;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 0 10px rgba(0, 255, 0, 0.3),
        0 0 30px rgba(0, 255, 0, 0.2),
        0 0 60px rgba(0, 255, 0, 0.1),
        inset 0 0 100px rgba(0, 0, 0, 0.9);
}

/* Screen Curvature Effect */
.crt::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(
            ellipse at center,
            transparent 0%,
            transparent 60%,
            rgba(0, 0, 0, 0.4) 100%
        );
    pointer-events: none;
    z-index: 10;
}

/* Additional curvature overlay */
.screen-curve {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(
            ellipse 80% 80% at 50% 50%,
            transparent 70%,
            rgba(0, 0, 0, 0.6) 100%
        );
    pointer-events: none;
    z-index: 5;
    border-radius: 50% / 10%;
}

/* Scanlines Effect */
.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.3),
        rgba(0, 0, 0, 0.3) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 20;
    animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 0 4px;
    }
}

/* Flicker Effect */
.crt::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 255, 0, 0.03);
    pointer-events: none;
    z-index: 15;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.27; }
    5% { opacity: 0.34; }
    10% { opacity: 0.27; }
    15% { opacity: 0.34; }
    20% { opacity: 0.29; }
    25% { opacity: 0.34; }
    30% { opacity: 0.29; }
    35% { opacity: 0.32; }
    40% { opacity: 0.29; }
    45% { opacity: 0.37; }
    50% { opacity: 0.30; }
    55% { opacity: 0.29; }
    60% { opacity: 0.36; }
    65% { opacity: 0.30; }
    70% { opacity: 0.34; }
    75% { opacity: 0.35; }
    80% { opacity: 0.29; }
    85% { opacity: 0.27; }
    90% { opacity: 0.32; }
    95% { opacity: 0.29; }
    100% { opacity: 0.33; }
}

.terminal {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 30px 40px;
    z-index: 2;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #00ff00;
}

.terminal-title,
.terminal-date {
    color: #00ff00;
    font-size: 18px;
    text-shadow:
        0 0 5px #00ff00,
        0 0 10px #00ff00,
        0 0 20px #00ff00;
}

.terminal-body {
    color: #00ff00;
    font-size: 20px;
    line-height: 1.6;
}

/* Type-on Animation for each line */
.line {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid transparent;
    width: 0;
    text-shadow:
        0 0 5px #00ff00,
        0 0 10px #00ff00,
        0 0 15px #00ff00;
}

/* animations for each line */
.line-1 { animation: typing 0.8s steps(35) 0.5s forwards; }
.line-2 { animation: typing 0.8s steps(40) 1.3s forwards; }
.line-3 { animation: typing 0.8s steps(40) 2.1s forwards; }
.line-4 { animation: typing 0.8s steps(40) 2.9s forwards; }
.line-5 { animation: typing 0.8s steps(40) 3.7s forwards; }
.line-6 { animation: typing 0.2s steps(5) 4.5s forwards; }
.line-7 { animation: typing 0.8s steps(40) 4.7s forwards; }
.line-8 { animation: typing 0.6s steps(35) 5.5s forwards; }
.line-9 { animation: typing 0.2s steps(5) 6.1s forwards; }
.line-10 { animation: typing 0.8s steps(40) 6.3s forwards; }
.line-11 { animation: typing 0.8s steps(40) 7.1s forwards; }
.line-12 { animation: typing 0.6s steps(30) 7.9s forwards; }
.line-13 { animation: typing 0.2s steps(5) 8.5s forwards; }
.line-14 { animation: typing 0.5s steps(15) 8.7s forwards; }
.line-15 { animation: typing 0.6s steps(30) 9.2s forwards; }
.line-16 { animation: typing 0.6s steps(30) 9.8s forwards; }
.line-17 { animation: typing 0.6s steps(25) 10.4s forwards; }
.line-18 { animation: typing 0.6s steps(30) 11s forwards; }
.line-19 { animation: typing 0.2s steps(5) 11.6s forwards; }
.line-20 { animation: typing 0.5s steps(15) 11.8s forwards, blink-cursor 0.8s step-end 12.3s infinite; }

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

/* Blinking cursor for last line */
.line-20 {
    border-right: 2px solid #00ff00;
}

@keyframes blink-cursor {
    0%, 100% { border-color: #00ff00; }
    50% { border-color: transparent; }
}

/* CRT Bezel */
.crt-bezel {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: 60px;
    border: 15px solid #2a2a2a;
    border-radius: 25px;
    pointer-events: none;
    background: transparent;
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 5px 15px rgba(0, 0, 0, 0.5);
}

/* Bezel Screws */
.bezel-screw {
    position: absolute;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #555 0%, #333 100%);
    border-radius: 50%;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.bezel-screw::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 2px;
    background: #222;
}

.top-left { top: 10px; left: 10px; }
.top-right { top: 10px; right: 10px; }
.bottom-left { bottom: 10px; left: 10px; }
.bottom-right { bottom: 10px; right: 10px; }

/* CRT Stand */
.crt-stand {
    width: 200px;
    height: 30px;
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
    border-radius: 0 0 10px 10px;
    margin-top: -5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.crt-stand::after {
    content: '';
    display: block;
    width: 300px;
    height: 15px;
    background: linear-gradient(180deg, #333 0%, #222 100%);
    border-radius: 0 0 5px 5px;
    margin: 0 auto;
    transform: translateX(-50px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

/* Responsiveness */
@media (max-width: 768px) {
    .crt {
        width: 95vw;
        height: 70vh;
        max-width: 500px;
        max-height: 400px;
    }

    .terminal {
        padding: 20px;
    }

    .terminal-body {
        font-size: 14px;
    }

    .terminal-title,
    .terminal-date {
        font-size: 14px;
    }

    .crt-bezel {
        border-width: 10px;
    }

    .crt-stand {
        width: 150px;
    }

    .crt-stand::after {
        width: 200px;
        transform: translateX(-25px);
    }
}

/* Power LED */
.crt-bezel::after {
    content: '';
    position: absolute;
    bottom: 20px;
    right: 30px;
    width: 8px;
    height: 8px;
    background: #00ff00;
    border-radius: 50%;
    box-shadow:
        0 0 5px #00ff00,
        0 0 10px #00ff00,
        0 0 20px #00ff00;
    animation: led-pulse 2s ease-in-out infinite;
}

@keyframes led-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

