/**
 * Rubikto Pro - Custom Preloader CSS
 */

.rubikto-pro-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.rubikto-pro-preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
    max-width: 300px;
    padding: 20px;
}

.preloader-logo {
    margin-bottom: 20px;
}

.preloader-logo img {
    max-width: 120px;
    max-height: 60px;
    object-fit: contain;
}

.preloader-text {
    margin-top: 15px;
    font-size: 16px;
    font-weight: 500;
    direction: rtl;
}

/* Spinner Animation */
.preloader-spinner .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 124, 186, 0.2);
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Dots Animation */
.preloader-dots .dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.preloader-dots .dots div {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #007cba;
    animation: dots-bounce 1.4s ease-in-out infinite both;
}

.preloader-dots .dots div:nth-child(1) { animation-delay: -0.32s; }
.preloader-dots .dots div:nth-child(2) { animation-delay: -0.16s; }

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

/* Bars Animation */
.preloader-bars .bars {
    display: flex;
    justify-content: center;
    gap: 4px;
    height: 40px;
}

.preloader-bars .bars div {
    width: 6px;
    background-color: #007cba;
    animation: bars-stretch 1.2s ease-in-out infinite;
}

.preloader-bars .bars div:nth-child(1) { animation-delay: -1.2s; }
.preloader-bars .bars div:nth-child(2) { animation-delay: -1.1s; }
.preloader-bars .bars div:nth-child(3) { animation-delay: -1.0s; }
.preloader-bars .bars div:nth-child(4) { animation-delay: -0.9s; }
.preloader-bars .bars div:nth-child(5) { animation-delay: -0.8s; }

@keyframes bars-stretch {
    0%, 40%, 100% {
        transform: scaleY(0.4);
    }
    20% {
        transform: scaleY(1);
    }
}

/* Pulse Animation */
.preloader-pulse .pulse {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #007cba;
    animation: pulse 1.2s ease-in-out infinite;
    margin: 0 auto;
}

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

/* Custom Animation */
.preloader-custom .custom-loader {
    font-size: 48px;
    animation: custom-rotate 2s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .preloader-content {
        max-width: 250px;
        padding: 15px;
    }
    
    .preloader-logo img {
        max-width: 100px;
        max-height: 50px;
    }
    
    .preloader-text {
        font-size: 14px;
    }
    
    .preloader-spinner .spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    .preloader-dots .dots div {
        width: 10px;
        height: 10px;
    }
    
    .preloader-bars .bars div {
        width: 5px;
    }
    
    .preloader-pulse .pulse {
        width: 50px;
        height: 50px;
    }
    
    .preloader-custom .custom-loader {
        font-size: 36px;
    }
}

/* RTL Support */
.rtl .preloader-text {
    direction: rtl;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .rubikto-pro-preloader {
        background-color: #000000 !important;
    }
    
    .preloader-text {
        color: #ffffff !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .preloader-spinner .spinner,
    .preloader-dots .dots div,
    .preloader-bars .bars div,
    .preloader-pulse .pulse,
    .preloader-custom .custom-loader {
        animation: none;
    }
    
    .rubikto-pro-preloader {
        transition: none;
    }
} 