/* ===== PAGE LOADER COMPONENT ===== */
/* Extracted from index.php for reusability */

/* Scroll lock styles for loader */
html.scroll-locked,
html.scroll-locked body,
body.scroll-locked {
    overflow: hidden !important;
    height: 100% !important;
    width: 100% !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    touch-action: none !important;
    overscroll-behavior: none !important;
    -webkit-overflow-scrolling: none !important;
}

/* Loading Screen */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #730027 0%, #910029 50%, #B8003A 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    color: white;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 50px 60px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.loader-logo {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    line-height: 1.15;
    text-align: left;
    display: inline-block;
    margin-bottom: 20px;
}

.loader-logo .logo-line {
    display: flex;
    align-items: baseline;
    margin-bottom: 2px;
    animation: fadeSlideIn 0.6s ease forwards;
    opacity: 0;
    transform: translateX(-20px);
}

.loader-logo .logo-line:nth-child(1) {
    animation-delay: 0.2s;
}

.loader-logo .logo-line:nth-child(2) {
    animation-delay: 0.4s;
}

.loader-logo .logo-line:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes fadeSlideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.loader-logo .big-letter {
    font-size: 58px;
    font-weight: 900;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.3));
    min-width: 50px;
    display: inline-block;
}

.loader-logo .rest-text {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.loader-logo .mit-highlight {
    display: none;
}

.loader-tagline {
    font-size: 13px;
    opacity: 0.8;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 35px;
    font-weight: 500;
    animation: fadeSlideIn 0.6s ease 0.8s forwards;
    opacity: 0;
}

/* Decorative line above tagline */
.loader-logo::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #FFD700, #1E4D8C, #047857);
    margin: 16px auto 0;
    border-radius: 2px;
}

/* Animated Progress Bar */
.loader-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FF6B35, #FFD700);
    border-radius: 4px;
    animation: loadProgress 2s ease-in-out infinite;
}

@keyframes loadProgress {
    0% {
        width: 0%;
        transform: translateX(0);
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
        transform: translateX(0);
    }
}

/* Animated Dots */
.loader-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.loader-dot {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.loader-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.loader-text {
    font-size: 13px;
    opacity: 0.8;
    margin-top: 20px;
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* Skeleton Loading Placeholders */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

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

    100% {
        background-position: 200% 0;
    }
}

/* Hide content initially for smooth transition */
.page-content {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.page-content.visible {
    opacity: 1;
}

/* Mobile Loader Styles */
@media (max-width: 480px) {
    .loader-logo {
        font-size: 32px;
    }

    .loader-tagline {
        font-size: 12px;
        letter-spacing: 1.5px;
        margin-bottom: 30px;
    }

    .loader-progress {
        width: 160px;
    }

    .loader-text {
        font-size: 12px;
    }
}