/* ==========================================================================
   Page Loader Styles
   ========================================================================== */

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    max-width: 400px;
    padding: var(--space-xl);
}

.loader-logo {
    position: relative;
    margin-bottom: var(--space-xl);
}

.loader-pulse {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    background: var(--gradient-teal);
    border-radius: 50%;
    position: relative;
    animation: pulse 2s ease-in-out infinite;
}

.loader-pulse::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid var(--teal);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite 0.5s;
    opacity: 0.5;
}

.loader-pulse::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border: 1px solid var(--teal);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite 1s;
    opacity: 0.3;
}

.loader-logo span {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--teal);
    letter-spacing: 2px;
    display: block;
    margin-top: var(--space-md);
    animation: textGlow 2s ease-in-out infinite;
}

.loader-progress {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.progress-bar {
    height: 4px;
    background: var(--light-gray);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-bottom: var(--space-sm);
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: var(--gradient-teal);
    animation: loading 2s ease-in-out infinite;
    border-radius: var(--radius-pill);
}

.progress-text {
    font-size: 0.875rem;
    color: var(--medium-gray);
    font-weight: 500;
    display: block;
    animation: fadeIn 1s ease-in-out infinite alternate;
}

@keyframes loading {
    0% {
        width: 0;
        left: 0;
    }
    50% {
        width: 100%;
        left: 0;
    }
    100% {
        width: 0;
        left: 100%;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Loading States for Content */
.content-loading {
    position: relative;
    min-height: 200px;
}

.content-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--light-gray);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Skeleton Loading for Images */
.skeleton {
    background: linear-gradient(90deg, var(--light-gray) 25%, #e0e0e0 50%, var(--light-gray) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-image {
    width: 100%;
    height: 200px;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    border-radius: var(--radius-sm);
}

.skeleton-text:last-child {
    width: 80%;
}