/* Loader professionnel pour BMD SOFT */

/* Overlay du loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    opacity: 1;
    visibility: visible;
}

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

/* Container du spinner */
.loader-container {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Spinner principal avec effet orbital */
.spinner-orbital {
    position: relative;
    width: 120px;
    height: 120px;
    animation: rotate 2s linear infinite;
}

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

/* Cercles orbitaux */
.orbital-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid transparent;
}

.orbital-circle:nth-child(1) {
    border-top-color: #3b82f6;
    animation: orbit1 1.5s linear infinite;
}

.orbital-circle:nth-child(2) {
    border-right-color: #8b5cf6;
    animation: orbit2 2s linear infinite;
    width: 90%;
    height: 90%;
    top: 5%;
    left: 5%;
}

.orbital-circle:nth-child(3) {
    border-bottom-color: #ec4899;
    animation: orbit3 2.5s linear infinite;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
}

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

@keyframes orbit2 {
    0% { transform: rotate(120deg); }
    100% { transform: rotate(480deg); }
}

@keyframes orbit3 {
    0% { transform: rotate(240deg); }
    100% { transform: rotate(600deg); }
}

/* Centre du spinner avec logo ou icône */
.spinner-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-dot {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.7;
    }
}

/* Texte de chargement */
.loader-text {
    margin-top: 30px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInUp 0.5s ease-out 0.3s forwards;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Points de chargement animés */
.loading-dots {
    display: inline-flex;
    margin-left: 5px;
}

.loading-dots span {
    width: 4px;
    height: 4px;
    background: #3b82f6;
    border-radius: 50%;
    margin: 0 2px;
    animation: dot-bounce 1.4s ease-in-out infinite;
}

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

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

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

@keyframes dot-bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    40% {
        transform: translateY(-10px);
        opacity: 0.7;
    }
}

/* Barre de progression (optionnelle) */
.loader-progress {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    border-radius: 2px;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% {
        width: 0%;
        transform: translateX(0);
    }
    50% {
        width: 100%;
        transform: translateX(0);
    }
    100% {
        width: 100%;
        transform: translateX(100%);
    }
}

/* Version alternative : Spinner minimaliste */
.spinner-minimal {
    width: 60px;
    height: 60px;
    position: relative;
    display: none; /* Caché par défaut */
}

.spinner-minimal::before,
.spinner-minimal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
}

.spinner-minimal::before {
    border-top-color: #3b82f6;
    animation: spin 1s linear infinite;
}

.spinner-minimal::after {
    border-bottom-color: #8b5cf6;
    animation: spin 1s linear infinite reverse;
}

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

/* Responsive */
@media (max-width: 768px) {
    .loader-container {
        width: 150px;
        height: 150px;
    }
    
    .spinner-orbital {
        width: 80px;
        height: 80px;
    }
    
    .spinner-center {
        width: 40px;
        height: 40px;
    }
    
    .spinner-dot {
        width: 10px;
        height: 10px;
    }
    
    .loader-text {
        font-size: 12px;
    }
    
    .loader-progress {
        width: 150px;
    }
}

/* Mode préférence de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    .spinner-orbital,
    .orbital-circle,
    .spinner-dot,
    .loading-dots span,
    .loader-progress-bar,
    .spinner-minimal::before,
    .spinner-minimal::after {
        animation: none !important;
    }
    
    .page-loader {
        transition: none;
    }
    
    /* Afficher une version statique */
    .spinner-orbital {
        border: 2px solid #3b82f6;
        border-radius: 50%;
    }
}

/* Effet de particules flottantes (optionnel) */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(59, 130, 246, 0.5);
    border-radius: 50%;
    animation: float-up 4s linear infinite;
}

@keyframes float-up {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 8s; }
.particle:nth-child(2) { left: 20%; animation-delay: 1s; animation-duration: 10s; }
.particle:nth-child(3) { left: 30%; animation-delay: 2s; animation-duration: 7s; }
.particle:nth-child(4) { left: 40%; animation-delay: 0.5s; animation-duration: 9s; }
.particle:nth-child(5) { left: 50%; animation-delay: 1.5s; animation-duration: 11s; }
.particle:nth-child(6) { left: 60%; animation-delay: 2.5s; animation-duration: 8s; }
.particle:nth-child(7) { left: 70%; animation-delay: 3s; animation-duration: 10s; }
.particle:nth-child(8) { left: 80%; animation-delay: 0.8s; animation-duration: 7s; }
.particle:nth-child(9) { left: 90%; animation-delay: 1.8s; animation-duration: 9s; }
.particle:nth-child(10) { left: 95%; animation-delay: 2.8s; animation-duration: 12s; }