/* ========================================
   BIRTHDAY SITE - Custom Styles
   ======================================== */

html {
    scroll-behavior: smooth;
}

body {
    background: #000;
}

/* --- Card 3D Flip --- */
.card-container {
    perspective: 1000px;
}

.card {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card > div {
    backface-visibility: hidden;
    position: absolute;
    inset: 0;
}

/* Back face starts rotated 180deg so it faces away (hidden by backface-visibility) */
.card-back {
    transform: rotateY(180deg);
}

.card.flipped {
    transform: rotateY(180deg);
}

/* --- 3D Photo Gallery --- */
#galleryContainer {
    width: 100%;
    height: 100%;
}

/* --- Balloons --- */
.balloon {
    position: absolute;
    bottom: -120px;
    width: 24px;
    height: 30px;
    border-radius: 50% 50% 40% 40%;
    opacity: 0.9;
    animation: floatUp linear infinite;
    pointer-events: none;
    z-index: 50;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.balloon::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 140px;
    background: rgba(255, 255, 255, 0.35);
}

@keyframes floatUp {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.9;
    }
    90% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(-100vh) translateX(var(--tx));
        opacity: 0;
    }
}

/* --- Confetti --- */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    pointer-events: none;
    z-index: 51;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* --- Fade In --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* --- Photo Modal --- */
.photo-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    padding: 1rem;
}

.photo-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.photo-modal-content img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

.photo-modal-caption {
    margin-top: 1rem;
    color: #fff;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
}

.photo-modal-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.photo-modal-close:hover {
    transform: scale(1.1);
}

.photo-modal-close svg {
    width: 20px;
    height: 20px;
    fill: #000;
}

/* --- Wish Result --- */
#wishResult.hidden {
    display: none;
}

/* --- Responsive adjustments --- */
@media (max-width: 640px) {
    h1 {
        font-size: 3rem !important;
        line-height: 1.1;
    }
    #galleryContainer {
        height: 500px;
    }
    .photo-modal-caption {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.5rem !important;
    }
    #galleryContainer {
        height: 400px;
    }
}