/**
 * Gaming Loading Screen
 * Retro-style loading overlay for login/register
 */

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.98);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.loading-overlay.active {
    display: flex;
}

/* Loading Container */
.loading-container {
    text-align: center;
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Game Controller Icon */
.loading-icon {
    font-size: 5rem;
    margin-bottom: var(--space-xl);
    animation: bounce 1s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(0, 245, 212, 0.6));
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Loading Text */
.loading-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.5rem;
    color: var(--accent-primary);
    margin-bottom: var(--space-xl);
    letter-spacing: 0.1em;
    text-shadow: 0 0 10px rgba(0, 245, 212, 0.5);
}

/* Pixel Loading Bar */
.loading-bar-container {
    width: 400px;
    height: 40px;
    background: var(--bg-card);
    border: 3px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin: 0 auto var(--space-lg);
    position: relative;
    box-shadow: 
        0 0 20px rgba(0, 245, 212, 0.3),
        inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.loading-bar {
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--accent-primary) 0%,
        var(--accent-secondary) 50%,
        var(--accent-primary) 100%
    );
    background-size: 200% 100%;
    border-radius: 2px;
    animation: fillBar 4s ease-out forwards, shimmer 1s linear infinite;
    box-shadow: 0 0 20px rgba(0, 245, 212, 0.8);
    position: relative;
    overflow: hidden;
}

/* Pixel blocks effect on bar */
.loading-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 8px,
        rgba(255, 255, 255, 0.1) 8px,
        rgba(255, 255, 255, 0.1) 10px
    );
}

@keyframes fillBar {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

/* Loading Dots */
.loading-dots {
    font-family: 'Press Start 2P', monospace;
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 0.3em;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Pixel Art Border Effect */
.loading-container::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: 
        linear-gradient(0deg, 
            rgba(0, 245, 212, 0.1) 1px, 
            transparent 1px),
        linear-gradient(90deg, 
            rgba(0, 245, 212, 0.1) 1px, 
            transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    border-radius: var(--radius-lg);
}

/* Gaming Messages */
.loading-message {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.7rem;
    color: var(--accent-gold);
    margin-top: var(--space-lg);
    letter-spacing: 0.05em;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* INSERT COIN style message */
.coin-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-xl);
    font-family: 'Press Start 2P', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.coin-icon {
    font-size: 1.5rem;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotateY(0deg);
    }
    to {
        transform: rotateY(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .loading-bar-container {
        width: 300px;
    }
    
    .loading-text {
        font-size: 1rem;
    }
    
    .loading-icon {
        font-size: 3rem;
    }
    
    .loading-message,
    .coin-message {
        font-size: 0.6rem;
    }
}

/* Scanline effect on loading screen */
.loading-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    pointer-events: none;
    animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(4px);
    }
}

