/* ============================================
   CYBERPUNK THEME - COLOR SYSTEM & VARIABLES
   ============================================ */

:root {
    /* ========== PRIMARY COLORS ========== */
    --cyber-yellow: #FCE300;
    --cyber-cyan: #00F0FF;
    --cyber-magenta: #FF006E;
    --cyber-pink: #FF10F0;
    --cyber-purple: #9D00FF;
    
    /* ========== BACKGROUND COLORS ========== */
    --bg-primary: #0A0E27;
    --bg-secondary: #1a1d2e;
    --bg-tertiary: #252941;
    --bg-card: #1e2139;
    --bg-card-hover: #252a47;
    
    /* ========== TEXT COLORS ========== */
    --text-primary: #E8F1F5;
    --text-secondary: #B8C5D0;
    --text-muted: #6B7B8C;
    --text-cyber: var(--cyber-cyan);
    
    /* ========== ACCENT COLORS ========== */
    --accent-success: #00FF87;
    --accent-warning: #FFD600;
    --accent-error: #FF3864;
    --accent-info: var(--cyber-cyan);
    
    /* ========== GLOW COLORS ========== */
    --glow-yellow: 0 0 10px var(--cyber-yellow),
                    0 0 20px var(--cyber-yellow),
                    0 0 30px var(--cyber-yellow);
    
    --glow-cyan: 0 0 10px var(--cyber-cyan),
                 0 0 20px var(--cyber-cyan),
                 0 0 30px var(--cyber-cyan);
    
    --glow-magenta: 0 0 10px var(--cyber-magenta),
                    0 0 20px var(--cyber-magenta),
                    0 0 30px var(--cyber-magenta);
    
    --glow-soft-yellow: 0 0 5px rgba(252, 227, 0, 0.5),
                        0 0 10px rgba(252, 227, 0, 0.3);
    
    --glow-soft-cyan: 0 0 5px rgba(0, 240, 255, 0.5),
                      0 0 10px rgba(0, 240, 255, 0.3);
    
    /* ========== BORDER COLORS ========== */
    --border-primary: var(--cyber-yellow);
    --border-secondary: var(--cyber-cyan);
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-card: rgba(252, 227, 0, 0.3);
    
    /* ========== GRADIENTS ========== */
    --gradient-primary: linear-gradient(135deg, var(--cyber-yellow) 0%, var(--cyber-cyan) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--cyber-cyan) 0%, var(--cyber-magenta) 100%);
    --gradient-tertiary: linear-gradient(135deg, var(--cyber-magenta) 0%, var(--cyber-purple) 100%);
    --gradient-rainbow: linear-gradient(90deg, 
        var(--cyber-yellow) 0%, 
        var(--cyber-cyan) 33%, 
        var(--cyber-magenta) 66%, 
        var(--cyber-purple) 100%);
    
    --gradient-overlay: linear-gradient(180deg, 
        rgba(10, 14, 39, 0) 0%, 
        rgba(10, 14, 39, 0.8) 100%);
    
    /* ========== SPACING ========== */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    --spacing-3xl: 6rem;
    
    /* ========== TYPOGRAPHY ========== */
    --font-primary: 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    --font-mono: 'Courier New', 'Courier', monospace;
    --font-display: 'Impact', 'Arial Black', sans-serif;
    
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    --font-size-5xl: 3rem;
    --font-size-6xl: 4rem;
    
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-black: 900;
    
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* ========== BORDER RADIUS ========== */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* ========== TRANSITIONS ========== */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* ========== SHADOWS ========== */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.6);
    
    --shadow-glow-yellow: 0 0 20px rgba(252, 227, 0, 0.4);
    --shadow-glow-cyan: 0 0 20px rgba(0, 240, 255, 0.4);
    --shadow-glow-magenta: 0 0 20px rgba(255, 0, 110, 0.4);
    
    /* ========== Z-INDEX LAYERS ========== */
    --z-background: -1;
    --z-base: 0;
    --z-content: 10;
    --z-header: 100;
    --z-overlay: 500;
    --z-modal: 1000;
    --z-tooltip: 1500;
    --z-notification: 2000;
    
    /* ========== ANIMATIONS ========== */
    --anim-glitch-duration: 0.3s;
    --anim-pulse-duration: 2s;
    --anim-float-duration: 3s;
    
    /* ========== SCANLINE EFFECT ========== */
    --scanline-opacity: 0.05;
    --scanline-speed: 8s;
    
    /* ========== BREAKPOINTS (for reference in JS) ========== */
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-2xl: 1536px;
}

/* ========================================
   GLOBAL RESET & BASE STYLES
   ======================================== */

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

