:root {
    --primary-red: #E63946; /* A vibrant red */
    --primary-black: #1D1D1D; /* A deep, not-quite-jet black */
    --text-light: #F1FAEE;
    --background-dark: #121212; /* Dark mode style background */
    --accent-gray: #A8DADC; /* A light, contrasting color (can adjust) */
    --white: #FFFFFF;

    --font-main: 'Montserrat', sans-serif;
    --font-playful: 'Pacifico', cursive;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--background-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll from animations */
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

#app-container {
    width: 100%;
    max-width: 900px; /* Max width for content */
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navigation */
#spa-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    background-color: var(--primary-black);
    padding: 10px 0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#spa-nav a {
    color: var(--text-light);
    text-decoration: none;
    padding: 10px 20px;
    margin: 0 5px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#spa-nav a:hover,
#spa-nav a.active {
    background-color: var(--primary-red);
    color: var(--white);
}

/* Sections */
main {
    flex-grow: 1;
    position: relative; /* For absolute positioning of sections if needed */
}

.spa-section {
    display: none; /* Hidden by default */
    padding: 40px 20px;
    text-align: center;
    min-height: 60vh; /* Ensure sections take up good space */
    animation: fadeIn 0.8s ease-out;
}

.spa-section.active-section {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.content {
    max-width: 700px;
    margin: 0 auto;
}

/* Welcome Section */
#welcome .playful-title {
    font-family: var(--font-playful);
    font-size: 4rem;
    color: var(--primary-red);
    margin-bottom: 0;
    animation: popIn 0.5s ease-out 0.2s backwards;
}

#welcome .name-reveal {
    font-size: 3rem;
    color: var(--text-light);
    opacity: 0;
    animation: fadeInSlideUp 0.8s ease-out 0.7s forwards;
}

#welcome .intro-text {
    font-size: 1.2rem;
    margin-top: 20px;
    opacity: 0;
    animation: fadeInSlideUp 0.8s ease-out 1.2s forwards;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeInSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Balloons */
.balloons-container {
    position: absolute; /* Relative to welcome section or body */
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px; /* Area for balloons to float from */
    pointer-events: none; /* So they don't interfere with clicks */
    overflow: hidden;
}

.balloon {
    position: absolute;
    bottom: -100px; /* Start below screen */
    width: 50px;
    height: 70px;
    background-color: var(--primary-red);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    opacity: 0.7;
    animation: floatUp 10s infinite ease-in;
}
.balloon::before { /* String */
    content: "";
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 25px;
    background: rgba(255,255,255,0.5);
}

.balloon.black {
    background-color: var(--primary-black);
    border: 1px solid var(--primary-red);
}

@keyframes floatUp {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-300px) translateX(20px) rotate(10deg);
        opacity: 0.5;
    }
    100% {
        transform: translateY(-600px) translateX(-20px) rotate(-10deg);
        opacity: 0;
    }
}


/* Message Section */
#message h3 {
    font-family: var(--font-playful);
    color: var(--primary-red);
    font-size: 2.5rem;
    margin-bottom: 20px;
}
#message p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}
#message .signature {
    margin-top: 30px;
    font-style: italic;
    font-weight: bold;
    color: var(--accent-gray);
}

/* Gallery Section - White Box */
#gallery h3 {
    font-family: var(--font-playful);
    color: var(--primary-red);
    font-size: 2.5rem;
    margin-bottom: 30px;
}
.image-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    align-items: start;
    justify-items: center;
    margin: 2rem 0;
}
.white-box-placeholder {
    width: 300px;
    height: 250px;
    background-color: var(--white);
    border: 3px dashed var(--primary-black);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--primary-black);
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.white-box-placeholder:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(var(--primary-red-rgb, 230, 57, 70), 0.3); /* Use RGB for opacity */
}
.white-box-placeholder .placeholder-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: bounceIcon 2s infinite ease-in-out;
}
.white-box-placeholder p {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

@keyframes bounceIcon {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

.image-wrapper {
    position: relative;
    width: 100%;
    grid-column: span 1;
}

.gallery-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
}

.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-light);
    padding: 0.75rem;
    font-size: 0.9rem;
    border-radius: 0 0 10px 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-wrapper:hover .image-caption,
.image-wrapper.active .image-caption {
    opacity: 1;
}

.image-wrapper:hover .gallery-image,
.image-wrapper.active .gallery-image {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(var(--primary-red-rgb, 230, 57, 70), 0.3);
}

.caption {
    margin-top: 0.5rem;
    font-style: italic;
    color: var(--accent-gray);
    text-align: center;
    grid-column: span 1;
}

