/**
 * Animation de chargement Wacati avec logo violet
 * Utilisable partout dans l'application
 */

.wacati-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wacati-loader-overlay.show {
    opacity: 1;
    visibility: visible;
}

.wacati-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.wacati-loader-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    position: relative;
    animation: wacatiPulse 2s infinite;
}

.wacati-loader-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(123, 97, 255, 0.3));
}

.wacati-loader-spinner {
    width: 100px;
    height: 100px;
    position: absolute;
    top: -10px;
    left: -10px;
}

.wacati-loader-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid #7B61FF;
    border-radius: 50%;
    animation: wacatiSpin 1.5s linear infinite;
}

.wacati-loader-spinner::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    border: 2px solid transparent;
    border-bottom: 2px solid #A78BFA;
    border-radius: 50%;
    animation: wacatiSpinReverse 2s linear infinite;
}

.wacati-loader-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #6B7280;
    margin-top: 10px;
    animation: wacatiFade 2s infinite;
}

.wacati-loader-dots {
    display: inline-block;
    animation: wacatiDots 1.5s infinite;
}

/* Mini version pour les éléments plus petits */
.wacati-loader-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    position: relative;
}

.wacati-loader-mini img {
    width: 20px;
    height: 20px;
    animation: wacatiPulseMini 1.5s infinite;
}

.wacati-loader-mini::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top: 2px solid #7B61FF;
    border-radius: 50%;
    animation: wacatiSpin 1s linear infinite;
}

/* Version bouton */
.wacati-loader-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wacati-loader-button img {
    width: 16px;
    height: 16px;
    animation: wacatiPulseMini 1.2s infinite;
}

.wacati-loader-button::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: wacatiSpin 0.8s linear infinite;
    opacity: 0.7;
}

/* Animations */
@keyframes wacatiSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes wacatiPulse {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 4px 8px rgba(123, 97, 255, 0.3));
    }
    50% { 
        transform: scale(1.1);
        filter: drop-shadow(0 6px 12px rgba(123, 97, 255, 0.4));
    }
}

@keyframes wacatiPulseMini {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.8;
    }
    50% { 
        transform: scale(1.15);
        opacity: 1;
    }
}

@keyframes wacatiFade {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

@keyframes wacatiDots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60% { content: '...'; }
    80%, 100% { content: ''; }
}

/* Version pour les cartes/contenus */
.wacati-loader-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #F9FAFB;
    border-radius: 12px;
    min-height: 200px;
}

.wacati-loader-card img {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
    animation: wacatiPulse 2s infinite;
}

.wacati-loader-card::before {
    content: '';
    width: 80px;
    height: 80px;
    border: 3px solid transparent;
    border-top: 3px solid #7B61FF;
    border-radius: 50%;
    position: absolute;
    margin-top: -50px;
    animation: wacatiSpin 2s linear infinite;
}

.wacati-loader-card-text {
    font-size: 14px;
    color: #6B7280;
    margin-top: 12px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .wacati-loader-overlay {
        backdrop-filter: blur(2px);
    }
    
    .wacati-loader-logo {
        width: 60px;
        height: 60px;
    }
    
    .wacati-loader-spinner {
        width: 80px;
        height: 80px;
        top: -10px;
        left: -10px;
    }
    
    .wacati-loader-text {
        font-size: 14px;
    }
}

/* Thème sombre */
@media (prefers-color-scheme: dark) {
    .wacati-loader-overlay {
        background: rgba(17, 24, 39, 0.95);
    }
    
    .wacati-loader-text {
        color: #D1D5DB;
    }
    
    .wacati-loader-card {
        background: #374151;
    }
    
    .wacati-loader-card-text {
        color: #D1D5DB;
    }
}

/* États de transition */
.wacati-loader-fade-in {
    animation: wacatiLoaderFadeIn 0.5s ease-out;
}

.wacati-loader-fade-out {
    animation: wacatiLoaderFadeOut 0.3s ease-in;
}

@keyframes wacatiLoaderFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wacatiLoaderFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}