/**
 * Styles pour les états de chargement améliorés
 * Spinners, boutons en chargement, etc.
 */

/* Spinner inline pour les boutons */
.spinner-inline {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

/* Spinner pour boutons de petite taille */
.btn-sm .spinner-inline {
    width: 14px;
    height: 14px;
    border-width: 2px;
    margin-right: 6px;
}

/* Spinner pour boutons de grande taille */
.btn-lg .spinner-inline {
    width: 20px;
    height: 20px;
    border-width: 3px;
    margin-right: 10px;
}

/* Animation de rotation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Bouton en état de chargement */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
    cursor: wait !important;
}

.btn-loading .btn-text {
    opacity: 0;
}

.btn-loading .spinner-inline {
    opacity: 1;
}

/* Bouton avec spinner et texte visible */
.btn-loading-with-text {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading-with-text .btn-text {
    opacity: 1;
}

/* Skeleton loader pour le contenu en chargement */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-skeleton 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes loading-skeleton {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
}

/* Overlay de chargement pour les sections */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loading-overlay .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top-color: var(--primary, #667eea);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Pulse animation pour attirer l'attention */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Respect des préférences de réduction des animations */
@media (prefers-reduced-motion: reduce) {
    .spinner-inline,
    .loading-overlay .spinner,
    .skeleton {
        animation: none;
    }
    
    .pulse {
        animation: none;
    }
}







