/* ================================================
   AXELERA - MODERN PURPLE/VIOLET THEME
   ================================================ */

/* Theme Variables - Purple/Violet Palette */
:root {
    /* Primary Purple */
    --color-primary: #A855F7;
    --color-primary-rgb: 168, 85, 247;
    --color-primary-dark: #7C3AED;

    /* Secondary Violet */
    --color-secondary: #C084FC;
    --color-secondary-rgb: 192, 132, 252;
}

[data-theme="dark"] {
    /* Backgrounds */
    --color-bg: #0F0A1A;
    --color-surface: #1A1225;
    --color-surface-elevated: #251830;
    --color-void: #0F0A1A;
    --color-matrix: #150E20;
    --color-panel: #1A1225;

    /* Text */
    --color-text: #FFFFFF;
    --color-text-bright: #FFFFFF;
    --color-text-secondary: #C8B8D8;
    --color-text-dim: #C8B8D8;
    --color-muted: #9888AA;
    --color-text-ghost: #5A4466;

    /* Accent - Compatibility alias */
    --color-lime: var(--color-primary);
    --color-neon-lime: var(--color-primary);
    --color-neon-cyan: #00FFFF;
    --color-neon-magenta: #FF00FF;

    /* Glow Effects */
    --glow-lime: 0 0 20px rgba(168, 85, 247, 0.5), 0 0 40px rgba(168, 85, 247, 0.3);
    --glow-lime-intense: 0 0 10px rgba(168, 85, 247, 0.8), 0 0 30px rgba(168, 85, 247, 0.5), 0 0 60px rgba(168, 85, 247, 0.3);
    --glow-cyan: 0 0 20px rgba(0, 255, 255, 0.5), 0 0 40px rgba(0, 255, 255, 0.3);
    --glow-magenta: 0 0 20px rgba(255, 0, 255, 0.5), 0 0 40px rgba(255, 0, 255, 0.3);
    --glow-primary: 0 0 20px rgba(168, 85, 247, 0.5), 0 0 40px rgba(168, 85, 247, 0.3);

    /* Grid/Matrix Pattern */
    --grid-line: rgba(168, 85, 247, 0.08);
    --grid-line-dense: rgba(168, 85, 247, 0.05);
    --grid-dot: rgba(168, 85, 247, 0.15);

    /* Scanline */
    --scanline-color: rgba(168, 85, 247, 0.03);
}

[data-theme="light"] {
    /* Backgrounds */
    --color-bg: #FAF8FC;
    --color-surface: #FFFFFF;
    --color-surface-elevated: #FFFFFF;
    --color-void: #FAF8FC;
    --color-matrix: #F5F0FA;
    --color-panel: #FFFFFF;

    /* Text */
    --color-text: #1A1225;
    --color-text-bright: #1A1225;
    --color-text-secondary: #4A3A5A;
    --color-text-dim: #4A3A5A;
    --color-muted: #6B5B7B;
    --color-text-ghost: #9A8AAA;

    /* Accent - Darker for light backgrounds */
    --color-lime: #7C3AED;
    --color-neon-lime: #7C3AED;
    --color-neon-cyan: #0891B2;
    --color-neon-magenta: #C026D3;

    /* Glow Effects */
    --glow-lime: 0 0 10px rgba(124, 58, 237, 0.3);
    --glow-lime-intense: 0 0 10px rgba(124, 58, 237, 0.5), 0 0 20px rgba(124, 58, 237, 0.3);
    --glow-cyan: 0 0 10px rgba(8, 145, 178, 0.3);
    --glow-magenta: 0 0 10px rgba(192, 38, 211, 0.3);
    --glow-primary: 0 0 10px rgba(124, 58, 237, 0.3);

    /* Grid/Matrix Pattern */
    --grid-line: rgba(124, 58, 237, 0.05);
    --grid-line-dense: rgba(124, 58, 237, 0.03);
    --grid-dot: rgba(124, 58, 237, 0.08);

    /* Scanline */
    --scanline-color: rgba(124, 58, 237, 0.02);
}

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

