/* ============================================
   PREMIUM LOADING SCREEN
   ============================================ */

/* Prevent scroll during loading */
body.loading {
    overflow: hidden;
}

.loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
}

/* Animated Logo Letters */
.loader-logo {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 40px;
}

.loader-letter {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 700;
    color: #ffffff;
    opacity: 0;
    transform: translateY(30px) rotateX(-90deg);
    animation: letterReveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: calc(var(--i) * 0.1s);
    text-shadow: 0 4px 30px rgba(0, 119, 204, 0.3);
}

@keyframes letterReveal {
    0% {
        opacity: 0;
        transform: translateY(30px) rotateX(-90deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

/* Golden accent for alternate letters */
.loader-letter:nth-child(even) {
    color: var(--color-secondary, #ffc107);
}

/* Progress Bar */
.loader-progress {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 24px;
    position: relative;
}

.loader-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, 
        var(--color-primary, #0077cc) 0%, 
        var(--color-secondary, #ffc107) 100%);
    border-radius: 10px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(0, 119, 204, 0.5);
}

/* Shimmer effect on progress bar */
.loader-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Loading Text */
.loader-text {
    font-family: var(--font-main, 'Roboto', sans-serif);
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin: 0;
}

/* Pulsing dots animation */
.loader-text::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Decorative elements */
.loader-decoration {
    position: absolute;
    width: 300px;
    height: 300px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    animation: pulse-ring 3s ease-out infinite;
}

.loader-decoration:nth-child(1) {
    animation-delay: 0s;
}

.loader-decoration:nth-child(2) {
    animation-delay: 1s;
}

.loader-decoration:nth-child(3) {
    animation-delay: 2s;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .loader-logo {
        gap: 4px;
        margin-bottom: 32px;
    }
    
    .loader-progress {
        width: 160px;
    }
    
    .loader-text {
        font-size: 0.75rem;
        letter-spacing: 0.15em;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .loader-letter {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .loader-bar::after {
        animation: none;
    }
    
    .loader-decoration {
        animation: none;
    }
    
    .loader-text::after {
        animation: none;
        content: '...';
    }
    
    .loader {
        transition: opacity 0.3s, visibility 0.3s;
    }
}
