/* ===== PANTALLA DE CARGA ===== */

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 50%, #f8f9fa 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.loader-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.02);
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* ===== FLOR ANIMADA ===== */

.flower-loader {
    position: relative;
    width: 120px;
    height: 120px;
    animation: floatAnimation 4s ease-in-out infinite;
}

/* Centro de la flor */
.flower-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    background: radial-gradient(circle, #fff9c4, #ffd700, #ffb300);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.6),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    animation: pulse 2.5s ease-in-out infinite;
}

/* Pétalos base - forma más natural */
.petal {
    position: absolute;
    width: 28px;
    height: 55px;
    background: #f0f0f0;
    border-radius: 50% 50% 50% 50% / 80% 80% 20% 20%;
    transform-origin: 50% 85%;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 3px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    top: 50%;
    left: 50%;
}

/* Pétalos llenos con gradiente mejorado */
.petal.filled {
    background: linear-gradient(145deg, #a386b1 0%, #b895c4 30%, #90d4bd 70%, #7bc9b0 100%);
    box-shadow: 
        0 6px 25px rgba(163, 134, 177, 0.4),
        0 3px 15px rgba(144, 212, 189, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
    transform: scale(1.08);
}

/* Posicionamiento simétrico perfecto de 6 pétalos */
.petal:nth-child(1) {
    transform: translate(-50%, -85%) rotate(0deg);
}

.petal:nth-child(2) {
    transform: translate(-50%, -85%) rotate(60deg);
}

.petal:nth-child(3) {
    transform: translate(-50%, -85%) rotate(120deg);
}

.petal:nth-child(4) {
    transform: translate(-50%, -85%) rotate(180deg);
}

.petal:nth-child(5) {
    transform: translate(-50%, -85%) rotate(240deg);
}

.petal:nth-child(6) {
    transform: translate(-50%, -85%) rotate(300deg);
}

/* ===== TEXTO DE CARGA ===== */

.loader-text {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #6c757d;
    text-align: center;
    opacity: 0;
    animation: fadeInText 1s ease-out 0.5s forwards;
}

.loader-subtitle {
    font-family: 'Quicksand', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    color: #9ca3af;
    text-align: center;
    margin-top: 0.5rem;
    opacity: 0;
    animation: fadeInText 1s ease-out 1s forwards;
}

/* ===== BARRA DE PROGRESO ===== */

.progress-container {
    width: 200px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    animation: fadeInText 1s ease-out 1.5s forwards;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #a386b1, #90d4bd);
    border-radius: 2px;
    width: 0%;
    transition: width 0.2s ease;
    box-shadow: 0 0 10px rgba(163, 134, 177, 0.3);
}

/* ===== ANIMACIONES ===== */

@keyframes floatAnimation {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-5px) rotate(1deg);
    }
    50% {
        transform: translateY(-10px) rotate(0deg);
    }
    75% {
        transform: translateY(-5px) rotate(-1deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 15px rgba(255, 193, 7, 0.4);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 25px rgba(255, 193, 7, 0.6);
    }
}

@keyframes fadeInText {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .flower-loader {
        width: 100px;
        height: 100px;
    }
    
    .petal {
        width: 24px;
        height: 46px;
    }
    
    .flower-center {
        width: 20px;
        height: 20px;
    }
    
    .loader-text {
        font-size: 1.1rem;
    }
    
    .progress-container {
        width: 160px;
    }
}

@media (max-width: 480px) {
    .flower-loader {
        width: 85px;
        height: 85px;
    }
    
    .petal {
        width: 20px;
        height: 38px;
    }
    
    .flower-center {
        width: 18px;
        height: 18px;
    }
    
    .loader-text {
        font-size: 1rem;
    }
    
    .progress-container {
        width: 140px;
    }
}
