/* GLOBAL STYLES & LAYOUT */
:root {
    --primary-color: #FFD700; /* Gold */
    --secondary-color: #FF69B4; /* Hot Pink */
    --text-color: #FFFFFF; /* White */
    --background-color: #000000; /* Black */
    --overlay-color: rgba(0, 0, 0, 0.7);
    --font-heading: 'Cinzel', serif;
    --font-body: 'Montserrat', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    /* Prevents scrolling */
    overflow: hidden; 
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--background-color);
}

/* BACKGROUND COLLAGE */
.collage-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Use CSS Grid for the collage layout */
    display: grid;
    /* 2x2 grid layout */
    grid-template-columns: 1fr 1fr; 
    grid-template-rows: 1fr 1fr;
    gap: 0;
    z-index: 1;
}

.image-box {
    overflow: hidden;
    /* Smooth transition for hover/animation effects */
    transition: transform 0.5s ease;
}

.image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures images cover their area without distortion */
    /* Subtle zoom effect on load/transition */
    transform: scale(1.05); 
    transition: transform 10s ease-out; /* Slow, subtle animation */
    /* Animates all images to scale down slightly for a 'breathing' effect */
    animation: image-breathing 30s infinite alternate;
}

@keyframes image-breathing {
    from { transform: scale(1.05); }
    to { transform: scale(1.10); }
}

/* DARK OVERLAY */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-color);
    z-index: 2;
}

/* MAIN CONTENT (CENTERED) */
.content {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    /* Smooth transition for the content swap */
    transition: opacity 1s ease-in-out; 
}

/* COUNTDOWN STYLES */
.countdown-container {
    /* Optional max-width for desktop centering */
    max-width: 90%; 
    width: 100%;
}

.header-text {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 40px;
    letter-spacing: 5px;
    opacity: 0;
    /* Fade-in animation on load */
    animation: fadeIn 2s ease-out forwards 0.5s; 
}

.timer {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.timer-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    /* Staggered fade-in */
    animation: fadeIn 2s ease-out forwards 1s; 
}

.timer-unit:nth-child(2) { animation-delay: 1.2s; }
.timer-unit:nth-child(3) { animation-delay: 1.4s; }
.timer-unit:nth-child(4) { animation-delay: 1.6s; }


.number {
    font-size: 6rem;
    font-weight: 700;
    color: var(--secondary-color); /* Pink highlight for the numbers */
    line-height: 1;
    /* Subtle shadow for elegance */
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.5); 
    transition: transform 0.2s ease-in-out;
}

.label {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--primary-color); /* Gold highlight for labels */
    letter-spacing: 3px;
    margin-top: 10px;
}

/* BIRTHDAY MESSAGE STYLES */
.birthday-message {
    transition: transform 0.8s ease-in-out, opacity 0.8s ease-in-out;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.display-none {
    display: none;
}

.happy-bday-text {
    font-family: var(--font-heading);
    font-size: 5rem;
    color: var(--secondary-color); /* Pink highlight */
    letter-spacing: 10px;
    margin-bottom: 20px;
    /* Scale-up animation for celebration */
    animation: popIn 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; 
}

.wish-text {
    font-family: var(--font-body);
    font-size: 1.5rem;
    color: var(--primary-color); /* Gold highlight */
    opacity: 0;
    /* Fade-in animation after the "Happy Birthday" text pops in */
    animation: fadeIn 1s ease-out forwards 0.5s; 
}

/* ANIMATION KEYFRAMES */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    80% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* CONFETTI CANVAS */
#confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99; /* Ensures it's above everything else */
    pointer-events: none; /* Allows clicks to pass through */
}

/* RESPONSIVENESS FOR MOBILE */
@media (max-width: 768px) {
    .header-text {
        font-size: 1.5rem;
        margin-bottom: 20px;
        letter-spacing: 3px;
    }

    .timer {
        flex-wrap: wrap;
        gap: 15px 10px;
    }

    .timer-unit {
        /* On mobile, stack Days/Hours and Mins/Secs in two rows */
        width: 45%; 
    }
    
    .number {
        font-size: 3rem;
    }

    .label {
        font-size: 0.7rem;
        margin-top: 5px;
        letter-spacing: 2px;
    }

    .happy-bday-text {
        font-size: 3rem;
        letter-spacing: 5px;
    }

    .wish-text {
        font-size: 1rem;
    }
}

/* Small adjustments for very small screens */
@media (max-width: 480px) {
    .timer {
        gap: 10px 5px;
    }
    .number {
        font-size: 2.5rem;
    }
}

/* --- TOAST NOTIFICATION STYLES --- */

.audio-prompt-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--secondary-color); /* Pink highlight */
    color: var(--background-color);
    padding: 10px 20px;
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    opacity: 0; /* Initially hidden */
    visibility: hidden;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.audio-prompt-toast.show {
    opacity: 1;
    visibility: visible;
}

/* Ensure audio element remains hidden (optional, but good practice) */
#birthday-audio {
    display: none;
}

@media (max-width: 600px) {
    .audio-prompt-toast {
        font-size: 0.8rem;
        padding: 8px 15px;
    }
}

/* --- PASSWORD SCREEN STYLES --- */

.password-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color); /* Black */
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
}

.password-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.password-box {
    text-align: center;
    padding: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05); /* Subtle transparent background */
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1); /* Subtle gold glow */
    max-width: 300px;
    width: 90%;
}

.password-prompt {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--primary-color); /* Gold */
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--secondary-color); /* Pink line */
    padding-bottom: 5px;
}

.key-icon {
    font-size: 1.5rem;
    color: var(--secondary-color); /* Pink */
    margin-right: 10px;
    animation: pulse 1.5s infinite alternate;
}

#password-input {
    flex-grow: 1;
    background: none;
    border: none;
    color: var(--text-color);
    /* font-size: 2rem; */
    font-family: var(--font-heading);
    text-align: center;
    letter-spacing: 5px;
    outline: none;
    caret-color: var(--primary-color); /* Gold cursor */
}

/* Hide default password dots for stylish look */
#password-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.error-message {
    color: #FF0000; /* Red error */
    height: 1em;
    font-size: 0.9rem;
}

/* Pulse Animation for the Key Icon */
@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* --- MAIN CONTENT HIDE/SHOW --- */

.main-content-wrapper {
    width: 100%;
    height: 100%;
    opacity: 1;
    transition: opacity 2s ease-in-out;
}

.hidden-content {
    opacity: 0;
    visibility: hidden;
    /* This prevents FOUC (Flash of Unstyled Content) */
    position: absolute; 
}

.signature-line {
    margin-top: 20px; /* Space it out from the main message */
    font-size: 1.3rem;
    font-family: var(--font-heading); /* Use the elegant heading font */
    color: var(--primary-color); /* Use gold highlight */
    animation: fadeIn 1s ease-out forwards 1s; /* Give it a delayed fade in */
}