/* Theme Transitions */
html {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body, .bg-bg, .bg-surface, .text-text, .text-muted, .border-surface, .border-lime {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

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

/* ================================================
   ANIMATIONS
   ================================================ */

/* Glitch Effect */
@keyframes glitch {
    0% {
        transform: translate(0);
        text-shadow: -2px 0 #00ffff, 2px 0 #ff00ff;
    }
    20% {
        transform: translate(-2px, 2px);
        text-shadow: 2px 0 #00ffff, -2px 0 #ff00ff;
    }
    40% {
        transform: translate(-2px, -2px);
        text-shadow: 2px 2px #00ffff, -2px -2px #ff00ff;
    }
    60% {
        transform: translate(2px, 2px);
        text-shadow: -2px -2px #00ffff, 2px 2px #ff00ff;
    }
    80% {
        transform: translate(2px, -2px);
        text-shadow: -2px 2px #00ffff, 2px -2px #ff00ff;
    }
    100% {
        transform: translate(0);
        text-shadow: -2px 0 #00ffff, 2px 0 #ff00ff;
    }
}

@keyframes glitchSkew {
    0% { transform: skew(0deg); }
    20% { transform: skew(-2deg); }
    40% { transform: skew(2deg); }
    60% { transform: skew(-1deg); }
    80% { transform: skew(1deg); }
    100% { transform: skew(0deg); }
}

/* Terminal Typing */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

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

@keyframes cursorBlink {
    0%, 100% { border-color: var(--color-lime); }
    50% { border-color: transparent; }
}

/* Neon Pulse */
@keyframes neonPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(168, 85, 247, 0.5),
                    0 0 10px rgba(168, 85, 247, 0.3),
                    0 0 20px rgba(168, 85, 247, 0.2);
    }
    50% {
        box-shadow: 0 0 10px rgba(168, 85, 247, 0.8),
                    0 0 20px rgba(168, 85, 247, 0.5),
                    0 0 40px rgba(168, 85, 247, 0.3),
                    0 0 60px rgba(168, 85, 247, 0.2);
    }
}

@keyframes neonPulseCyan {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 255, 255, 0.5),
                    0 0 10px rgba(0, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.8),
                    0 0 20px rgba(0, 255, 255, 0.5),
                    0 0 40px rgba(0, 255, 255, 0.3);
    }
}

/* Scan Line Animation */
@keyframes scanMove {
    0% { background-position: 0 0; }
    100% { background-position: 0 100%; }
}

@keyframes scanLineMove {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

/* Data Flow Animation */
@keyframes dataFlow {
    0% { background-position: 0 0; }
    100% { background-position: 0 -200px; }
}

/* Flicker Effect */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.8; }
    94% { opacity: 1; }
    96% { opacity: 0.9; }
    97% { opacity: 1; }
}

/* Float Animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Basic Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes lineGrow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes slideRight {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* ================================================
   UTILITY CLASSES - CYBER
   ================================================ */

/* Neon Text Glow */
.neon-text {
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.8),
                 0 0 20px rgba(168, 85, 247, 0.5),
                 0 0 30px rgba(168, 85, 247, 0.3);
}

.neon-text-cyan {
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8),
                 0 0 20px rgba(0, 255, 255, 0.5),
                 0 0 30px rgba(0, 255, 255, 0.3);
}

.neon-text-magenta {
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.8),
                 0 0 20px rgba(255, 0, 255, 0.5),
                 0 0 30px rgba(255, 0, 255, 0.3);
}

/* Neon Border */
.neon-border {
    border: 1px solid var(--color-lime);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.3),
                inset 0 0 10px rgba(168, 85, 247, 0.1);
}

.neon-border:hover {
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5),
                0 0 40px rgba(168, 85, 247, 0.2),
                inset 0 0 20px rgba(168, 85, 247, 0.1);
}

.neon-border-cyan {
    border: 1px solid var(--color-neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3),
                inset 0 0 10px rgba(0, 255, 255, 0.1);
}

/* Neon Glow Box */
.neon-glow {
    box-shadow: var(--glow-lime);
}

.neon-glow-intense {
    box-shadow: var(--glow-lime-intense);
}

.neon-glow-cyan {
    box-shadow: var(--glow-cyan);
}

/* Glitch Effect Class */
.glitch {
    position: relative;
}

.glitch:hover {
    animation: glitch 0.3s ease infinite;
}

.glitch-skew:hover {
    animation: glitchSkew 0.5s ease infinite;
}

