/* Global Reset & Box Sizing */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #ff6b6b; /* A vibrant red/pink for celebration */
    --secondary-color: #ffcd4a; /* A bright yellow/gold for joy */
    --accent-color: #6a0571; /* A deep purple for elegance/fun */
    --text-dark: #333;
    --text-light: #f4f4f4;
    --bg-light: #f8f8f8;
    --bg-dark: #1a1a1a;

    --font-primary: 'Nanum Pen ScriptEmilys Candy', cursive;
    --font-name: 'Niconne', cursive; /* For Akshith's name */
    --font-relatives: 'Emilys Candy', cursive; /* For Mom & Dad, etc. */
    --font-secondary: 'Poppins', sans-serif; /* Default body font */

    --max-width: 800px;
    --border-radius: 15px;
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.2);
}

body {
    font-family: var(--font-secondary);
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #fceabb, #fbde7c); /* Gentle gradient background */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top */
    min-height: 100vh;
    padding: 20px 0; /* Add some vertical padding */
    overflow-x: hidden; /* Prevent horizontal scroll for the whole page */
}

.container {
    max-width: var(--max-width);
    width: 95%; /* Adjust for smaller screens */
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    overflow: hidden; /* Keeps content within rounded corners of the container */
    padding-bottom: 20px; /* Space for footer */
    position: relative; /* Needed for confetti canvas positioning */
    z-index: 1; /* Ensure content is above confetti that isn't on hero */
}

/* Confetti Canvas Styling */
#confetti-canvas {
    position: fixed; /* Fixed so it covers the whole screen */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Crucial: allows clicks/taps to pass through to elements below */
    z-index: 9999; /* High z-index to be on top of everything */
}


/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-primary); /* Default for most headings */
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 15px;
}

/* Specific Font Styling */
h1 {
    font-size: 2.8em;
    color: var(--text-light); /* H1 in hero section is white */
    text-shadow: 2px 2px 5px rgba(0,0,0,0.4);
    line-height: 1.2;
}

.guest-name { /* For Akshith's name */
    font-family: var(--font-name);
    font-size: 3.5em; /* Make it larger and more prominent */
    color: var(--secondary-color);
    
    margin-top: 10px; /* Adjusted margin */
}
.guest-name span { /* For the actual name within the h2 */
    color: #f51e5f;
    padding: 5px 20px;
    background-color: #ffffff85;
    border-radius: 15px;
}

h4[data-font="grechen"] { /* For relative names in wish cards */
    font-family: var(--font-relatives);
    font-size: 1.8em; /* Slightly larger */
    margin-bottom: 10px;
    color: var(--accent-color);
}

p, label, a, button, footer p { /* Poppins for all other text */
    font-family: var(--font-secondary);
}


.invite-text {
    font-size: 1.1em;
    color: var(--bg-dark);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5); /* Slightly stronger shadow */
    margin-top: 20px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: var(--font-secondary);
    font-size: 1em;
    margin-top: 20px;
    box-shadow: var(--shadow-light);
}

.btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

/* Font Awesome Icon Styling */
.btn i, .audio-toggle i, .social-icons i {
    font-size: 1.2em; /* Adjust size as needed */
    color: var(--text-light); /* Set color directly, no filter needed */
}

/* WhatsApp Icon Specific */
.social-icons a {
    text-decoration: none; /* Remove underline from WhatsApp link */
}


/* Sections */
section {
    padding: 30px 20px;
    text-align: center;
    background-color: #fff; /* Ensure sections have white background */
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    margin: 20px; /* Margin around each section within the container */
    position: relative; /* Important for z-index of ScrollReveal elements */
    z-index: 2; /* Ensure sections are above the canvas */
}

/* Hero Section */
.hero-section {
    background: url('assets/images/hero-bg.webp') no-repeat center center/cover;
    color: var(--text-light);
    position: relative;
    padding: 50px 20px 80px; /* More padding at bottom for content */
    border-radius: var(--border-radius) var(--border-radius) 0 0; /* Top corners rounded */
    overflow: hidden;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
    margin: 0; /* Remove margin from this specific section to stick to top */
    box-shadow: none; /* No extra shadow on hero */
    z-index: 3; /* Hero should be above other sections and custom confetti */
    /* REMOVE: filter: blur() from here, as it would blur everything */
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(241, 241, 218, 0.4); /* Dark overlay */
    z-index: 1;
    /* NEW: Add backdrop-filter for blur effect */
    backdrop-filter: blur(5px); /* Adjust the pixel value for more or less blur */
    -webkit-backdrop-filter: blur(5px); /* For Safari support */
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.birthday-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--secondary-color);
    margin-bottom: 25px;
    box-shadow: var(--shadow-medium);
    transition: transform 0.3s ease-in-out;
}

