/* =================================================================
   LOADING SCREEN
   ================================================================= */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #b8e8fc 0%, #5dd1f9 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.flower-loader {
    position: relative;
    width: 200px;
    height: 200px;
}

/* Flower center */
.flower-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: #ffd700;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    z-index: 10;
}

/* Petal base styles */
.petal {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 80px;
    background: #ee83c3;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    transform-origin: center bottom;
    box-shadow: 0 2px 10px rgba(238, 131, 195, 0.3);
}

/* Position each petal in a circle */
.petal:nth-child(1) {
    transform: translate(-50%, -100%) rotate(0deg);
    animation: petalCycle1 5s ease-in-out infinite;
    animation-delay: 0s;
}

.petal:nth-child(2) {
    transform: translate(-50%, -100%) rotate(72deg);
    animation: petalCycle2 5s ease-in-out infinite;
    animation-delay: 0.3s;
}

.petal:nth-child(3) {
    transform: translate(-50%, -100%) rotate(144deg);
    animation: petalCycle3 5s ease-in-out infinite;
    animation-delay: 0.6s;
}

.petal:nth-child(4) {
    transform: translate(-50%, -100%) rotate(216deg);
    animation: petalCycle4 5s ease-in-out infinite;
    animation-delay: 0.9s;
}

.petal:nth-child(5) {
    transform: translate(-50%, -100%) rotate(288deg);
    animation: petalCycle5 5s ease-in-out infinite;
    animation-delay: 1.2s;
}

/* Petal animation - grow and fade out, then regrow */
@keyframes petalCycle {
    0% {
        opacity: 0;
        transform: translate(-50%, -100%) scale(0);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -100%) scale(1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -100%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -100%) scale(0);
    }
}

/* Maintain rotation for each petal */
.petal:nth-child(1) {
    animation: petalCycle1 5s ease-in-out infinite;
    animation-delay: 0s;
}

.petal:nth-child(2) {
    animation: petalCycle2 5s ease-in-out infinite;
    animation-delay: 0.3s;
}

.petal:nth-child(3) {
    animation: petalCycle3 5s ease-in-out infinite;
    animation-delay: 0.6s;
}

.petal:nth-child(4) {
    animation: petalCycle4 5s ease-in-out infinite;
    animation-delay: 0.9s;
}

.petal:nth-child(5) {
    animation: petalCycle5 5s ease-in-out infinite;
    animation-delay: 1.2s;
}

@keyframes petalCycle1 {
    0%, 10% {
        opacity: 1;
        transform: translate(-50%, -100%) rotate(0deg) scale(1);
    }
    20% {
        opacity: 0;
        transform: translate(-50%, -100%) rotate(0deg) scale(0);
    }
    70% {
        opacity: 0;
        transform: translate(-50%, -100%) rotate(0deg) scale(0);
    }
    85% {
        opacity: 1;
        transform: translate(-50%, -100%) rotate(0deg) scale(1);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -100%) rotate(0deg) scale(1);
    }
}

@keyframes petalCycle2 {
    0%, 10% {
        opacity: 1;
        transform: translate(-50%, -100%) rotate(72deg) scale(1);
    }
    20% {
        opacity: 0;
        transform: translate(-50%, -100%) rotate(72deg) scale(0);
    }
    70% {
        opacity: 0;
        transform: translate(-50%, -100%) rotate(72deg) scale(0);
    }
    85% {
        opacity: 1;
        transform: translate(-50%, -100%) rotate(72deg) scale(1);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -100%) rotate(72deg) scale(1);
    }
}

@keyframes petalCycle3 {
    0%, 10% {
        opacity: 1;
        transform: translate(-50%, -100%) rotate(144deg) scale(1);
    }
    20% {
        opacity: 0;
        transform: translate(-50%, -100%) rotate(144deg) scale(0);
    }
    70% {
        opacity: 0;
        transform: translate(-50%, -100%) rotate(144deg) scale(0);
    }
    85% {
        opacity: 1;
        transform: translate(-50%, -100%) rotate(144deg) scale(1);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -100%) rotate(144deg) scale(1);
    }
}

@keyframes petalCycle4 {
    0%, 10% {
        opacity: 1;
        transform: translate(-50%, -100%) rotate(216deg) scale(1);
    }
    20% {
        opacity: 0;
        transform: translate(-50%, -100%) rotate(216deg) scale(0);
    }
    70% {
        opacity: 0;
        transform: translate(-50%, -100%) rotate(216deg) scale(0);
    }
    85% {
        opacity: 1;
        transform: translate(-50%, -100%) rotate(216deg) scale(1);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -100%) rotate(216deg) scale(1);
    }
}

@keyframes petalCycle5 {
    0%, 10% {
        opacity: 1;
        transform: translate(-50%, -100%) rotate(288deg) scale(1);
    }
    20% {
        opacity: 0;
        transform: translate(-50%, -100%) rotate(288deg) scale(0);
    }
    70% {
        opacity: 0;
        transform: translate(-50%, -100%) rotate(288deg) scale(0);
    }
    85% {
        opacity: 1;
        transform: translate(-50%, -100%) rotate(288deg) scale(1);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -100%) rotate(288deg) scale(1);
    }
}

/* Loading text */
.loading-text {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    color: #333;
    letter-spacing: 2px;
}

.loading-text::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

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

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .flower-loader {
        width: 150px;
        height: 150px;
    }
    
    .flower-center {
        width: 30px;
        height: 30px;
    }
    
    .petal {
        width: 40px;
        height: 60px;
    }
    
    .loading-text {
        font-size: 1rem;
    }
}
