/*
 * FALLOUT TERMINAL UI - Retro-Futuristic Design System
 * Inspired by Pip-Boy 3000 and Vault-Tec computer terminals
 * High-contrast phosphor display with CRT effects
 */

/* ===== FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=VT323&family=Share+Tech+Mono&family=Orbitron:wght@400;700;900&display=swap');

/* ===== CSS VARIABLES - Color Palette ===== */
:root {
    /* Terminal Phosphor Colors */
    --phosphor-green: #39ff14;
    --phosphor-amber: #ffb000;
    --phosphor-cyan: #00ffff;
    --phosphor-white: #e0e0e0;
    
    /* Deep Backgrounds */
    --terminal-black: #0a0a0a;
    --terminal-dark: #111111;
    --terminal-surface: #1a1a1a;
    --terminal-panel: #151515;
    
    /* UI Accents */
    --ui-border: #2a4a2a;
    --ui-border-dim: #1a3a1a;
    --ui-highlight: #3aff3a;
    --ui-shadow: rgba(57, 255, 20, 0.3);
    
    /* Status Colors */
    --status-ok: #39ff14;
    --status-warn: #ffb000;
    --status-error: #ff3333;
    --status-info: #00ffff;
    
    /* Sizing */
    --border-thin: 1px;
    --border-medium: 2px;
    --border-thick: 3px;
    --corner-size: 8px;
    
    /* Glow */
    --glow-intensity: 0 0 10px;
    --glow-spread: 0 0 20px;
    
    /* CRT effect intensities */
    --scanline-opacity: 0.12;
    --flicker-intensity: 0.03;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--terminal-black);
    color: var(--phosphor-green);
    font-family: 'VT323', 'Share Tech Mono', monospace;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* ===== CRT SCREEN EFFECTS - Global Overlay ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    
    /* Scanlines */
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    opacity: var(--scanline-opacity);
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    
    /* CRT vignette & curvature simulation */
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        transparent 60%,
        rgba(0, 0, 0, 0.4) 100%
    );
}

/* ===== SCREEN FLICKER ANIMATION ===== */
@keyframes screenFlicker {
    0% { opacity: 1; }
    5% { opacity: 0.97; }
    10% { opacity: 1; }
    15% { opacity: 0.98; }
    20% { opacity: 1; }
    50% { opacity: 1; }
    55% { opacity: 0.97; }
    60% { opacity: 1; }
    100% { opacity: 1; }
}

body {
    animation: screenFlicker 8s infinite ease-in-out;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    text-shadow: var(--glow-intensity) var(--phosphor-green);
}

h1 {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
    border-bottom: var(--border-thick) solid var(--phosphor-green);
    padding-bottom: 0.5rem;
}

h2 {
    font-size: 2rem;
    color: var(--phosphor-amber);
    text-shadow: var(--glow-intensity) var(--phosphor-amber);
    border-bottom: var(--border-medium) solid var(--ui-border);
    padding-bottom: 0.3rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.5rem;
    color: var(--phosphor-cyan);
}

p {
    margin-bottom: 1rem;
    max-width: 80ch;
}

a {
    color: var(--phosphor-green);
    text-decoration: none;
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.5);
    transition: all 0.2s ease;
    position: relative;
}

a:hover {
    color: var(--phosphor-amber);
    text-shadow: 0 0 10px rgba(255, 176, 0, 0.8);
}

a:active {
    color: var(--phosphor-white);
}

/* ===== PIXEL/FIXED-WIDTH TEXT BLOCKS ===== */
.terminal-block {
    font-family: 'VT323', monospace;
    white-space: pre-wrap;
    line-height: 1.4;
}

.cursor-blink {
    display: inline-block;
    width: 0.6em;
    height: 1.2em;
    background: var(--phosphor-green);
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

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

/* ===== HEADER - Top Navigation Bar ===== */
.wasteland-header {
    background: linear-gradient(
        180deg,
        var(--terminal-dark) 0%,
        var(--terminal-surface) 50%,
        var(--terminal-panel) 100%
    );
    border-bottom: var(--border-thick) solid var(--phosphor-green);
    padding: 0.75rem 1.5rem;
    position: relative;
    box-shadow: 0 4px 20px rgba(57, 255, 20, 0.2),
                inset 0 -1px 0 rgba(57, 255, 20, 0.3);
}

.wasteland-header::before {
    /* Decorative corner brackets */
    content: '';
    position: absolute;
    top: -2px;
    left: 10px;
    width: 20px;
    height: 10px;
    border-top: var(--border-thick) solid var(--phosphor-amber);
    border-left: var(--border-thick) solid var(--phosphor-amber);
}

.wasteland-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 10px;
    width: 20px;
    height: 10px;
    border-bottom: var(--border-thick) solid var(--phosphor-amber);
    border-right: var(--border-thick) solid var(--phosphor-amber);
}