/* Lottie Balloons */
#balloon-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allows clicks to pass through */
    z-index: 0; /* Behind content */
    opacity: 0.8;
}

/* Audio Toggle Button */
.audio-toggle {
    position: absolute;
    top: 15px; /* Slightly closer to edge */
    right: 15px; /* Slightly closer to edge */
    background-color: rgba(0, 0, 0, 0.3); /* More transparent */
    border: none;
    border-radius: 50%;
    width: 35px; /* Smaller size */
    height: 35px; /* Smaller size */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10; /* Above all content */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Smaller shadow */
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.audio-toggle:hover {
    background-color: rgba(0, 0, 0, 0.5); /* Slightly darker on hover */
    transform: scale(1.05); /* Subtle pop */
}

.audio-toggle i { /* Target Font Awesome icon */
    font-size: 18px; /* Smaller icon size */
    color: var(--text-light); /* White icon */
}

.hidden {
    display: none;
}

/* Countdown Section */
.countdown-section {
    background: var(--bg-light);
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--accent-color);
    color: var(--text-light);
    padding: 15px 10px;
    border-radius: var(--border-radius);
    min-width: 80px;
    box-shadow: var(--shadow-light);
    animation: pulse 1.5s infinite alternate; /* Subtle pulse animation */
}

.countdown-item span {
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 5px;
}

.countdown-item label {
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.03); }
}

.event-date, .event-time {
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 20px;
    color: var(--text-dark);
}

.event-date span, .event-time span {
    color: var(--primary-color);
}

