/* 
 * Page Loader Styles
 * Matches Oriental Art Investment theme
 */

/* Prevent scroll while loading */
body.loading {
    overflow: hidden;
}

.page-loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #171a25;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    margin: 0;
    padding: 0;
}

.page-loader-wrapper.loaded {
    opacity: 0;
    visibility: hidden;
}

.page-loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.page-loader-logo {
    margin-bottom: 35px;
    animation: logoFade 2s ease-in-out infinite;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-loader-logo img {
    width: 220px;
    height: auto;
    display: block;
}

/* Spinner */
.page-loader-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-loader-spinner::before,
.page-loader-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    top: 0;
    left: 0;
}

.page-loader-spinner::before {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(51, 82, 198, 0.2);
}

.page-loader-spinner::after {
    width: 60px;
    height: 60px;
    border: 3px solid transparent;
    border-top-color: #3352c6;
    border-right-color: #3352c6;
    animation: spin 1s linear infinite;
}

/* Loading text */
.page-loader-text {
    margin-top: 30px;
    font-size: 14px;
    color: #a0aec0;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: textPulse 1.5s ease-in-out infinite;
    display: block;
    text-align: center;
}

/* Alternative Loader Style - Dots */
.page-loader-dots {
    display: inline-flex;
    gap: 8px;
    margin-top: 20px;
}

.page-loader-dot {
    width: 10px;
    height: 10px;
    background: #3352c6;
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite;
}

.page-loader-dot:nth-child(1) {
    animation-delay: 0s;
}

.page-loader-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.page-loader-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Animations */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes logoFade {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes textPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    40% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

/* Alternative Loader - Ring Style */
.page-loader-ring {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.page-loader-ring div {
    position: absolute;
    width: 64px;
    height: 64px;
    margin: 8px;
    border: 4px solid #3352c6;
    border-radius: 50%;
    animation: ringPulse 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: #3352c6 transparent transparent transparent;
}

.page-loader-ring div:nth-child(1) {
    animation-delay: -0.45s;
}

.page-loader-ring div:nth-child(2) {
    animation-delay: -0.3s;
}

.page-loader-ring div:nth-child(3) {
    animation-delay: -0.15s;
}

@keyframes ringPulse {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Minimal fade loader for content sections */
.content-loader {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(51, 82, 198, 0.2);
    border-top-color: #3352c6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .page-loader-wrapper {
        padding: 20px;
    }
    
    .page-loader-content {
        width: 100%;
        max-width: 300px;
    }
    
    .page-loader-logo {
        margin-bottom: 30px;
    }
    
    .page-loader-logo img {
        width: 180px;
        max-width: 90%;
    }
    
    .page-loader-spinner {
        width: 50px;
        height: 50px;
    }
    
    .page-loader-spinner::before,
    .page-loader-spinner::after {
        width: 50px;
        height: 50px;
    }
    
    .page-loader-text {
        font-size: 12px;
        letter-spacing: 1.5px;
        margin-top: 25px;
    }
}

@media (max-width: 480px) {
    .page-loader-logo img {
        width: 150px;
    }
    
    .page-loader-spinner {
        width: 45px;
        height: 45px;
    }
    
    .page-loader-spinner::before,
    .page-loader-spinner::after {
        width: 45px;
        height: 45px;
        border-width: 2px;
    }
}