/* Loader fancy avec animations - StartNewStory */

/* Animations */
@keyframes spin {
    0% { 
        transform: rotate(0deg); 
    }
    100% { 
        transform: rotate(360deg); 
    }
}

@keyframes pulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.2); 
        opacity: 0.8; 
    }
}

@keyframes progress {
    0% { 
        width: 0%; 
        transform: translateX(0); 
    }
    50% { 
        width: 70%; 
        transform: translateX(0); 
    }
    100% { 
        width: 100%; 
        transform: translateX(100%); 
    }
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0) rotate(0deg); 
        opacity: 0.7; 
    }
    50% { 
        transform: translateY(-20px) rotate(180deg); 
        opacity: 1; 
    }
}

/* Conteneur des particules */
.loader-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Particules animées */
.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.8), transparent);
    border-radius: 50%;
    animation: float 4s ease-in-out infinite;
}

.particle:nth-child(1) { 
    left: 10%; 
    top: 20%; 
    animation-delay: 0s; 
}

.particle:nth-child(2) { 
    left: 20%; 
    top: 80%; 
    animation-delay: 0.5s; 
}

.particle:nth-child(3) { 
    left: 50%; 
    top: 10%; 
    animation-delay: 1s; 
}

.particle:nth-child(4) { 
    left: 70%; 
    top: 60%; 
    animation-delay: 1.5s; 
}

.particle:nth-child(5) { 
    left: 90%; 
    top: 30%; 
    animation-delay: 2s; 
}

.particle:nth-child(6) { 
    left: 30%; 
    top: 50%; 
    animation-delay: 2.5s; 
}

.particle:nth-child(7) { 
    left: 60%; 
    top: 90%; 
    animation-delay: 3s; 
}

.particle:nth-child(8) { 
    left: 80%; 
    top: 15%; 
    animation-delay: 3.5s; 
}

/* Classes pour les éléments du spinner */
.spinner-ring {
    position: absolute;
    border: 4px solid transparent;
    border-radius: 50%;
}

.spinner-ring.spinner-ring-1 {
    width: 100%;
    height: 100%;
    border-top: 4px solid #8b5cf6;
    animation: spin 1s linear infinite;
}

.spinner-ring.spinner-ring-2 {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top: 4px solid #3b82f6;
    animation: spin 1.2s linear infinite reverse;
}

.spinner-ring.spinner-ring-3 {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top: 4px solid #06b6d4;
    animation: spin 0.8s linear infinite;
}

.spinner-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #3b82f6, #06b6d4);
    border-radius: 2px;
    animation: progress 2s ease-in-out infinite;
}

/* Bouton de fermeture du loader */
.loader-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.loader-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.loader-close:active {
    transform: scale(0.95);
}

/* Styles pour le contenu du loader */
.loader-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 450px;
    margin: 1rem;
}

.loader-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.loader-message {
    color: #cbd5e1;
    font-size: 1rem;
    font-weight: 500;
    min-height: 1.5rem;
    transition: opacity 0.5s ease;
}

.loader-progress-container {
    margin-top: 1.5rem;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
}

.loader-spinner {
    margin: 0 auto 2rem;
    width: 120px;
    height: 120px;
    position: relative;
}
