/* ============================================
   PYTHON ZERO - VISUAL EFFECTS & POLISH
   CRT Terminal Aesthetic Enhancements
   ============================================ */

/* ============================================
   ENHANCED CSS VARIABLES
   ============================================ */
:root {
    /* Display fonts */
    --font-display: 'VT323', monospace;
    --font-terminal: 'Share Tech Mono', 'JetBrains Mono', monospace;

    /* Glow effects - refined, less intense */
    --glow-color: rgba(0, 210, 106, 0.4);
    --glow-color-intense: rgba(0, 210, 106, 0.7);
    --glow-spread: 0 0 8px var(--glow-color);

    /* CRT colors - subtle */
    --crt-scanline: rgba(0, 0, 0, 0.08);
    --crt-glow: rgba(0, 210, 106, 0.02);
}

/* ============================================
   CRT SCREEN EFFECT - SCANLINES
   ============================================ */
#app::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        var(--crt-scanline) 2px,
        var(--crt-scanline) 4px
    );
    pointer-events: none;
    z-index: 9999;
    opacity: 0.25;
}

/* ============================================
   CRT SCREEN VIGNETTE
   ============================================ */
#app::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        transparent 60%,
        rgba(0, 0, 0, 0.4) 100%
    );
    pointer-events: none;
    z-index: 9998;
}

/* ============================================
   ENHANCED HEADER - RETRO DISPLAY
   ============================================ */
.logo {
    font-family: var(--font-display);
    font-size: 28px !important;
    letter-spacing: 4px !important;
    text-shadow: var(--glow-spread);
    animation: textFlicker 4s ease-in-out infinite;
}

@keyframes textFlicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.8; }
    94% { opacity: 1; }
    97% { opacity: 0.9; }
    98% { opacity: 1; }
}

/* ============================================
   PANEL TITLES - TERMINAL STYLE
   ============================================ */
.panel-title {
    font-family: var(--font-display);
    font-size: 20px;
    letter-spacing: 2px;
    text-shadow: 0 0 8px var(--glow-color);
}

/* ============================================
   ENHANCED BUTTONS - PHOSPHOR GLOW
   ============================================ */
.btn {
    font-family: var(--font-terminal);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

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

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    text-shadow: var(--glow-spread);
    box-shadow:
        0 0 10px var(--glow-color),
        0 0 20px var(--glow-color),
        inset 0 0 10px rgba(10, 255, 10, 0.1);
}

/* RUN button special effect */
#run-code {
    animation: runButtonPulse 2s ease-in-out infinite;
}

#run-code:hover {
    animation: none;
}

@keyframes runButtonPulse {
    0%, 100% {
        box-shadow: 0 0 5px var(--glow-color);
    }
    50% {
        box-shadow: 0 0 15px var(--glow-color), 0 0 25px rgba(10, 255, 10, 0.3);
    }
}

/* ============================================
   COMMAND PROMPT ANIMATION
   ============================================ */
.command-prompt::after {
    content: '_';
    animation: cursorBlink 1s steps(1) infinite;
    margin-left: 2px;
}

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

/* ============================================
   TRACK/LESSON ITEMS - HOVER EFFECT
   ============================================ */
.track, .lesson-item {
    position: relative;
    transition: all 0.2s ease;
}

.track::before, .lesson-item::before {
    content: '>';
    position: absolute;
    left: 4px;
    opacity: 0;
    color: var(--color-primary);
    transition: all 0.2s ease;
    text-shadow: 0 0 10px var(--glow-color);
}

.track:hover::before, .lesson-item:hover::before {
    opacity: 1;
    left: 8px;
}

.track:hover, .lesson-item:hover {
    padding-left: 28px;
    text-shadow: 0 0 8px var(--glow-color);
}

/* ============================================
   OUTPUT SECTION - TERMINAL EFFECT
   ============================================ */
.output-content {
    background:
        linear-gradient(
            180deg,
            rgba(10, 255, 10, 0.02) 0%,
            transparent 50%,
            rgba(10, 255, 10, 0.02) 100%
        );
}

.output-content::before {
    content: '>';
    color: var(--color-primary-dim);
    margin-right: 8px;
}

/* Success/Error status glow */
#status {
    transition: all 0.3s ease;
}

.status-success #status {
    text-shadow: 0 0 10px var(--glow-color);
}

.status-error #status {
    text-shadow: 0 0 10px rgba(255, 10, 10, 0.8);
}

/* ============================================
   HELP PANEL - ENHANCED HEADERS
   ============================================ */
