/* CNS Arabia Page Loader Styles */

/* Preloader Container */
.cns-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;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.cns-page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Loader Animation Container */
.cns-loader-wrapper {
    text-align: center;
}

/* Modern Spinner Animation */
.cns-spinner {
    width: 60px;
    height: 60px;
    position: relative;
    margin: 0 auto 20px;
}

.cns-spinner-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #e8ecef;
    border-top-color: #035182;
    animation: cns-spin 1s linear infinite;
}

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

/* Alternative: Dots Animation */
.cns-dots-loader {
    display: inline-flex;
    gap: 8px;
}

.cns-dot {
    width: 12px;
    height: 12px;
    background: #035182;
    border-radius: 50%;
    animation: cns-dot-bounce 1.4s infinite ease-in-out both;
}

.cns-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.cns-dot:nth-child(2) {
    animation-delay: -0.16s;
}

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

/* Alternative: Pulse Animation */
.cns-pulse-loader {
    width: 80px;
    height: 80px;
    position: relative;
    margin: 0 auto;
}

.cns-pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #035182;
    animation: cns-pulse 1.5s ease-out infinite;
}

.cns-pulse-ring:nth-child(2) {
    animation-delay: 0.5s;
}

@keyframes cns-pulse {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Logo with Loading */
.cns-logo-loader {
    max-width: 150px;
    margin: 0 auto 20px;
    opacity: 0.8;
    animation: cns-logo-pulse 1.5s ease-in-out infinite;
}

.cns-logo-loader img {
    width: 100%;
    height: auto;
}

@keyframes cns-logo-pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

/* Loading Text */
.cns-loading-text {
    color: #035182;
    font-size: 16px;
    font-weight: 500;
    font-family: "Montserrat", sans-serif;
    margin-top: 20px;
    letter-spacing: 0.5px;
}

/* Progress Bar Style */
.cns-progress-bar {
    width: 200px;
    height: 4px;
    background: #e8ecef;
    border-radius: 2px;
    overflow: hidden;
    margin: 20px auto;
}

.cns-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #035182, #0470b8);
    border-radius: 2px;
    animation: cns-progress 2s ease-in-out infinite;
}

@keyframes cns-progress {
    0% {
        width: 0;
        margin-left: 0;
    }
    50% {
        width: 60%;
        margin-left: 0;
    }
    100% {
        width: 100%;
        margin-left: 0;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .cns-spinner {
        width: 50px;
        height: 50px;
    }
    
    .cns-loading-text {
        font-size: 14px;
    }
    
    .cns-logo-loader {
        max-width: 120px;
    }
}

/* Dark Mode Version */
.cns-page-loader.dark-mode {
    background: #1a1a1a;
}

.cns-page-loader.dark-mode .cns-spinner-circle {
    border-color: #333;
    border-top-color: #0470b8;
}

.cns-page-loader.dark-mode .cns-loading-text {
    color: #ffffff;
}

.cns-page-loader.dark-mode .cns-progress-bar {
    background: #333;
}