/**
 * Global Loading Overlay & Animated Spinner
 * Luxurious, modern design matching the university academic theme
 */

.global-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease-in-out, visibility 0.22s ease-in-out;
    direction: rtl;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    pointer-events: none;
}

.global-loading-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.global-loading-card {
    background: #ffffff;
    border-radius: 22px;
    padding: 32px 38px 28px;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(226, 232, 240, 0.9);
    text-align: center;
    max-width: 380px;
    width: 90%;
    transform: scale(0.92);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.global-loading-overlay.active .global-loading-card {
    transform: scale(1);
}

/* Spinner Icon & Orbit Animation */
.global-loading-icon-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.global-loading-orbit-outer {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px dashed rgba(59, 130, 246, 0.35);
    animation: loaderOrbitReverse 4s linear infinite;
}

.global-loading-orbit {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3.5px solid transparent;
    border-top-color: #1e40af;
    border-right-color: #38bdf8;
    animation: loaderOrbit 1.1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.global-loading-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #38bdf8 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.35);
    animation: loaderPulse 2s ease-in-out infinite;
    z-index: 2;
}

@keyframes loaderOrbit {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes loaderOrbitReverse {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

@keyframes loaderPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 20px rgba(30, 64, 175, 0.35);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 12px 28px rgba(37, 99, 235, 0.5);
    }
}

.global-loading-title {
    font-size: 1.12rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
    letter-spacing: -0.2px;
}

.global-loading-subtitle {
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Luxury Animated Progress Bar */
.global-loading-track {
    width: 100%;
    height: 4px;
    background: #f1f5f9;
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}

.global-loading-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 45%;
    border-radius: 99px;
    background: linear-gradient(90deg, #1e40af, #3b82f6, #38bdf8);
    animation: luxuryBarMove 1.4s ease-in-out infinite;
}

@keyframes luxuryBarMove {
    0% {
        left: -45%;
        width: 30%;
    }
    50% {
        width: 60%;
    }
    100% {
        left: 100%;
        width: 30%;
    }
}

/* Subtle card content fade during AJAX step swap */
.wizard-content-fade {
    animation: wizardFadeIn 0.28s ease-out;
}

@keyframes wizardFadeIn {
    from {
        opacity: 0.4;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