/* ===== NAVIGATION ===== */
.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    gap: 2rem;
    flex-wrap: wrap;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    display: block;
    background: transparent;
}

.nav-links a::before {
    content: '>';
    position: absolute;
    left: -12px;
    opacity: 0;
    color: var(--phosphor-amber);
    transition: opacity 0.2s;
}

.nav-links a:hover::before,
.nav-links .active::before {
    opacity: 1;
}

.nav-links a:hover,
.nav-links .active {
    color: var(--phosphor-amber);
    border: 1px solid var(--ui-border);
    background: rgba(57, 255, 20, 0.05);
    text-shadow: 0 0 15px rgba(255, 176, 0, 0.6);
    box-shadow: inset 0 0 10px rgba(255, 176, 0, 0.2);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    width: 100%;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ===== SECTIONS ===== */
.content-section,
.hero,
.feature-section {
    background: var(--terminal-surface);
    border: var(--border-medium) solid var(--ui-border);
    border-left: var(--border-thick) solid var(--phosphor-green);
    padding: 2rem;
    margin: 2rem auto;
    position: relative;
    z-index: 1;
    
    /* Slight glow on hover */
    transition: box-shadow 0.3s ease;
}

.content-section:hover,
.feature-section:hover {
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.15),
                inset 0 0 20px rgba(57, 255, 20, 0.05);
}

/* Decorative corner brackets on sections */
.content-section::before,
.hero::before {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 15px;
    height: 15px;
    border-top: 2px solid var(--phosphor-green);
    border-right: 2px solid var(--phosphor-green);
    z-index: 2;
    pointer-events: none;
}

.content-section::after,
.hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: -1px;
    width: 15px;
    height: 15px;
    border-bottom: 2px solid var(--phosphor-green);
    border-left: 2px solid var(--phosphor-green);
    z-index: 2;
    pointer-events: none;
}

/* ===== HERO SECTION ===== */
.hero {
    text-align: center;
    padding: 5rem 2rem;
    margin: 2rem auto;
    background: var(--terminal-black);
    border: 2px solid var(--phosphor-green);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    /* Background scanlines */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(57, 255, 20, 0.03) 2px,
        rgba(57, 255, 20, 0.03) 4px
    );
    pointer-events: none;
    z-index: 0;
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.2em;
    text-shadow: 
        0 0 10px var(--phosphor-green),
        0 0 20px var(--phosphor-green),
        0 0 30px var(--phosphor-green);
    animation: textGlow 3s ease-in-out infinite alternate;
}

@keyframes textGlow {
    0% { text-shadow: 0 0 10px var(--phosphor-green), 0 0 20px var(--phosphor-green); }
    100% { text-shadow: 0 0 15px var(--phosphor-green), 0 0 30px var(--phosphor-green), 0 0 45px var(--phosphor-green); }
}

.tagline {
    font-size: 1.5rem;
    color: var(--phosphor-amber);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-top: 1rem;
    opacity: 0.9;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--phosphor-cyan);
    margin-top: 1rem;
    opacity: 0.8;
}

/* ===== TERMINAL PROMPT STYLE ===== */
.terminal-prompt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem 0;
    font-family: 'VT323', monospace;
}

.terminal-prompt::before {
    content: '>';
    color: var(--phosphor-green);
    font-size: 1.2em;
    animation: blink 1s step-end infinite;
}

.terminal-prompt-text {
    color: var(--phosphor-white);
    flex: 1;
}

/* ===== NEWS & ENTRIES ===== */
.news-article,
.version-entry,
.entry {
    background: rgba(0, 0, 0, 0.4);
    border: var(--border-medium) solid var(--ui-border);
    border-left: var(--border-thick) solid var(--phosphor-green);
    padding: 1.5rem;
    margin: 1.5rem 0;
    position: relative;
    transition: all 0.2s ease;
}

.news-article:hover,
.version-entry:hover,
.entry:hover {
    border-left-color: var(--phosphor-amber);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.1);
}

.news-article h3,
.version-entry h3,
.entry h3 {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.4rem;
    color: var(--phosphor-green);
    margin: 0 0 0.5rem 0;
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
    border: none;
    padding: 0;
}

