/**
 * CSS koji se koristi na trećem koraku u odabiru želje.
 * U pitanju je animacija koja se pojavi kada korisnik klikne da pošalje svoje podatke i rezerviše želju.
 */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    z-index: 9999;
}
.present-loader {
    position: relative;
    width: 150px;
    height: 150px;
}
.present-loader {
    position: relative;
    width: 150px;
    height: 150px;
    margin-top: 25vh !important;
}
.present-box {
    position: absolute;
    bottom: 0;
    width: 100px;
    height: 80px;
    background-color: #FF4057;
    border-radius: 5px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}
.present-box::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 100%;
    background-color: #250342;
    left: 50%;
    transform: translateX(-50%);
}
.present-box::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 20px;
    background-color: #250342;
    top: 50%;
    transform: translateY(-50%);
}
.present-lid {
    position: absolute;
    top: 70px;
    width: 120px;
    height: 30px;
    background-color: #FF4057;
    border-radius: 5px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    transform-origin: 100% 100%;
    animation: openLidToSide 4s infinite ease-in-out;
    perspective: 500px;
}
.present-lid::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 100%;
    background-color: #250342;
    left: 50%;
    transform: translateX(-50%);
}
.bow {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 40px;
    z-index: 3;
}
.bow-left, .bow-right {
    position: absolute;
    width: 30px;
    height: 30px;
    background-color: #250342;
    border-radius: 50%;
    top: 0;
}
.bow-left {
    left: 0;
    transform: rotate(45deg);
}
.bow-right {
    right: 0;
    transform: rotate(-45deg);
}
.bow-center {
    position: absolute;
    width: 15px;
    height: 15px;
    background-color: #ffd700;
    border-radius: 50%;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
}
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: explodeConfetti 4s infinite ease-out;
    z-index: 0;
}

/* Različite boje i oblici za konfete (isto kao pre) */
.confetti:nth-child(1), .confetti:nth-child(4), .confetti:nth-child(7) { background-color: #FF4057; border-radius: 2px; } /* Kvadrat, Narandžasta */
.confetti:nth-child(2), .confetti:nth-child(5), .confetti:nth-child(8) { background-color: #4caf50; border-radius: 50%; } /* Krug, Zelena */
.confetti:nth-child(3), .confetti:nth-child(6), .confetti:nth-child(9) {
    width: 0; height: 0; background-color: transparent;
    border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 10px solid #2196f3; /* Trougao, Plava */
}
.confetti:nth-child(10), .confetti:nth-child(13), .confetti:nth-child(16) { background-color: #f06292; border-radius: 2px; } /* Kvadrat, Roze */
.confetti:nth-child(11), .confetti:nth-child(14), .confetti:nth-child(17) { background-color: #ffee58; border-radius: 50%; } /* Krug, Žuta */
.confetti:nth-child(12), .confetti:nth-child(15), .confetti:nth-child(18) {
    width: 0; height: 0; background-color: transparent;
    border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 10px solid #ab47bc; /* Trougao, Ljubičasta */
}

/* Odgođene animacije za konfete i nasumične putanje */
.confetti:nth-child(1) { --x: -80px; --y: -180px; --r: 30deg; animation-delay: 0.8s; }
.confetti:nth-child(2) { --x: 60px; --y: -220px; --r: -60deg; animation-delay: 0.9s; }
.confetti:nth-child(3) { --x: -40px; --y: -250px; --r: 90deg; animation-delay: 1.0s; }
.confetti:nth-child(4) { --x: 90px; --y: -190px; --r: -30deg; animation-delay: 1.1s; }
.confetti:nth-child(5) { --x: -70px; --y: -230px; --r: 120deg; animation-delay: 1.2s; }
.confetti:nth-child(6) { --x: 50px; --y: -260px; --r: -90deg; animation-delay: 1.3s; }
.confetti:nth-child(7) { --x: -100px; --y: -200px; --r: 45deg; animation-delay: 1.4s; }
.confetti:nth-child(8) { --x: 80px; --y: -240px; --r: -75deg; animation-delay: 1.5s; }
.confetti:nth-child(9) { --x: -30px; --y: -270px; --r: 100deg; animation-delay: 1.6s; }
.confetti:nth-child(10) { --x: -50px; --y: -160px; --r: 20deg; animation-delay: 0.9s; }
.confetti:nth-child(11) { --x: 70px; --y: -210px; --r: -50deg; animation-delay: 1.0s; }
.confetti:nth-child(12) { --x: -20px; --y: -240px; --r: 80deg; animation-delay: 1.1s; }
.confetti:nth-child(13) { --x: 100px; --y: -170px; --r: -40deg; animation-delay: 1.2s; }
.confetti:nth-child(14) { --x: -90px; --y: -220px; --r: 110deg; animation-delay: 1.3s; }
.confetti:nth-child(15) { --x: 40px; --y: -250px; --r: -80deg; animation-delay: 1.4s; }
.confetti:nth-child(16) { --x: -60px; --y: -190px; --r: 55deg; animation-delay: 1.5s; }
.confetti:nth-child(17) { --x: 30px; --y: -230px; --r: -65deg; animation-delay: 1.6s; }
.confetti:nth-child(18) { --x: -10px; --y: -260px; --r: 95deg; animation-delay: 1.7s; }

/* ANIMACIJE */
/* Animirano otvaranje poklopca na gore (isto kao pre) */
@keyframes openLidUp {
    0%, 20% {
        transform: translateX(-50%) translateY(0); /* Zatvoreno */
    }
    35% {
        transform: translateX(-50%) translateY(-60px) rotateX(0deg); /* Otvoreno - podiže se */
    }
    65% {
        transform: translateX(-50%) translateY(-60px) rotateX(0deg); /* Zadržava se otvoreno */
    }
    80%, 100% {
        transform: translateX(-50%) translateY(0); /* Zatvara se */
    }
}

/* Animirano otvaranje poklopca na gore */
@keyframes openLidToSide {
    0%, 20% {
        transform: translateX(-50%) rotate(0deg); /* Poklopac zatvoren */
    }
    35% {
        /* Ključna izmena: Koristimo minimalni ili nulti horizontalni pomeraj */
        transform: translateX(-50%) rotate(100deg);
    }
    65% {
        /* Zadržava se otvoreno */
        transform: translateX(-50%) rotate(100deg);
    }
    80%, 100% {
        transform: translateX(-50%) rotate(0deg); /* Zatvara se */
    }
}

/* Animacija kretanja konfeta */
@keyframes explodeConfetti {
    0%, 25% { /* Konfete nevidljive i unutar kutije */
        transform: translateX(-50%) translateY(0) rotate(0deg);
        opacity: 0;
    }
    40% { /* Počinju da izleću */
        opacity: 1;
        transform: translateX(calc(-50% + var(--x, 0px))) translateY(var(--y, -100px)) rotate(var(--r, 0deg));
    }
    70% { /* Vrhunac raspršivanja, počinju da padaju */
        opacity: 0.8;
        transform: translateX(calc(-50% + var(--x, 0px))) translateY(calc(var(--y, -100px) + 50px)) rotate(calc(var(--r, 0deg) + 180deg));
    }
    100% { /* Nestaju i vraćaju se na početak za sledeći ciklus */
        opacity: 0;
        transform: translateX(calc(-50% + var(--x, 0px))) translateY(calc(var(--y, -100px) + 100px)) rotate(calc(var(--r, 0deg) + 360deg));
    }
}
