/**
 * Marthoma Church Theme - Page Loader Styles
 *
 * @package MarthomaChurch
 */

/* Page Loader Container */
.marthoma-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.marthoma-page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Loader Logo */
.loader-logo {
    max-width: var(--marthoma-loader-logo-size, 150px);
    height: auto;
    margin-bottom: 20px;
}

/* Spinner Style */
.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--marthoma-light-gray, #F5F5F5);
    border-top-color: var(--marthoma-button, #375EFB);
    border-radius: 50%;
    animation: loader-spin 1s linear infinite;
}

@keyframes loader-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Dots Style */
.loader-dots {
    display: flex;
    gap: 8px;
}

.loader-dots span {
    width: 12px;
    height: 12px;
    background: var(--marthoma-button, #375EFB);
    border-radius: 50%;
    animation: loader-dots-bounce 1.4s ease-in-out infinite both;
}

.loader-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loader-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.loader-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes loader-dots-bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Pulse Style */
.loader-pulse {
    width: 60px;
    height: 60px;
    background: var(--marthoma-button, #375EFB);
    border-radius: 50%;
    animation: loader-pulse 1.5s ease-in-out infinite;
}

@keyframes loader-pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    50% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(0.8);
        opacity: 1;
    }
}

/* Progress Bar Style */
.loader-progress {
    width: 200px;
    height: 4px;
    background: var(--marthoma-light-gray, #F5F5F5);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.loader-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: var(--marthoma-button, #375EFB);
    border-radius: 2px;
    animation: loader-progress 1.5s ease-in-out infinite;
}

@keyframes loader-progress {
    0% {
        left: -30%;
    }
    100% {
        left: 100%;
    }
}

/* Dual Ring Style */
.loader-dual-ring {
    width: 50px;
    height: 50px;
    border: 3px solid transparent;
    border-top-color: var(--marthoma-button, #375EFB);
    border-bottom-color: var(--marthoma-button, #375EFB);
    border-radius: 50%;
    animation: loader-spin 1s linear infinite;
}

/* Ripple Style */
.loader-ripple {
    position: relative;
    width: 60px;
    height: 60px;
}

.loader-ripple span {
    position: absolute;
    border: 3px solid var(--marthoma-button, #375EFB);
    border-radius: 50%;
    animation: loader-ripple 1.5s ease-out infinite;
}

.loader-ripple span:nth-child(2) {
    animation-delay: 0.5s;
}

@keyframes loader-ripple {
    0% {
        width: 0;
        height: 0;
        top: 50%;
        left: 50%;
        opacity: 1;
    }
    100% {
        width: 60px;
        height: 60px;
        top: 0;
        left: 0;
        opacity: 0;
    }
}

/* Loading Text */
.loader-text {
    font-family: var(--marthoma-font-body);
    font-size: 14px;
    color: var(--marthoma-secondary, #54595F);
    margin-top: 15px;
}

/* Dark Mode Loader */
.marthoma-page-loader.dark-mode {
    background: var(--marthoma-dark-navy, #072538);
}

.marthoma-page-loader.dark-mode .loader-spinner {
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: var(--marthoma-light-blue, #B7D8FB);
}

.marthoma-page-loader.dark-mode .loader-dots span {
    background: var(--marthoma-light-blue, #B7D8FB);
}

.marthoma-page-loader.dark-mode .loader-pulse {
    background: var(--marthoma-light-blue, #B7D8FB);
}

.marthoma-page-loader.dark-mode .loader-progress {
    background: rgba(255, 255, 255, 0.2);
}

.marthoma-page-loader.dark-mode .loader-progress::after {
    background: var(--marthoma-light-blue, #B7D8FB);
}

.marthoma-page-loader.dark-mode .loader-text {
    color: rgba(255, 255, 255, 0.7);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .loader-spinner,
    .loader-dots span,
    .loader-pulse,
    .loader-progress::after,
    .loader-dual-ring,
    .loader-ripple span {
        animation: none;
    }

    .marthoma-page-loader {
        transition: none;
    }
}
