/* Page Loader */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary, #0C1A3D) 0%, #1a2d5a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

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

/* Modern Premium Loader */
.loader-container {
    position: relative;
    width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* School Emblem/Logo */
.loader-emblem {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent, #C9952A) 0%, #FFD700 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--primary, #0C1A3D);
    font-weight: 700;
    font-family: 'Fraunces', serif;
    box-shadow: 0 8px 32px rgba(201, 149, 42, 0.4);
    animation: emblem-pulse 2s ease-in-out infinite;
    margin-bottom: 30px;
}

.loader-emblem i {
    font-size: 36px;
}

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

/* Progress Bar */
.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent, #C9952A) 0%, #FFD700 100%);
    border-radius: 2px;
    animation: progress-loading 2s ease-in-out infinite;
    width: 0%;
}

/* Loading Text */
.loader-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: text-fade 1.5s ease-in-out infinite;
}

/* Decorative Elements */
.loader-decoration {
    position: absolute;
    width: 300px;
    height: 300px;
    pointer-events: none;
}

.loader-decoration::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    border: 1px solid rgba(201, 149, 42, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: rotate-slow 8s linear infinite;
}

.loader-decoration::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160px;
    height: 160px;
    border: 1px solid rgba(201, 149, 42, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: rotate-medium 6s linear infinite reverse;
}

/* Small dots around emblem */
.loader-dots {
    position: absolute;
    width: 120px;
    height: 120px;
    animation: rotate-slow 10s linear infinite;
}

.loader-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent, #C9952A);
    border-radius: 50%;
    animation: dot-pulse 1.5s ease-in-out infinite;
}

.loader-dot:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); animation-delay: 0s; }
.loader-dot:nth-child(2) { top: 50%; right: 0; transform: translateY(-50%); animation-delay: 0.3s; }
.loader-dot:nth-child(3) { bottom: 0; left: 50%; transform: translateX(-50%); animation-delay: 0.6s; }
.loader-dot:nth-child(4) { top: 50%; left: 0; transform: translateY(-50%); animation-delay: 0.9s; }

/* Animations */
@keyframes emblem-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 32px rgba(201, 149, 42, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 48px rgba(201, 149, 42, 0.6);
    }
}

@keyframes progress-loading {
    0% {
        width: 0%;
        opacity: 0.5;
    }
    50% {
        width: 70%;
        opacity: 1;
    }
    100% {
        width: 100%;
        opacity: 0.5;
    }
}

@keyframes text-fade {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

@keyframes rotate-slow {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes rotate-medium {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes dot-pulse {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

/* Main content hidden initially */
#main-content {
    opacity: 0;
    transition: opacity 0.5s ease;
}

#main-content.visible {
    opacity: 1;
}
