/* Loading Screen Styles - Cyberpunk Theme */
#loader {
    display: none; /* Hidden by default, shown by Loader.js */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 60; /* Above menu */
}

/* Animated background with cyberpunk grid */
.loader-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a0030 0%, #0a0015 100%);
    overflow: hidden;
}

/* Grid lines overlay - identyczny jak w Loader.js */
.loader-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 39px,
            rgba(0, 255, 255, 0.15) 39px,
            rgba(0, 255, 255, 0.15) 40px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 39px,
            rgba(0, 255, 255, 0.15) 39px,
            rgba(0, 255, 255, 0.15) 40px
        );
    background-size: 100% 100%;
    pointer-events: none;
    animation: gridScroll 8s linear infinite;
}

@keyframes gridScroll {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

/* Scanlines effect - identyczny jak w Loader.js */
.loader-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 255, 0.02) 0px,
        rgba(0, 255, 255, 0.02) 2px,
        transparent 2px,
        transparent 4px
    );
    pointer-events: none;
}

/* Loader content container */
.loader-content {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Title with neon glow - 36px * UI_SCALE */
.loader-title {
    position: absolute;
    top: calc(300px * var(--ui-scale));
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-family: monospace;
    font-size: calc(36px * var(--ui-scale));
    font-weight: bold;
    color: #00ffff;
    text-shadow: 
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        0 0 30px #00ffff;
}

/* Animated logo image */
#loader-logo-img {
    display: none; /* Hidden until loaded */
    position: absolute;
    top: calc(250px * var(--ui-scale));
    left: 50%;
    transform: translateX(-50%);
    width: calc(200px * var(--ui-scale));
    height: auto;
    filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.6));
    animation: logoFloat 4s ease-in-out infinite, logoRotate 8s linear infinite;
}

@keyframes logoFloat {
    0%, 100% { 
        transform: translateX(-50%) translateY(0px) scale(1);
    }
    50% { 
        transform: translateX(-50%) translateY(0px) scale(1.01);
    }
}

@keyframes logoRotate {
    0%, 100% { 
        filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.6)) hue-rotate(0deg);
    }
    25% { 
        filter: drop-shadow(0 0 20px rgba(255, 0, 255, 0.6)) hue-rotate(90deg);
    }
    50% { 
        filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.6)) hue-rotate(180deg);
    }
    75% { 
        filter: drop-shadow(0 0 20px rgba(255, 0, 255, 0.6)) hue-rotate(270deg);
    }
}

/* Loading text (dynamically updated) - 18px * UI_SCALE */
.loader-text {
    position: absolute;
    top: calc(360px * var(--ui-scale));
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-family: monospace;
    font-size: calc(18px * var(--ui-scale));
    color: #ff00ff;
    text-shadow: 
        0 0 10px #ff00ff,
        0 0 15px #ff00ff;
    white-space: nowrap;
}

/* Progress bar container - 400x30 * UI_SCALE at y=420 */
.progress-bar-container {
    position: absolute;
    top: calc(420px * var(--ui-scale));
    left: 50%;
    transform: translateX(-50%);
    width: calc(400px * var(--ui-scale));
    height: calc(30px * var(--ui-scale));
    background: rgba(10, 0, 32, 0.8);
    border: calc(3px * var(--ui-scale)) solid #00ffff;
    border-radius: 0;
    box-shadow: 
        0 0 calc(15px * var(--ui-scale)) rgba(0, 255, 255, 0.6);
}

/* Progress bar fill (dynamically updated width) */
.progress-bar {
    position: absolute;
    top: calc(3px * var(--ui-scale));
    left: calc(3px * var(--ui-scale));
    width: 0%; /* Updated by JS */
    height: calc(24px * var(--ui-scale)); /* 30 - 6 */
    background: #00ffff;
    box-shadow: 
        0 0 calc(25px * var(--ui-scale)) rgba(0, 255, 255, 0.8),
        inset 0 0 calc(15px * var(--ui-scale)) rgba(0, 255, 255, 0.3);
    transition: width 0.1s linear;
}

/* Percentage text (dynamically updated) - 16px * UI_SCALE */
.loader-percent {
    position: absolute;
    top: calc((420px + 30px + 30px) * var(--ui-scale)); /* barY + barHeight + 30 */
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-family: monospace;
    font-size: calc(16px * var(--ui-scale));
    color: #ffffff;
    text-shadow: 
        0 0 calc(10px * var(--ui-scale)) #ffffff;
    white-space: nowrap;
}

/* Footer - 14px * UI_SCALE */
.loader-footer {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    font-family: monospace;
    font-size: calc(14px * var(--ui-scale));
    color: rgba(255, 255, 255, 0.5);
}