/* Scanlines Overlay */
.scanlines {
    position: relative;
}

.scanlines::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        var(--scanline-color) 2px,
        var(--scanline-color) 4px
    );
    pointer-events: none;
    z-index: 10;
}

/* Single Moving Scanline */
.scanline-moving::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to bottom, transparent, rgba(168, 85, 247, 0.1), transparent);
    animation: scanLineMove 8s linear infinite;
    pointer-events: none;
    z-index: 11;
}

/* Terminal Cursor */
.terminal-cursor::after {
    content: '_';
    animation: blink 1s step-end infinite;
    color: var(--color-lime);
}

.cursor-blink {
    border-right: 2px solid var(--color-lime);
    animation: cursorBlink 1s step-end infinite;
}

/* Terminal Prompt */
.terminal-prompt::before {
    content: '>_ ';
    color: var(--color-lime);
    font-family: 'JetBrains Mono', monospace;
}

/* Neon Pulse Animation */
.animate-neon-pulse {
    animation: neonPulse 2s ease-in-out infinite;
}

.animate-neon-pulse-cyan {
    animation: neonPulseCyan 2s ease-in-out infinite;
}

/* Flicker Animation */
.animate-flicker {
    animation: flicker 4s ease-in-out infinite;
}

/* Float Animation */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* ================================================
   GRID PATTERNS - CYBER MATRIX
   ================================================ */

.grid-pattern {
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 80px 80px;
}

.grid-pattern-dense {
    background-image:
        linear-gradient(var(--grid-line-dense) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line-dense) 1px, transparent 1px);
    background-size: 20px 20px;
}

.grid-dots {
    background-image: radial-gradient(circle, var(--grid-dot) 1px, transparent 1px);
    background-size: 80px 80px;
}

/* Matrix Rain Effect Background */
.matrix-bg {
    background:
        linear-gradient(180deg, transparent 0%, var(--color-void) 100%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 1px,
            rgba(168, 85, 247, 0.03) 1px,
            rgba(168, 85, 247, 0.03) 2px
        );
    background-size: 100% 100%, 4px 100%;
}

/* ================================================
   ANIMATION UTILITIES
   ================================================ */

.animate-fade-up {
    animation: fadeUp 0.8s ease-out forwards;
    opacity: 0;
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.animate-line-grow {
    animation: lineGrow 1s ease-out forwards;
    transform-origin: left;
}

/* Staggered delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }

/* ================================================
   HUD-STYLE ELEMENTS
   ================================================ */

/* Corner brackets - Cyber Style */
.bracket {
    position: relative;
}

.bracket::before,
.bracket::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: var(--color-lime);
    transition: all 0.3s ease;
    opacity: 0.5;
}

.bracket::before {
    top: -1px;
    left: -1px;
    border-top: 2px solid;
    border-left: 2px solid;
}

.bracket::after {
    bottom: -1px;
    right: -1px;
    border-bottom: 2px solid;
    border-right: 2px solid;
}

.bracket:hover::before,
.bracket:hover::after {
    opacity: 1;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

/* HUD Corners - All 4 */
.hud-corners {
    position: relative;
}

.hud-corners::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid transparent;
    background:
        linear-gradient(90deg, var(--color-lime) 16px, transparent 16px) 0 0,
        linear-gradient(90deg, transparent calc(100% - 16px), var(--color-lime) calc(100% - 16px)) 0 0,
        linear-gradient(0deg, var(--color-lime) 16px, transparent 16px) 0 0,
        linear-gradient(0deg, transparent calc(100% - 16px), var(--color-lime) calc(100% - 16px)) 0 0,
        linear-gradient(90deg, var(--color-lime) 16px, transparent 16px) 0 100%,
        linear-gradient(90deg, transparent calc(100% - 16px), var(--color-lime) calc(100% - 16px)) 0 100%,
        linear-gradient(0deg, var(--color-lime) 16px, transparent 16px) 100% 0,
        linear-gradient(0deg, transparent calc(100% - 16px), var(--color-lime) calc(100% - 16px)) 100% 0;
    background-repeat: no-repeat;
    background-size: 16px 1px, 16px 1px, 1px 16px, 1px 16px;
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.hud-corners:hover::before {
    opacity: 1;
}

/* ================================================
   NAV LINKS - CYBER STYLE
   ================================================ */

.nav-link {
    position: relative;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-lime);
    box-shadow: 0 0 10px var(--color-lime);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--color-lime);
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