.news-date,
.version-number {
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    color: var(--phosphor-amber);
    margin-bottom: 0.75rem;
    display: block;
}

.news-date::before {
    content: '[(]';
    opacity: 0.6;
}

.news-date::after {
    content: '[)]';
    opacity: 0.6;
}

.version-number {
    color: var(--phosphor-cyan);
}

/* ===== FEATURE CARDS ===== */
.feature-card {
    background: linear-gradient(
        135deg,
        rgba(0, 20, 0, 0.3) 0%,
        rgba(0, 40, 0, 0.1) 100%
    );
    border: var(--border-medium) solid var(--ui-border);
    border-top: var(--border-thick) solid var(--phosphor-green);
    padding: 1.5rem;
    margin: 1.5rem 0;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--phosphor-green) 50%,
        transparent 100%
    );
    animation: scanLine 3s linear infinite;
}

@keyframes scanLine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.feature-card:hover {
    border-color: var(--phosphor-amber);
    box-shadow: 0 0 25px rgba(57, 255, 20, 0.2),
                inset 0 0 15px rgba(57, 255, 20, 0.05);
    transform: translateY(-2px);
}

.feature-card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    color: var(--phosphor-amber);
    margin-bottom: 0.75rem;
    text-shadow: 0 0 10px rgba(255, 176, 0, 0.5);
    border: none;
}

.feature-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--phosphor-green);
    color: var(--terminal-black);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
    animation: tagPulse 2s ease-in-out infinite;
}

@keyframes tagPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(57, 255, 20, 0.5); }
    50% { box-shadow: 0 0 15px rgba(57, 255, 20, 0.8); }
}

/* ===== FOOTER ===== */
.wasteland-footer {
    background: var(--terminal-panel);
    border-top: var(--border-thick) solid var(--phosphor-green);
    padding: 1.5rem;
    text-align: center;
    margin-top: auto;
    position: relative;
}

.wasteland-footer::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 10px;
    border-top: 2px solid var(--phosphor-amber);
    border-left: 2px solid var(--phosphor-amber);
    border-right: 2px solid var(--phosphor-amber);
    border-bottom: none;
}

.wasteland-footer p {
    margin: 0.25rem 0;
    font-size: 0.95rem;
    opacity: 0.8;
    color: var(--phosphor-green);
}

/* ===== DOWNLOADS ===== */
.download-card {
    background: var(--terminal-surface);
    border: var(--border-thick) solid var(--ui-border);
    border-top: var(--border-thick) solid var(--phosphor-cyan);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 600px;
    text-align: center;
    position: relative;
}

.download-card::before {
    content: '[ SYSTEM UPDATE AVAILABLE ]';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--terminal-black);
    padding: 0 1rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    color: var(--phosphor-amber);
    letter-spacing: 0.1em;
}

.download-button {
    display: inline-block;
    background: transparent;
    color: var(--phosphor-green);
    border: 2px solid var(--phosphor-green);
    padding: 0.75rem 2rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

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

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

.download-button:hover {
    background: rgba(57, 255, 20, 0.1);
    color: var(--phosphor-amber);
    border-color: var(--phosphor-amber);
    text-shadow: 0 0 10px var(--phosphor-amber);
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.3),
                inset 0 0 15px rgba(57, 255, 20, 0.1);
}

/* ===== ADMIN STYLES ===== */
.admin-login {
    max-width: 500px;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--terminal-surface);
    border: var(--border-thick) solid var(--status-error);
    border-left: var(--border-thick) solid var(--phosphor-green);
}

.admin-nav {
    margin: 2rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--ui-border);
}

.admin-nav a {
    color: var(--phosphor-green);
    margin-right: 1.5rem;
    text-decoration: none;
    font-family: 'Share Tech Mono', monospace;
}

.admin-nav a:hover {
    color: var(--phosphor-amber);
}

.admin-form {
    max-width: 800px;
    margin: 2rem auto;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 0.75rem;
    background: var(--terminal-black);
    border: 1px solid var(--ui-border);
    border-left: var(--border-medium) solid var(--phosphor-green);
    color: var(--phosphor-green);
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.admin-form input:focus,
.admin-form textarea:focus {
    outline: none;
    border-color: var(--phosphor-amber);
    box-shadow: 0 0 10px rgba(255, 176, 0, 0.3);
}

.admin-form label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0 0.5rem;
    cursor: pointer;
}

.admin-form input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--phosphor-green);
    cursor: pointer;
}