.help-content h3 {
    font-family: var(--font-display);
    font-size: 24px;
    letter-spacing: 2px;
    border-bottom: 1px solid var(--color-primary-dim);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.help-content h4 {
    font-family: var(--font-terminal);
    color: var(--color-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   TIP BOX - ENHANCED
   ============================================ */
.tip, .content-tip {
    position: relative;
    border-left: 3px solid var(--color-primary);
    background:
        linear-gradient(
            90deg,
            rgba(10, 255, 10, 0.08) 0%,
            rgba(10, 255, 10, 0.02) 100%
        );
}

.tip::before, .content-tip::before {
    content: '[!]';
    font-family: var(--font-display);
    color: var(--color-primary);
    margin-right: 8px;
    text-shadow: 0 0 8px var(--glow-color);
}

/* ============================================
   EXERCISE BOX - GLOWING BORDER
   ============================================ */
.content-exercise {
    position: relative;
    animation: exerciseGlow 3s ease-in-out infinite;
}

@keyframes exerciseGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(10, 255, 10, 0.3);
    }
    50% {
        box-shadow: 0 0 15px rgba(10, 255, 10, 0.5), 0 0 25px rgba(10, 255, 10, 0.2);
    }
}

.content-exercise h4 {
    font-family: var(--font-display);
    font-size: 20px;
    letter-spacing: 2px;
}

/* ============================================
   CODE BLOCKS - ENHANCED
   ============================================ */
.content-code {
    position: relative;
    border: 1px solid var(--color-primary-dim);
    background: rgba(0, 0, 0, 0.5);
}

.content-code::before {
    content: 'CODE';
    position: absolute;
    top: -10px;
    left: 10px;
    background: var(--color-bg);
    padding: 0 8px;
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--color-primary-dim);
    letter-spacing: 2px;
}

.content-code code {
    text-shadow: 0 0 2px var(--glow-color);
}

/* ============================================
   LESSON VIEWER - ENHANCED HEADER
   ============================================ */
.lesson-title {
    font-family: var(--font-display);
    font-size: 28px !important;
    letter-spacing: 3px;
    text-shadow: var(--glow-spread);
}

.lesson-info {
    font-family: var(--font-terminal);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   FOOTER - SUBTLE GLOW
   ============================================ */
#footer {
    background: linear-gradient(
        180deg,
        rgba(10, 255, 10, 0.02) 0%,
        transparent 100%
    );
}

.footer-content a:hover {
    text-shadow: var(--glow-spread);
}

/* ============================================
   KEYBOARD SHORTCUTS - GLOWING KBD
   ============================================ */
kbd {
    font-family: var(--font-terminal);
    background: linear-gradient(
        180deg,
        var(--color-primary-dim) 0%,
        rgba(8, 127, 8, 0.8) 100%
    );
    border: 1px solid var(--color-primary);
    box-shadow: 0 2px 0 var(--color-primary-dim);
    text-shadow: 0 0 5px var(--glow-color);
}

/* ============================================
   SCROLLBAR - ENHANCED
   ============================================ */
::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        var(--color-primary-dim) 0%,
        rgba(8, 127, 8, 0.5) 100%
    );
    border: 1px solid var(--color-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
    box-shadow: 0 0 10px var(--glow-color);
}

/* ============================================
   PAGE LOAD ANIMATION
   ============================================ */
@keyframes bootUp {
    0% {
        opacity: 0;
        filter: brightness(2) blur(2px);
    }
    50% {
        opacity: 0.5;
        filter: brightness(1.5) blur(1px);
    }
    100% {
        opacity: 1;
        filter: brightness(1) blur(0);
    }
}

body {
    animation: bootUp 0.8s ease-out;
}

/* ============================================
   NOISE TEXTURE OVERLAY (SUBTLE)
   ============================================ */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.015;
    pointer-events: none;
    z-index: 9997;
}

/* ============================================
   RESPONSIVE - REDUCE EFFECTS ON MOBILE
   ============================================ */
@media screen and (max-width: 768px) {
    /* Reduce scanlines on mobile for performance */
    #app::before {
        opacity: 0.2;
    }

    /* Simpler logo on mobile */
    .logo {
        font-size: 18px !important;
        letter-spacing: 2px !important;
        animation: none;
    }

    .panel-title {
        font-size: 16px;
    }

    /* Reduce glow effects */
    .btn:hover {
        box-shadow: 0 0 10px var(--glow-color);
    }
}

/* ============================================
   REDUCED MOTION PREFERENCE
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    #app::before,
    body::after {
        display: none;
    }

    .logo,
    #run-code,
    .content-exercise {
        animation: none;
    }

    .command-prompt::after {
        animation: none;
        opacity: 1;
    }
}