/* ================================================
   CYBER CARD STYLES
   ================================================ */

.cyber-card {
    background: linear-gradient(135deg, var(--color-panel) 0%, var(--color-matrix) 100%);
    border: 1px solid rgba(168, 85, 247, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.cyber-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(168, 85, 247, 0.02) 2px,
        rgba(168, 85, 247, 0.02) 4px
    );
    pointer-events: none;
}

.cyber-card:hover {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.2),
                inset 0 0 30px rgba(168, 85, 247, 0.05);
}

/* ================================================
   CYBER BUTTON STYLES
   ================================================ */

.cyber-btn {
    position: relative;
    background: transparent;
    border: 2px solid var(--color-lime);
    color: var(--color-lime);
    font-family: 'JetBrains Mono', 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    overflow: hidden;
    transition: all 0.3s ease;
}

.cyber-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--color-lime);
    transition: left 0.3s ease;
    z-index: -1;
}

.cyber-btn:hover {
    color: var(--color-void);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5),
                0 0 40px rgba(168, 85, 247, 0.3);
}

.cyber-btn:hover::before {
    left: 0;
}

/* Primary Cyber Button */
.cyber-btn-primary {
    background: var(--color-lime);
    color: var(--color-void);
    border: none;
    font-family: 'JetBrains Mono', 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

.cyber-btn-primary:hover {
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.6),
                0 0 60px rgba(168, 85, 247, 0.3);
    transform: translateY(-2px);
}

/* ================================================
   CYBER INPUT STYLES
   ================================================ */

.cyber-input {
    background: rgba(12, 12, 18, 0.8);
    border: 1px solid rgba(168, 85, 247, 0.2);
    color: var(--color-text);
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.3s ease;
}

.cyber-input:focus {
    outline: none;
    border-color: var(--color-lime);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.2),
                inset 0 0 10px rgba(168, 85, 247, 0.05);
}

.cyber-input::placeholder {
    color: var(--color-text-ghost);
}

/* ================================================
   FOCUS STYLES
   ================================================ */

.focus-ring:focus {
    outline: 2px solid var(--color-lime);
    outline-offset: 2px;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.focus-ring:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

.focus-ring:focus-visible {
    outline: 2px solid var(--color-lime);
    outline-offset: 2px;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

/* ================================================
   CYBER SCROLLBAR
   ================================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-void);
    border-left: 1px solid rgba(168, 85, 247, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-lime) 0%, rgba(168, 85, 247, 0.5) 100%);
    border-radius: 0;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-lime);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.8);
}

/* ================================================
   UTILITY CLASSES
   ================================================ */

/* Counter animation */
.counter {
    font-variant-numeric: tabular-nums;
    font-family: 'Orbitron', 'JetBrains Mono', monospace;
}

/* Section marker - Cyber */
.section-marker {
    position: relative;
    padding-left: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
}

.section-marker::before {
    content: '//';
    position: absolute;
    left: 0;
    color: var(--color-lime);
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

/* Terminal Tag */
.terminal-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--color-lime);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Neon Divider */
.neon-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-lime), transparent);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

/* x-cloak */
[x-cloak] { display: none !important; }

/* Language switcher */
.lang-btn {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.lang-btn:hover {
    transform: scale(1.1);
    color: var(--color-lime);
}

/* ================================================
   PHASE NUMBER STYLING
   ================================================ */

.phase-number {
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.3) 0%, rgba(168, 85, 247, 0.05) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.3));
}

/* ================================================
   SUCCESS/ERROR STATES
   ================================================ */

.cyber-success {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: var(--color-lime);
}

.cyber-error {
    background: rgba(255, 0, 255, 0.1);
    border: 1px solid rgba(255, 0, 255, 0.3);
    color: var(--color-neon-magenta);
}

/* ================================================
   RESPONSIVE UTILITIES
   ================================================ */

@media (max-width: 768px) {
    .bracket::before,
    .bracket::after {
        width: 12px;
        height: 12px;
    }

    .phase-number {
        font-size: 3rem;
    }
}