.large-textarea {
    min-height: 200px;
    resize: vertical;
    font-family: 'VT323', monospace !important;
    line-height: 1.4;
}

/* Admin Section Titles */
.admin-section h2 {
    text-align: center;
    color: var(--phosphor-amber);
    border-bottom: var(--border-thick) solid var(--phosphor-green);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

/* ===== ENTRIES LIST ===== */
.entries-list {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--ui-border);
}

.entry {
    background: var(--terminal-black);
    padding: 1.5rem;
    margin: 1rem 0;
    border: 1px solid var(--ui-border);
    border-left: 3px solid var(--phosphor-cyan);
    transition: all 0.2s ease;
}

.entry:hover {
    border-left-color: var(--phosphor-green);
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.1);
}

.entry h3 {
    color: var(--phosphor-green);
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    border: none;
}

.entry p {
    color: var(--phosphor-white);
    opacity: 0.9;
    font-size: 1rem;
}

.entry-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ui-border);
}

.entry-actions a,
.entry-actions button {
    padding: 0.5rem 1rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid var(--phosphor-green);
    background: transparent;
    color: var(--phosphor-green);
    cursor: pointer;
    transition: all 0.2s ease;
}

.entry-actions a:hover,
.entry-actions button:hover {
    background: rgba(57, 255, 20, 0.1);
    color: var(--phosphor-amber);
    border-color: var(--phosphor-amber);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
}

.entry-actions a {
    text-decoration: none;
}

.entry-actions a.btn-edit {
    border-color: var(--status-info);
    color: var(--status-info);
}

.entry-actions a.btn-delete {
    border-color: var(--status-error);
    color: var(--status-error);
}

/* ===== UTILITY CLASSES ===== */
.status-ok { color: var(--status-ok); }
.status-warn { color: var(--status-warn); }
.status-error { color: var(--status-error); }
.status-info { color: var(--status-info); }

.text-dim {
    opacity: 0.6;
    font-size: 0.9em;
}

.mono {
    font-family: 'VT323', monospace;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .nav-links a {
        padding: 0.75rem 1.5rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
        letter-spacing: 0.1em;
    }
    
    .tagline {
        font-size: 1.2rem;
        letter-spacing: 0.15em;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .content-section,
    .hero,
    .feature-card,
    .news-article {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    h1 { font-size: 2.5rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.3rem; }
    
    .download-button {
        display: block;
        margin: 0.75rem auto;
        width: 80%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
        letter-spacing: 0.1em;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.4rem; }
}

/* ===== PRINT STYLES ===== */
@media print {
    body::before,
    body::after {
        display: none;
    }
    
    .wasteland-header,
    .wasteland-footer {
        background: none !important;
        border-color: #000 !important;
    }
    
    .news-article,
    .feature-card,
    .version-entry {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--phosphor-amber);
    outline-offset: 2px;
}

/* ===== SCROLLBAR STYLING (Webkit) ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--terminal-black);
    border: 1px solid var(--ui-border);
}

::-webkit-scrollbar-thumb {
    background: var(--ui-border);
    border: 1px solid var(--phosphor-green);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--phosphor-green);
    box-shadow: 0 0 5px var(--phosphor-green);
}

/* ===== SELECTION HIGHLIGHT ===== */
::selection {
    background: var(--phosphor-green);
    color: var(--terminal-black);
}

::-moz-selection {
    background: var(--phosphor-green);
    color: var(--terminal-black);
}

/* ===== FINAL POLISH: CHROMATIC ABERRATION & ENHANCED CRT EFFECTS ===== */

/* RGB Shift/Chromatic Aberration on Headers */
.hero h1 {
    position: relative;
}

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

.hero h1::before {
    color: rgba(255, 0, 0, 0.4);
    z-index: -1;
    animation: rgbShift1 4s infinite linear alternate-reverse;
}

.hero h1::after {
    color: rgba(0, 0, 255, 0.4);
    z-index: -2;
    animation: rgbShift2 3s infinite linear alternate-reverse;
}

@keyframes rgbShift1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-1.5px, 1px); }
}

@keyframes rgbShift2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(1.5px, -1px); }
}

/* Apply RGB shift to section titles too */
h1::before, h1::after,
h2::before, h2::after,
.hero h1::before, .hero h1::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* ===== SCREEN CURVATURE (Removed - caused hover issues) ===== */
/* Original effect disabled due to z-index conflicts */