/* Location Section */
.location-section .venue-name {
    font-family: var(--font-primary);
    font-size: 1.2em;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.location-section .venue-address {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 20px;
}

.map-container {
    width: 100%;
    height: 300px;
    background-color: #eee;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin: 20px auto;
    box-shadow: var(--shadow-light);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Gallery Section (Hybrid Masonry + Uniform 2x2 at bottom) */
.gallery-section {
    background: var(--bg-light);
    padding: 30px 20px;
}

.gallery-columns {
    /* This container holds both the masonry items and the uniform row */
    columns: 2; /* Creates 2 columns for the items NOT explicitly taken out */
    column-gap: 15px; /* Gap between columns */
    margin-top: 20px;
}

/* Styles for individual gallery items within the masonry columns */
.gallery-item {
    break-inside: avoid; /* Prevents image breaking across columns */
    margin-bottom: 15px; /* Vertical gap between items in masonry columns */
    background-color: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    position: relative;
    display: block; /* Important for column layout */
}

.gallery-item img {
    width: 100%; /* Image fills the width of its column */
    height: auto; /* Image maintains its aspect ratio for masonry */
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* NEW: Styles for the uniform 2x2 row at the bottom */
.gallery-uniform-row {
    /* Force this row to span all columns and be a flex container */
    column-span: all; /* Make this div span across all columns of its parent */
    display: flex;
    gap: 15px; /* Gap between the two uniform images */
    margin-top: 15px; /* Margin above this row, matching item-bottom margin */
    /* Ensure it doesn't break inside the columns system */
    break-before: column; /* Try to start this row in a new column (or outside columns) */
    break-after: column; /* Ensure nothing follows it in the columns */
    width: 100%; /* Ensure it takes full width when column-span is applied */
    flex-wrap: wrap; /* Allow wrapping on small screens */
    justify-content: center; /* Center items if they wrap */
}

.gallery-item.uniform-item {
    /* Override masonry item styles for these specific items */
    flex: 1 1 calc(50% - 7.5px); /* Two items per row with gap. 7.5px is half of 15px gap */
    max-width: calc(50% - 7.5px); /* Ensure max width for two items */
    height: 180px; /* Fixed height for uniform appearance. Adjust as needed. */
    margin-bottom: 0; /* Remove masonry vertical margin */
    display: flex; /* Use flex to center image inside fixed height item */
    justify-content: center;
    align-items: center;
}

.gallery-item.uniform-item img {
    height: 100%; /* Fill the fixed height of the uniform-item */
    object-fit: cover; /* Cover the area, cropping as necessary for uniform look */
}


/* Family Wishes Section (Flip Cards) */
.wishes-section {
    background: var(--bg-light);
    
}

.wishes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.flip-card {
    background-color: transparent;
    width: 100%;
    height: 180px;
    perspective: 1000px; /* 3D effect */
    border-radius: var(--border-radius);
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.flip-card:hover .flip-card-inner,
.flip-card.flipped .flip-card-inner { /* Add 'flipped' class via JS for mobile tap */
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-light);
}

.flip-card-front {
    background-color: var(--secondary-color);
    color: var(--text-dark);
}

.flip-card-front h4 {
    font-size: 1.5em; /* Default size for h4, will be overridden by data-font for relative names */
    margin-bottom: 10px;
    color: var(--accent-color);
}

.flip-card-front p {
    font-size: 0.9em;
    color: #555;
}

.flip-card-back {
    background-color: var(--primary-color);
    color: var(--text-light);
    transform: rotateY(180deg);
}

.flip-card-back p {
    font-size: 0.95em;
    font-style: italic;
    line-height: 1.5;
}


/* Share Section */
.share-section {
    background: var(--bg-light);
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.social-icons a {
    display: inline-block;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent-color);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease, background-color 0.2s ease;
    box-shadow: var(--shadow-light);
    text-decoration: none; /* Remove underline from social links */
}

.social-icons a:hover {
    transform: translateY(-5px) scale(1.05);
    background-color: var(--primary-color);
}

/* Font Awesome Social Icons */
.social-icons i {
    font-size: 30px; /* Adjust size */
    color: var(--text-light); /* White icon */
}

.rsvp-text {
    margin-top: 25px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1em;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    font-size: 0.85em;
    color: #777;
    background-color: #f0f0f0;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    margin-top: 20px; /* Space above footer */
}

/* ScrollReveal Animations (as before, no change here, handled by GSAP) */
.reveal {
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Typed text handled by typed.js/GSAP */
.typed-text {
    opacity: 0;
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    h1 { font-size: 2.2em; }
    .guest-name { font-size: 2.8em; }
    h3 { font-size: 1.5em; }
    h4[data-font="grechen"] { font-size: 1.5em; }

    .countdown-item {
        min-width: 70px;
        padding: 12px 8px;
    }
    .countdown-item span { font-size: 1.8em; }
    .countdown-item label { font-size: 0.7em; }

    .btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .hero-section {
        min-height: 500px;
        padding: 40px 15px 60px;
    }

    .birthday-image {
        width: 150px;
        height: 150px;
        margin-bottom: 20px;
    }

    /* Mute button on smaller screens */
    .audio-toggle {
        width: 30px;
        height: 30px;
        top: 10px;
        right: 10px;
    }
    .audio-toggle i {
        font-size: 16px;
    }

    .map-container {
        height: 250px;
    }

    /* Gallery Section - Responsive adjustments */
    .gallery-columns {
        columns: 2; /* Maintain 2 columns on tablets */
        column-gap: 10px; /* Smaller gap */
    }
    .gallery-item {
        margin-bottom: 10px; /* Smaller vertical gap */
    }
    .gallery-uniform-row {
        gap: 10px; /* Smaller gap for uniform items */
    }
    .gallery-item.uniform-item {
        flex: 1 1 calc(50% - 5px); /* Adjust flex basis for smaller gap */
        max-width: calc(50% - 5px);
        height: 160px; /* Adjust height for tablets */
    }
}

@media (max-width: 480px) {
    .container {
        width: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    section {
        padding: 25px 15px;
        margin: 15px 0; /* No side margin for sections on very small screens */
        border-radius: 0;
        box-shadow: none;
    }

    .hero-section {
        border-radius: 0;
        min-height: 450px;
    }

    h1 { font-size: 1.8em; }
    .guest-name { font-size: 2.2em; }
    h3 { font-size: 1.3em; }
    h4[data-font="grechen"] { font-size: 1.3em; }
    p { font-size: 0.9em; }
    .invite-text { font-size: 1em; }

    .countdown {
        gap: 10px;
    }

    .countdown-item {
        min-width: 60px;
        padding: 10px 5px;
    }
    .countdown-item span { font-size: 1.5em; }
    .countdown-item label { font-size: 0.6em; }

    .btn {
        padding: 8px 15px;
        font-size: 0.8em;
    }

    .social-icons a {
        width: 40px;
        height: 40px;
    }
    .social-icons i { /* Target Font Awesome icon */
        font-size: 25px; /* Adjust size */
    }

    .wishes-grid {
        grid-template-columns: 1fr; /* Stack cards vertically */
    }

    /* Gallery Section - Responsive adjustments */
    .gallery-columns {
        columns: 2; /* Single column for masonry on small mobiles */
        column-gap: 5;
    }
    .gallery-item {
        margin-bottom: 15px;
    }
    .gallery-uniform-row {
        flex-direction: column; /* Stack uniform items vertically on tiny screens */
        gap: 15px;
    }
    .gallery-item.uniform-item {
        flex: 1 1 100%; /* Take full width */
        max-width: 100%;
        height: 200px; /* Adjust height for single column on mobiles */
    }
}