/* Celebrate Section - Cake & Confetti */
#celebrate h3 {
    font-family: var(--font-playful);
    color: var(--primary-red);
    font-size: 2.5rem;
    margin-bottom: 30px;
}

.cake-container {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cake {
    position: relative;
    width: 150px;
    height: 130px; /* Adjusted for layers */
    margin-bottom: 15px;
}

.layer {
    width: 100%;
    height: 30px;
    background-color: #A0522D; /* Brown cake */
    position: absolute;
    left: 0;
    border: 2px solid var(--primary-black);
}
.layer-top { top: 30px; background-color: #8B4513; }
.layer-middle { top: 60px; height: 35px; background-color: #D2691E; }
.layer-bottom { top: 95px; height: 35px; background-color: #A0522D; }

.icing {
    position: absolute;
    top: 20px; /* Sits on top layer */
    left: -5px;
    width: 160px;
    height: 20px;
    background-color: var(--primary-red);
    border-radius: 50% / 10px;
    border: 2px solid var(--primary-black);
    z-index: 1;
}
.icing::before, .icing::after { /* Drips */
    content: '';
    position: absolute;
    width: 15px;
    height: 20px;
    background-color: var(--primary-red);
    border-radius: 0 0 50% 50%;
    top: 10px;
    border-left: 2px solid var(--primary-black);
    border-right: 2px solid var(--primary-black);
    border-bottom: 2px solid var(--primary-black);
}
.icing::before { left: 30px; }
.icing::after { right: 30px; height: 15px; }


.candle {
    position: absolute;
    bottom: 100px; /* On top of icing */
    width: 10px;
    height: 30px;
    background-color: var(--white);
    border: 1px solid var(--primary-black);
    border-radius: 3px 3px 0 0;
    z-index: 2;
    cursor: pointer;
    transition: box-shadow 0.2s;
}
.candle[data-candle="1"] { left: 40%; transform: translateX(-50%); }
.candle[data-candle="2"] { left: 50%; transform: translateX(-50%); }
.candle[data-candle="3"] { left: 60%; transform: translateX(-50%); }

.candle.flame-on::after { /* Flame */
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 15px;
    background-color: orange;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: 0 0 10px yellow, 0 0 20px orange;
    animation: flicker 0.5s infinite alternate;
}

@keyframes flicker {
    from { opacity: 0.8; transform: translateX(-50%) scaleY(1); }
    to { opacity: 1; transform: translateX(-50%) scaleY(1.1); }
}

#cake-instruction {
    font-size: 0.9rem;
    color: var(--accent-gray);
}

#confetti-button {
    background-color: var(--primary-red);
    color: var(--white);
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(var(--primary-red-rgb, 230, 57, 70), 0.4);
}

#confetti-button:hover {
    background-color: #c5303a; /* Darker red */
    transform: translateY(-2px);
}
#confetti-button:active {
    transform: translateY(0);
}

#confetti-zone {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Don't block interactions */
    overflow: hidden;
    z-index: 1000;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 0; /* Start hidden */
    animation: fall 3s ease-out forwards;
}

@keyframes fall {
    0% { transform: translateY(-20vh) rotateZ(0deg); opacity: 1; }
    100% { transform: translateY(120vh) rotateZ(720deg); opacity: 0; }
}


/* Footer */
footer {
    padding: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--accent-gray);
    width: 100%;
    margin-top: auto; /* Pushes footer to bottom if content is short */
}

/* Responsive */
@media (max-width: 768px) {
    #welcome .playful-title { font-size: 3rem; }
    #welcome .name-reveal { font-size: 2.5rem; }
    #spa-nav { flex-wrap: wrap; padding: 5px 0;}
    #spa-nav a { padding: 8px 12px; margin: 3px;}

    .white-box-placeholder { width: 80%; height: 200px; }
    .cake { width: 120px; height: 110px;}
    .icing { width: 130px; top: 15px; }
    .layer { height: 25px; }
    .layer-top { top: 25px; }
    .layer-middle { top: 50px; height: 30px; }
    .layer-bottom { top: 80px; height: 30px; }
    .candle { bottom: 85px; height: 25px;}

    .image-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .image-wrapper {
        grid-column: 1;
    }
}

@media (max-width: 480px) {
    #welcome .playful-title { font-size: 2.5rem; }
    #welcome .name-reveal { font-size: 2rem; }
    #welcome .intro-text { font-size: 1rem; }

    .spa-section { padding: 20px 10px; }
    #message h3, #gallery h3, #celebrate h3 { font-size: 2rem; }

    .balloon { width: 35px; height: 50px; }
}