/* ===== SUBTLE GLITCH EFFECT ON HOVER ===== */
@keyframes glitch {
    0% {
        text-shadow: 
            2px 0 var(--status-error),
            -2px 0 var(--status-info);
    }
    25% {
        text-shadow: 
            -2px 0 var(--status-error),
            2px 0 var(--status-info);
    }
    50% {
        text-shadow: 
            2px 2px var(--status-error),
            -2px -2px var(--status-info);
    }
    75% {
        text-shadow: 
            -2px -2px var(--status-error),
            2px 2px var(--status-info);
    }
    100% {
        text-shadow: 
            0 0 var(--status-error),
            0 0 var(--status-info);
    }
}

.hero h1:hover {
    animation: glitch 0.3s linear infinite;
}

/* =====ENHANCED BOOT SEQUENCE EFFECT ===== */
@keyframes bootFlicker {
    0% { opacity: 0; }
    10% { opacity: 0.3; }
    20% { opacity: 1; }
    30% { opacity: 0.7; }
    40% { opacity: 1; }
    50% { opacity: 0.9; }
    60% { opacity: 1; }
    100% { opacity: 1; }
}

.hero {
    animation: bootFlicker 2s ease-out forwards;
}

/* ===== LINE NOISE / STATIC OVERLAY (subtle) ===== */
body::before {
    background-image: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px
        ),
        /* Very subtle RGB noise */
        radial-gradient(
            ellipse at 50% 50%,
            transparent 0%,
            rgba(0, 0, 0, 0.1) 100%
        );
    mix-blend-mode: multiply;
}

/* ===== HOVER GLOW INTENSIFIER ===== */
.feature-card:hover,
.news-article:hover,
.version-entry:hover,
.entry:hover {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 
            0 0 25px rgba(57, 255, 20, 0.2),
            inset 0 0 15px rgba(57, 255, 20, 0.05);
    }
    50% {
        box-shadow: 
            0 0 40px rgba(57, 255, 20, 0.35),
            inset 0 0 25px rgba(57, 255, 20, 0.1);
    }
}

/* ===== DOWNLOAD BUTTON RAINBOW GLOW (amber hover) ===== */
.download-button:hover {
    text-shadow: 
        0 0 5px var(--phosphor-amber),
        0 0 10px var(--phosphor-amber),
        0 0 20px var(--phosphor-amber);
}

/* ===== INFO CARDS GLOW EFFECT ===== */
.info-card {
    transition: all 0.3s ease;
}

.info-card:hover {
    box-shadow: 
        0 0 20px rgba(57, 255, 20, 0.15),
        inset 0 0 10px rgba(57, 255, 20, 0.05);
    transform: translateY(-2px);
}

/* ===== TERMINAL PROGRESS BARS (for download page) ===== */
.progress-bar {
    height: 20px;
    background: var(--terminal-black);
    border: 1px solid var(--ui-border);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--ui-border) 0%,
        var(--phosphor-green) 50%,
        var(--phosphor-green) 100%
    );
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 10px,
        rgba(57, 255, 20, 0.2) 10px,
        rgba(57, 255, 20, 0.2) 11px
    );
    animation: progressMove 1s linear infinite;
}

@keyframes progressMove {
    0% { background-position: 0 0; }
    100% { background-position: 11px 0; }
}

/* ===== BADGE / TAG ANIMATIONS ===== */
.feature-tag {
    position: relative;
}

.feature-tag::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 1px solid transparent;
    animation: tagBorder 2s infinite;
}

@keyframes tagBorder {
    0%, 100% { border-color: rgba(57, 255, 20, 0.3); }
    50% { border-color: rgba(57, 255, 20, 0.8); }
}

/* ===== BOOT TEXT TYPING ANIMATION (if needed) ===== */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

.terminal-block.typing {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--phosphor-green);
    animation: typing 3s steps(40, end),
               blink 0.75s step-end infinite;
}

/* ===== FINAL TOUCHES ===== */

/* Ensure all borders use phosphor green for active states */
.content-section,
.hero,
.feature-card,
.news-article,
.version-entry,
.entry {
    border-image: linear-gradient(
        to bottom,
        var(--phosphor-green) 0%,
        var(--ui-border) 100%
    ) 1;
}

/* Dark mode friendly adjustments */
@media (prefers-color-scheme: dark) {
    :root {
        --phosphor-green: #39ff14;
        --phosphor-amber: #ffb000;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    body {
        background: #000;
    }
    
    .hero h1,
    .news-article h3,
    .feature-card h3 {
        text-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor;
    }
}

/* Very large text support */
@media (max-width: 320px) {
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .nav-links a {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Landscape mobile adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
}