*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Text Colors */
.cyber-text {
    color: var(--cyber-cyan);
    text-shadow: var(--glow-soft-cyan);
}

.cyber-yellow-text {
    color: var(--cyber-yellow);
    text-shadow: var(--glow-soft-yellow);
}

.cyber-magenta-text {
    color: var(--cyber-magenta);
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Add padding on desktop to account for left sidebar */
@media (min-width: 769px) {
    body {
        padding-left: 160px; /* Space for level map sidebar */
        transition: padding-left 0.3s ease;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }
    
    body {
        padding-left: 0;
        padding-bottom: 100px; /* Space for bottom level map */
    }
}

/* Hidden Utility */
.hidden {
    display: none !important;
}

/* Visually Hidden (for accessibility) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* No Scroll (when modal open) */
.no-scroll {
    overflow: hidden;
}

/* ========================================
   SCANLINE OVERLAY EFFECT
   ======================================== */

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: var(--z-overlay);
    opacity: var(--scanline-opacity);
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    animation: scanlines-move var(--scanline-speed) linear infinite;
}

@keyframes scanlines-move {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(10px);
    }
}

/* ========================================
   SELECTION STYLES
   ======================================== */

::selection {
    background-color: var(--cyber-cyan);
    color: var(--bg-primary);
    text-shadow: none;
}

::-moz-selection {
    background-color: var(--cyber-cyan);
    color: var(--bg-primary);
    text-shadow: none;
}

/* ========================================
   SCROLLBAR STYLES
   ======================================== */

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--cyber-yellow) var(--bg-secondary);
}

/* Webkit Browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--cyber-yellow);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--cyber-cyan);
    box-shadow: var(--glow-soft-cyan);
}

/* ========================================
   CURSOR STYLES
   ======================================== */

body {
    cursor: default;
}

a, button, input[type="button"], input[type="submit"] {
    cursor: pointer;
}

a:active, button:active {
    cursor: pointer;
}

/* ========================================
   ACCESSIBILITY - REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .scanlines {
        animation: none;
    }
}

/* ========================================
   FOCUS STYLES (Accessibility)
   ======================================== */

:focus {
    outline: 2px solid var(--cyber-cyan);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--cyber-cyan);
    outline-offset: 2px;
}

/* ========================================
   LINK STYLES
   ======================================== */

a {
    color: var(--cyber-cyan);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--cyber-yellow);
}

/* ========================================
   IMAGE OPTIMIZATION
   ======================================== */

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   BUTTON RESET
   ======================================== */

button {
    font-family: inherit;
    font-size: inherit;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

/* ========================================
   INPUT & FORM RESET
   ======================================== */

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: transparent;
    border: 1px solid var(--border-subtle);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--cyber-cyan);
    box-shadow: var(--glow-soft-cyan);
}

/* ========================================
   BLINKING CURSOR ANIMATION
   ======================================== */

.cursor-blink {
    animation: cursor-blink 1s steps(2) infinite;
}

@keyframes cursor-blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

/* ========================================
   PARTICLE CANVAS BACKGROUND
   ======================================== */

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-background);
    pointer-events: none;
}

/* ========================================
   GRADIENT TEXT UTILITY
   ======================================== */

.gradient-text {
    background: var(--gradient-rainbow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   NEON BORDER UTILITY
   ======================================== */

.neon-border {
    border: 2px solid var(--cyber-cyan);
    box-shadow: 
        0 0 5px var(--cyber-cyan),
        inset 0 0 5px var(--cyber-cyan);
}

.neon-border-yellow {
    border: 2px solid var(--cyber-yellow);
    box-shadow: 
        0 0 5px var(--cyber-yellow),
        inset 0 0 5px var(--cyber-yellow);
}

/* ========================================
   HEXAGON PATTERN UTILITY
   ======================================== */

.hex-pattern {
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 40px,
            rgba(252, 227, 0, 0.03) 40px,
            rgba(252, 227, 0, 0.03) 80px
        ),
        repeating-linear-gradient(
            60deg,
            transparent,
            transparent 40px,
            rgba(0, 240, 255, 0.03) 40px,
            rgba(0, 240, 255, 0.03) 80px
        ),
        repeating-linear-gradient(
            120deg,
            transparent,
            transparent 40px,
            rgba(255, 0, 110, 0.03) 40px,
            rgba(255, 0, 110, 0.03) 80px
        );
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .scanlines,
    #particle-canvas,
    .main-header,
    .mobile-nav,
    .scroll-to-top,
    .progress-indicator,
    #achievement-container,
    #boot-sequence,
    #breach-protocol {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}