/* Page Loading Animation - PageantTab Theme */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

.page-loading-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Main Loading Container */
.loading-container {
    text-align: center;
    animation: slideInUp 0.8s ease-out;
}

/* Crown Logo Animation */
.loading-logo {
    margin-bottom: 30px;
    animation: logoFloat 2s ease-in-out infinite;
}

.loading-logo .crown-icon {
    font-size: 4rem;
    color: #e87532;
    display: block;
    margin-bottom: 10px;
    animation: crownPulse 1.5s ease-in-out infinite;
}

.loading-logo .brand-name {
    font-size: 2rem;
    font-weight: 700;
    color: #0f2943;
    font-family: var(--heading-font, "Questrial", sans-serif);
    background: linear-gradient(120deg, #0f2943, #e87532);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    animation: textGlow 2s ease-in-out infinite;
}

/* Loading Spinner */
.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 20px auto;
}

.loading-spinner::before,
.loading-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner::before {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(232, 117, 50, 0.2);
    border-top: 4px solid #e87532;
    animation-duration: 1s;
}

.loading-spinner::after {
    width: 40px;
    height: 40px;
    top: 10px;
    left: 10px;
    border: 3px solid rgba(15, 41, 67, 0.2);
    border-top: 3px solid #0f2943;
    animation-duration: 1.5s;
    animation-direction: reverse;
}

/* Loading Dots */
.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.loading-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-color, #e87532);
    animation: dotBounce 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

/* Loading Text */
.loading-text {
    font-size: 1.1rem;
    color: #0a0f14;
    font-weight: 500;
    margin-bottom: 10px;
    animation: textFade 2s ease-in-out infinite;
}

.loading-subtext {
    font-size: 0.9rem;
    color: color-mix(in srgb, var(--default-color), transparent 30%);
    animation: textFade 2s ease-in-out infinite 0.5s;
}

/* Progress Bar */
.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(232, 117, 50, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 20px auto 0;
    position: relative;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--heading-color));
    border-radius: 2px;
    width: 0%;
    animation: progressFill 3s ease-in-out infinite;
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes crownPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(232, 117, 50, 0.3));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px rgba(232, 117, 50, 0.6));
    }
}

@keyframes textGlow {
    0%, 100% {
        filter: drop-shadow(0 0 5px rgba(232, 117, 50, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(232, 117, 50, 0.6));
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes textFade {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

@keyframes progressFill {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

/* Fade out animation for all elements */
.page-loading-overlay.fade-out .loading-container {
    animation: fadeOutUp 0.6s ease-out forwards;
}

.page-loading-overlay.fade-out .loading-logo .crown-icon {
    animation: fadeOutScale 0.6s ease-out forwards;
}

.page-loading-overlay.fade-out .loading-logo .brand-name {
    animation: fadeOutScale 0.6s ease-out 0.1s forwards;
}

.page-loading-overlay.fade-out .loading-spinner {
    animation: fadeOutScale 0.6s ease-out 0.2s forwards;
}

.page-loading-overlay.fade-out .loading-text {
    animation: fadeOut 0.6s ease-out 0.3s forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
    .loading-logo .crown-icon {
        font-size: 3rem;
    }
    
    .loading-logo .brand-name {
        font-size: 1.5rem;
    }
    
    .loading-spinner {
        width: 50px;
        height: 50px;
    }
    
    .loading-spinner::before {
        width: 50px;
        height: 50px;
    }
    
    .loading-spinner::after {
        width: 30px;
        height: 30px;
        top: 10px;
        left: 10px;
    }
    
    .loading-progress {
        width: 150px;
    }
}

@media (max-width: 576px) {
    .loading-logo .crown-icon {
        font-size: 2.5rem;
    }
    
    .loading-logo .brand-name {
        font-size: 1.2rem;
    }
    
    .loading-text {
        font-size: 1rem;
    }
    
    .loading-subtext {
        font-size: 0.8rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .page-loading-overlay {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }
    
    .loading-text {
        color: #ffffff;
    }
    
    .loading-subtext {
        color: color-mix(in srgb, #ffffff, transparent 30%);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .loading-container,
    .loading-logo,
    .loading-logo .crown-icon,
    .loading-logo .brand-name,
    .loading-spinner::before,
    .loading-spinner::after,
    .loading-dot,
    .loading-text,
    .loading-subtext,
    .loading-progress-bar {
        animation: none;
    }
    
    .loading-spinner::before,
    .loading-spinner::after {
        animation: spin 2s linear infinite;
    }
} 