/* ============================================
   STARRY NIGHT LOADING SCREEN
   ============================================ */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 50% 50%, #26334d 0%, #1e293b 50%, #151e32 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 1;
    transition: opacity 1s ease-out, visibility 1s ease-out;
    overflow: hidden;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Heart-drawing canvas (loading screen overlay) */
.heart-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

/* --- Star layers --- */
.butterflies-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

/* Repurpose the butterfly divs as stars */
.butterfly {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: white;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

.butterfly svg {
    display: none;
    /* Hide the SVGs */
}

/* We'll make each "butterfly" a twinkling star */
.butterfly::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.4);
}

.butterfly-1 {
    top: 12%;
    left: 15%;
    width: 3px;
    height: 3px;
    animation: loadTwinkle 2.5s ease-in-out infinite;
    animation-delay: 0s;
}

.butterfly-2 {
    top: 25%;
    left: 72%;
    width: 2px;
    height: 2px;
    animation: loadTwinkle 3.2s ease-in-out infinite;
    animation-delay: 0.8s;
}

.butterfly-3 {
    top: 55%;
    left: 22%;
    width: 4px;
    height: 4px;
    animation: loadTwinkle 2.8s ease-in-out infinite;
    animation-delay: 1.5s;
}

.butterfly-4 {
    top: 78%;
    left: 82%;
    width: 2px;
    height: 2px;
    animation: loadTwinkle 3.5s ease-in-out infinite;
    animation-delay: 0.4s;
}

.butterfly-5 {
    top: 42%;
    left: 48%;
    width: 3px;
    height: 3px;
    animation: loadTwinkle 2.2s ease-in-out infinite;
    animation-delay: 1.2s;
}

.butterfly-6 {
    top: 18%;
    left: 88%;
    width: 2px;
    height: 2px;
    animation: loadTwinkle 4s ease-in-out infinite;
    animation-delay: 2s;
}

.butterfly-7 {
    top: 68%;
    left: 38%;
    width: 3px;
    height: 3px;
    animation: loadTwinkle 2.7s ease-in-out infinite;
    animation-delay: 0.6s;
}

.butterfly-8 {
    top: 35%;
    left: 62%;
    width: 4px;
    height: 4px;
    animation: loadTwinkle 3s ease-in-out infinite;
    animation-delay: 1.8s;
}

@keyframes loadTwinkle {

    0%,
    100% {
        opacity: 0.2;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}



/* --- Loading text --- */
.loading-text {
    position: relative;
    z-index: 10;
    font-family: 'Great Vibes', cursive;
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--gold-light, #e8d5a3);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    animation: loadingPulse 2.5s ease-in-out infinite;
}

@keyframes loadingPulse {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.03);
    }
}

.loading-dots {
    display: inline-block;
    animation: pulseDots 1.5s infinite steps(4, end);
    width: 24px;
    text-align: left;
}

@keyframes pulseDots {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }

    100% {
        content: '';
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .butterfly {
        width: 2px;
        height: 2px;
    }
}