@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&family=Fredoka:wght@400;500;600;700&display=swap');

/* Prevent horizontal scrolling and ensure proper layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Root styling */
:root {
    --max-width: 100vw;
}

html, body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Nunito', sans-serif;
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
    max-width: 100vw;
    /* This ensures nice spacing around the edge on very wide screens */
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

img, video, iframe {
    max-width: 100%; /* Ensure media doesn't overflow its container */
    height: auto; /* Maintain aspect ratio */
    display: block; /* Remove extra space below inline images */
}

html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-padding-top: 20px;
}

body {
    background: linear-gradient(135deg, #F3E8FF 0%, #E0F2FE 50%, #F3E8FF 100%);
    background-attachment: fixed;
    font-weight: 500;
    color: #4B5563;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
}

.clouds {
    position: fixed; /* Fixed to viewport */
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -2; /* Behind butterflies and content */
}

.cloud {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
    animation: float 20s infinite linear;
}

.grass {
    position: fixed; /* Fixed to viewport bottom */
    bottom: 0;
    width: 100%;
    height: 12vh;
    background: linear-gradient(to top,
        #16A34A 0%,
        #22C55E 40%,
        #4ADE80 80%,
        transparent 100%);
    z-index: -2; /* Behind butterflies and content */
    border-radius: 50% 50% 0 0;
}

.container {
    max-width: 1100px; /* Increased from 950px for better desktop layout */
    margin: 0 auto;
    padding: clamp(20px, 4vw, 50px); /* Increased max padding for desktop */
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;    
    position: relative;
    z-index: 1; /* Above butterflies */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    width: 100%;
    box-sizing: border-box;
}

.header {
    text-align: center;
    margin-bottom: clamp(50px, 8vw, 80px);
    position: relative;
    animation: fadeInUp 0.8s ease-out;
}

.title {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: clamp(2rem, 6vw, 3.8rem); /* Slightly larger */
    color: #8B5CF6; /* Vibrant Purple */
    text-shadow: 3px 3px 0px #F3E8FF, 6px 6px 0px #D8B4FE; /* 2D shadow */
    margin-bottom: clamp(25px, 4vw, 35px);
    background: white;
    padding: clamp(25px, 5vw, 40px) clamp(30px, 6vw, 50px);
    border-radius: 25px; /* Playful border radius */
    font-weight: 700;
    letter-spacing: -0.02em;
    border: 3px solid #A78BFA; /* Lighter purple border */
    box-shadow: 8px 8px 0px #C4B5FD; /* Flat 2D shadow */
    transform: rotate(-1deg); /* Playful tilt */
    transition: transform 0.2s ease-in-out;
    max-width: 90%; /* Ensure title doesn't get too wide on large screens */
}

.title:hover {
    transform: rotate(0deg) scale(1.02);
}

.subtitle {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    color: #7C3AED; /* Deep Purple */
    margin-bottom: clamp(18px, 3vw, 25px);
    font-weight: 600;
    text-shadow: 2px 2px 0px #E9D5FF; /* Subtle 2D shadow */
}

.subtitle.special-subtitle {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    color: #EC4899; /* Playful Pink */
    font-size: clamp(1.6rem, 4.5vw, 2.6rem);
    font-weight: 700;
    text-shadow: 2px 2px 0px #FBCFE8;
    background: white;
    padding: clamp(18px, 3.5vw, 25px) clamp(28px, 5.5vw, 40px);
    border-radius: 20px;
    display: inline-block;
    border: 3px solid #F472B6;
    font-style: italic;
    letter-spacing: -0.01em;
    box-shadow: 6px 6px 0px #F9A8D4; /* Flat 2D shadow */
    transform: rotate(1deg);
    transition: transform 0.2s ease-in-out;
    position: relative;
}

.subtitle.special-subtitle::before,
.subtitle.special-subtitle::after {
    content: "✨";
    position: absolute;
    font-size: clamp(0.2rem, 0.4vw, 0.28rem);
    color: #FFB6C1;
    opacity: 0;
    animation: dreamySparkle 6s infinite ease-in-out;
    pointer-events: none;
    filter: drop-shadow(0 0 2px rgba(255, 182, 193, 0.6));
}

.subtitle.special-subtitle::before {
    top: clamp(-8px, -1.5vw, -12px);
    left: clamp(-6px, -1.2vw, -10px);
    animation-delay: 0s;
}

.subtitle.special-subtitle::after {
    bottom: clamp(-8px, -1.5vw, -12px);
    right: clamp(-6px, -1.2vw, -10px);
    animation-delay: 3s;
}

@keyframes dreamySparkle {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) scale(0.8);
    }
    20%, 80% {
        opacity: 0.5;
        transform: translateY(-2px) scale(1);
    }
    50% {
        opacity: 0.3;
        transform: translateY(-4px) scale(1.2);
    }
}

.contact-info {
    margin-top: 12px;
    font-style: italic;
    font-size: clamp(0.85rem, 2.2vw, 1rem); /* Slightly smaller */
    color: #6B21A8; /* Adjusted for footer background */
}

.photo-container {
    width: clamp(200px, 50vw, 320px);
    height: clamp(200px, 50vw, 320px);
    border-radius: 50%;
    overflow: hidden;
    border: 8px solid white;
    box-shadow:
        0 0 30px rgba(225, 29, 72, 0.3),
        0 10px 40px rgba(0, 0, 0, 0.15);
    margin: 30px auto;
    position: relative;
    background: white;
    animation: fadeInUp 0.8s ease-out 0.2s both;
    max-width: 100%; /* Ensure photo container doesn't cause overflow */
    box-sizing: border-box;
}

.photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.photo:hover {
    transform: scale(1.05);
}



.details {
    text-align: center;
    background: white;
    padding: clamp(35px, 6vw, 55px);
    border-radius: 25px;
    box-shadow: 8px 8px 0px #D8B4FE; /* Flat 2D shadow */
    margin-top: clamp(35px, 5vw, 55px);
    width: 100%;
    max-width: 650px;
    border: 3px solid #A78BFA;
    animation: fadeInUp 0.8s ease-out 0.4s both;
    transform: rotate(-0.5deg); /* Restored playful tilt */
}

/* New styles for Date and Time boxes */
.date-time-wrapper {
    display: flex;
    flex-direction: column; /* Stack date and time vertically by default */
    align-items: center; /* Center items */
    gap: clamp(10px, 2vw, 15px); /* Space between date and time boxes */
    margin-bottom: clamp(22px, 3.5vw, 32px); /* Same bottom margin as original .date */
    width: 100%; /* Use full width of parent container */
    max-width: 500px; /* Maximum width for better control on large screens */
    margin-left: auto;
    margin-right: auto;
}

.styled-box {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    color: #8B5CF6; /* Vibrant Purple */
    font-weight: 700;
    text-shadow: 2px 2px 0px #E9D5FF;
    background: #F5F3FF; /* Light purple background */
    padding: clamp(12px, 2.5vw, 18px) clamp(18px, 3.5vw, 25px);
    border-radius: 18px;
    border: 2px solid #C4B5FD;
    box-shadow: 4px 4px 0px #DDD6FE;
    text-align: center;
    width: 100%; /* Full width of parent */
    min-width: clamp(200px, 50vw, 320px); /* Increased minimum width for better date display */
    max-width: 100%; /* Use full width on desktop for better alignment */
    white-space: nowrap; /* Prevent wrapping of date text */
    overflow: visible; /* Allow content to be visible */
    text-overflow: clip; /* Remove ellipsis - let content be visible */
    word-break: keep-all; /* Prevent word breaking */
    hyphens: none; /* Disable hyphenation */
}

.date-box {
    font-size: clamp(1.3rem, 3.8vw, 1.8rem); /* Slightly adjusted from original .date */
}

.time-box {
    font-size: clamp(1.2rem, 3.5vw, 1.7rem); /* Slightly smaller than date */
    color: #7C3AED; /* Deep Purple for a bit of differentiation if desired */
    background: #F9FAFB; /* Slightly different background for differentiation */
    border-color: #D1D5DB;
    box-shadow: 4px 4px 0px #E5E7EB;
}

/* ===== DATE BOX MOBILE OPTIMIZATION ===== */
/* Ensure date and time boxes display properly on all screen sizes */
@media screen and (max-width: 480px) {
    .styled-box {
        font-size: clamp(1.1rem, 3.2vw, 1.5rem) !important; /* Larger font for better readability */
        padding: clamp(12px, 2.5vw, 16px) clamp(16px, 3.5vw, 22px) !important; /* Better padding balance */
        min-width: clamp(180px, 45vw, 260px) !important; /* Wider for date display */
        max-width: clamp(260px, 85vw, 350px) !important;
        white-space: nowrap !important;
        overflow: visible !important; /* Allow text to be fully visible */
        text-overflow: clip !important; /* No ellipsis */
    }

    .date-box {
        font-size: clamp(1.1rem, 3.2vw, 1.5rem) !important;
    }

    .time-box {
        font-size: clamp(1.1rem, 3.2vw, 1.5rem) !important;
    }
}

@media screen and (max-width: 360px) {
    .styled-box {
        font-size: clamp(1rem, 3vw, 1.3rem) !important; /* Maintain good readability */
        padding: clamp(10px, 2.2vw, 14px) clamp(14px, 3.2vw, 18px) !important; /* Better padding balance */
        min-width: clamp(160px, 42vw, 220px) !important; /* Adjusted for smaller screens */
        max-width: clamp(220px, 80vw, 300px) !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
}

@media screen and (max-width: 320px) {
    .styled-box {
        font-size: clamp(0.95rem, 2.8vw, 1.2rem) !important; /* Maintain readability even on small screens */
        padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 16px) !important; /* Better padding distribution */
        min-width: clamp(140px, 40vw, 200px) !important; /* Sufficient width for date */
        max-width: clamp(200px, 78vw, 260px) !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
}

@media screen and (max-width: 280px) {
    .styled-box {
        font-size: clamp(0.9rem, 2.6vw, 1.1rem) !important; /* Ensure date remains readable */
        padding: clamp(6px, 1.8vw, 10px) clamp(10px, 2.8vw, 14px) !important; /* Compact but not cramped */
        min-width: clamp(120px, 38vw, 180px) !important; /* Minimum space for full date */
        max-width: clamp(180px, 75vw, 220px) !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
        word-break: keep-all !important; /* Prevent any word breaking */
    }
}

.venue {
    font-size: clamp(1.3rem, 3.4vw, 1.7rem);
    color: #6D28D9; /* Darker Purple */
    margin-bottom: clamp(28px, 4.5vw, 38px);
    font-weight: 600;
}

/* Enhance venue display on desktop */
@media screen and (min-width: 1200px) {
    .venue {
        font-size: 1.9rem !important;
        margin-bottom: 40px !important;
        letter-spacing: 0.3px !important;
    }
}

.rsvp {
    font-size: clamp(1.2rem, 3.2vw, 1.5rem);
    color: #EC4899; /* Playful Pink */
    margin-top: clamp(28px, 4.5vw, 38px);
    font-weight: 600;
    font-family: 'Fredoka', sans-serif;
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #A78BFA, #8B5CF6); /* Purple gradient */
    color: white;
    padding: clamp(14px, 3.2vw, 18px) clamp(25px, 6.5vw, 38px);
    margin: clamp(10px, 2.2vw, 14px) clamp(5px, 1.2vw, 10px);
    border-radius: 50px; /* Keep playful roundness */
    text-decoration: none;
    box-shadow: 5px 5px 0px #7C3AED; /* Flat 2D shadow */
    font-weight: 700; /* Bolder */
    font-family: 'Fredoka', sans-serif; /* Playful font */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.8px; /* More spacing */
    font-size: clamp(0.9rem, 2.4vw, 1.2rem);
    border: 2px solid white; /* White border for pop */
    min-height: clamp(48px, 10.5vw, 56px);
    min-width: clamp(130px, 32vw, 170px);
    will-change: transform, box-shadow;
    overflow: hidden; /* Prevent internal overflow */
}

/* Desktop button enhancements */
@media screen and (min-width: 1200px) {
    .btn {
        font-size: 1.3rem !important;
        padding: 18px 40px !important;
        min-height: 60px !important;
        min-width: 180px !important;
        margin: 15px 12px !important;
    }
}

.btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 7px 7px 0px #6D28D9, 0 0 10px #A78BFA; /* Reduced hover shadow */
}

.btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 3px 3px 0px #6D28D9; /* Pressed shadow */
}

.button-group {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap; /* Prevent wrapping */
    gap: clamp(10px, 2vw, 15px); /* Consistent gap */
    width: 100%; /* Ensure the group takes full width to center buttons correctly */
    margin-top: clamp(15px, 3vw, 20px); /* Add some top margin */
}

.button-group .btn {
    flex-grow: 1; /* Allow buttons to grow and fill space */
    flex-shrink: 1; /* Allow buttons to shrink if needed */
    flex-basis: auto; /* Reset basis to allow natural sizing based on content and flex-grow */
    min-width: clamp(120px, 30vw, 150px); /* Minimum width for readability */
    text-align: center; /* Center text within buttons */
}

/* Countdown Timer Styles */
#countdown { /* The main container div from HTML */
    margin-top: clamp(20px, 3.5vw, 30px);
    margin-bottom: clamp(20px, 3.5vw, 30px);
    /* The JS will replace its content, so this mostly provides spacing and a hook */
}

.countdown-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap; /* Prevent wrapping of time units */
    gap: clamp(8px, 1.5vw, 15px); /* Gap between units and colons */
    background: #F5F3FF; /* Light purple background */
    padding: clamp(15px, 3vw, 25px) clamp(20px, 4vw, 30px);
    border-radius: 18px;
    border: 2px solid #C4B5FD;
    box-shadow: 6px 6px 0px #DDD6FE;
    font-family: 'Fredoka', 'Nunito', sans-serif;
    width: fit-content; /* Adjust to content size */
    margin-left: auto;
    margin-right: auto; /* Center the container */
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    padding: clamp(10px, 2vw, 15px) clamp(12px, 2.5vw, 20px);
    border-radius: 12px;
    border: 2px solid #A78BFA;
    box-shadow: 4px 4px 0px #C4B5FD;
    min-width: clamp(60px, 12vw, 80px); /* Ensure units have some width */
    text-align: center;
}

.time-number {
    font-size: clamp(1.8rem, 5vw, 2.8rem); /* Large numbers */
    color: #8B5CF6; /* Vibrant Purple */
    font-weight: 700;
    line-height: 1.1;
}

.time-label {
    font-size: clamp(0.7rem, 2vw, 0.9rem); /* Smaller labels */
    color: #7C3AED; /* Deep Purple */
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 5px;
}

.colon {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    color: #8B5CF6; /* Vibrant Purple */
    font-weight: 700;
    /* Align with numbers by adjusting padding or line-height if needed */
    /* For simplicity, ensuring it's vertically centered with flex items */
    display: flex;
    align-items: center; /* Helps vertical alignment with time-units */
    padding-bottom: clamp(10px, 2vw, 15px); /* Approximate alignment with time-label bottom */
}

.butterfly5 {
    filter: hue-rotate(180deg) drop-shadow(0 2px 8px rgba(147, 51, 234, 0.3));
}
.butterfly6 {
    filter: hue-rotate(225deg) drop-shadow(0 2px 8px rgba(236, 72, 153, 0.3));
}
.butterfly7 {
    filter: hue-rotate(270deg) drop-shadow(0 2px 8px rgba(14, 165, 233, 0.3));
}
.butterfly8 {
    filter: hue-rotate(315deg) drop-shadow(0 2px 8px rgba(168, 85, 247, 0.3));
}
.butterfly9 {
    filter: hue-rotate(60deg) saturate(1.2) drop-shadow(0 2px 8px rgba(132, 204, 22, 0.3));
}
.butterfly10 {
    filter: hue-rotate(300deg) saturate(1.1) drop-shadow(0 2px 8px rgba(239, 68, 68, 0.3));
}

/* Added for new butterflies */
.butterfly11 {
    filter: hue-rotate(15deg) saturate(1.3) drop-shadow(0 2px 8px rgba(251, 146, 60, 0.3)); /* Orange-ish */
}
.butterfly12 {
    filter: hue-rotate(105deg) saturate(1.1) drop-shadow(0 2px 8px rgba(22, 163, 74, 0.3)); /* Darker Green */
}
.butterfly13 {
    filter: hue-rotate(255deg) saturate(1.2) drop-shadow(0 2px 8px rgba(99, 102, 241, 0.3)); /* Indigo-ish */
}


.flower {
    position: absolute;
    width: 40px;
    height: 40px;
    pointer-events: none;
    z-index: 1;
}

.flower1 { left: 5%; bottom: 5%; animation: sway 15s infinite; }
.flower2 { left: 15%; bottom: 3%; animation: sway 12s infinite 2s; }
.flower3 { right: 10%; bottom: 4%; animation: sway 18s infinite 3s; }
.flower4 { right: 20%; bottom: 6%; animation: sway 14s infinite 1s; }
.flower5 { left: 30%; bottom: 2%; animation: sway 16s infinite 4s; }
.flower6 { right: 35%; bottom: 5%; animation: sway 13s infinite 2s; }
.flower7 { left: 80%; bottom: 7%; animation: sway 17s infinite 3s; }
.flower8 { right: 48%; bottom: 4%; animation: sway 19s infinite 5s; }

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(120px, 30vw, 280px), 1fr));
    gap: clamp(10px, 2vw, 20px);
    padding: clamp(15px, 3vw, 25px);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-medium);
    width: 100%; /* Ensure gallery takes full available width within its padding */
    box-sizing: border-box; /* Ensure padding is included in width calculation */
}

/* Desktop gallery: 4 images per row on large screens */
@media screen and (min-width: 1200px) {
    .gallery {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: clamp(15px, 2vw, 25px) !important;
        max-width: 1100px !important;
        margin: 0 auto !important;
        padding: clamp(20px, 3vw, 30px) !important;
    }
    
    /* Make gallery title better sized for desktop */
    .gallery-title {
        font-size: 2.8rem !important;
        padding: 22px 32px !important;
        margin-bottom: 35px !important;
    }
}

/* Medium Desktop gallery: 3 images per row */
@media screen and (min-width: 769px) and (max-width: 1199px) {
    .gallery {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: clamp(12px, 2vw, 20px) !important;
        padding: clamp(18px, 3vw, 28px) !important;
    }
}

/* Mobile gallery: exactly 2 images per row */
@media screen and (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: clamp(8px, 2vw, 15px) !important;
    }
}

.gallery-title {
    grid-column: 1 / -1;
    text-align: center;
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: clamp(1.9rem, 5.5vw, 2.6rem);
    color: #8B5CF6; /* Vibrant Purple */
    margin-bottom: clamp(25px, 4.5vw, 35px);
    background: #F5F3FF; /* Light purple background */
    padding: clamp(18px, 4.2vw, 26px) clamp(26px, 5.2vw, 34px);
    border-radius: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    box-shadow: 6px 6px 0px #C4B5FD; /* Flat 2D shadow */
    border: 2px solid #A78BFA;
    text-shadow: 2px 2px 0px #E9D5FF;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(-0.5deg);
}

.gallery-title:hover {
    transform: translateY(-2px) rotate(0deg) scale(1.01);
    box-shadow: 8px 8px 0px #A78BFA;
}

.gallery-photo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(225, 29, 72, 0.1), rgba(59, 130, 246, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-photo:hover::before {
    opacity: 1;
}

.gallery-photo:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.2),
        0 8px 20px rgba(225, 29, 72, 0.15);
    border-color: #F43F5E;
}

/* Gallery button styling */
.gallery-item {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
    position: relative;
    display: block;
    width: 100%;
}

.gallery-item::before {
    content: '';
    display: block;
    padding-bottom: 83.83%; /* 470x394 Aspect Ratio (394/470 = 0.8383) */
}

.gallery-item:focus {
    outline: 3px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

.gallery-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.2),
        0 8px 20px rgba(225, 29, 72, 0.15);
}

.gallery-item .gallery-photo {
    border: 4px solid white; /* Thicker border for pop */
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px; /* Consistent rounded corners */
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 5px 5px 0px #DDD6FE; /* Flat 2D shadow */
    background: #F5F3FF; /* Light placeholder color */
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    will-change: transform, box-shadow;
}

.gallery-item:hover .gallery-photo {
    border-color: #A78BFA; /* Purple border on hover */
    transform: translateY(-3px) scale(1.03);
    box-shadow: 7px 7px 0px #C4B5FD;
}

.placeholder {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.8rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.placeholder:hover {
    transform: scale(1.05);
    background-color: rgba(255, 255, 255, 0.8);
}

.location-map {
    width: 100%;
    height: clamp(300px, 58vw, 420px); /* Slightly taller */
    margin-top: clamp(55px, 8.5vw, 75px);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 8px 8px 0px #D8B4FE; /* Flat 2D shadow */
    border: 4px solid white; /* Thicker white border */
    position: relative;
    background: #F5F3FF; /* Light purple background for map placeholder */
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Desktop map enhancements */
@media screen and (min-width: 1200px) {
    .location-map {
        height: 500px !important; /* Fixed height for desktop */
        max-width: 1000px !important; /* Control width */
        margin: 75px auto 0 !important; /* Center and proper spacing */
        border-width: 6px !important; /* Thicker border */
        box-shadow: 10px 10px 0px #D8B4FE !important; /* Stronger shadow */
    }
    
    .map-address-text {
        max-width: 80% !important; /* Wider on desktop */
        font-size: 1.3rem !important; /* Larger font */
        padding: 15px 20px !important; /* More padding */
        margin-top: 20px !important; /* More spacing */
    }
}

.location-map:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 10px 10px 0px #C4B5FD;
}

.location-map iframe {
    border-radius: 18px; /* Match outer radius minus border */
    width: 100%;
    height: 100%;
}

.map-address-text {
    text-align: center;
    margin-top: 15px; /* Increased margin to ensure it's clearly below the map */
    margin-bottom: 10px; /* Space below the text */
    padding: 10px;
    background-color: #F5F3FF; /* Light purple background, similar to other sections */
    color: #6D28D9; /* Darker Purple, consistent with venue text */
    border-radius: 12px;
    font-size: clamp(0.9rem, 2.2vw, 1.1rem);
    font-weight: 600; /* Bolder for visibility */
    border: 2px solid #C4B5FD; /* Border consistent with other styled boxes */
    box-shadow: 4px 4px 0px #DDD6FE; /* Subtle shadow */
    /* Removed position: absolute, bottom, left, right, z-index */
    /* Ensure it's treated as a block element taking appropriate width */
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 90%; /* Prevent it from being too wide on larger screens */
    box-sizing: border-box;
}

/* Dress Code Section - Enhanced Styling */
.dress-code-container {
    background: white;
    padding: clamp(28px, 6.5vw, 45px);
    border-radius: 22px;
    box-shadow: 8px 8px 0px #D8B4FE; /* Flat 2D shadow */
    margin: clamp(45px, 8.5vw, 65px) auto clamp(35px, 6.5vw, 45px);
    width: 100%;
    max-width: 850px;
    text-align: center;
    overflow: visible; /* Allow shadows to be seen */
    position: relative;
    border: 3px solid #A78BFA;
    transform: rotate(0.5deg); /* Restored playful tilt */
}

/* Desktop dress code enhancements */
@media screen and (min-width: 1200px) {
    .dress-code-container {
        max-width: 1000px !important;
        padding: 50px !important;
        margin: 70px auto 50px !important;
    }
    
    .section-title {
        font-size: 2.6rem !important;
        padding: 22px 36px !important;
    }
    
    .dress-code-content {
        gap: 30px !important;
    }
    
    .dress-code-item {
        padding: 30px !important;
    }
    
    .dress-code-item h4 {
        font-size: 2rem !important;
        margin-bottom: 24px !important;
        padding: 12px 22px !important;
    }
    
    .dress-image-container {
        height: 280px !important;
    }
    
    .dress-code-item p {
        font-size: 1.3rem !important;
        margin-top: 15px !important;
        padding: 6px 12px !important;
    }
}

.dress-code-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/butterflies/butterfly.png');
    background-size: clamp(40px, 10vw, 80px) auto;
    background-repeat: no-repeat;
    background-position: bottom 10px right 10px;
    opacity: 0.1;
    pointer-events: none;
}

.section-title { /* Used for Dress Code Title */
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: clamp(1.7rem, 5.2vw, 2.4rem);
    color: #8B5CF6; /* Vibrant Purple */
    margin-bottom: clamp(25px, 5.5vw, 35px);
    text-shadow: 2px 2px 0px #E9D5FF;
    background: #F5F3FF; /* Light purple background */
    padding: clamp(14px, 3.2vw, 20px) clamp(22px, 5.2vw, 34px);
    border-radius: 18px;
    display: inline-block;
    border: 2px solid #C4B5FD;
    position: relative;
    font-weight: 700;
    letter-spacing: -0.02em;
    box-shadow: 6px 6px 0px #DDD6FE; /* Flat 2D shadow */
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(-1deg);
}

.section-title:hover {
    transform: translateY(-2px) rotate(0deg) scale(1.02);
    box-shadow: 8px 8px 0px #C4B5FD;
}

.dress-code-content {
    display: flex; /* Enables flexbox for side-by-side layout */
    flex-direction: row; /* Aligns items in a row */
    justify-content: space-around; /* Distributes space around items */
    align-items: stretch; /* Changed from flex-start to stretch */
    gap: clamp(8px, 2vw, 15px);
}

.dress-code-item {
    /* flex: 1; Removed as flex-basis is used */
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 45%; /* Each item takes up roughly half the width, allowing for gap */
    min-width: 0; /* Override previous min-width if it causes issues */
    max-width: 48%; /* Ensure they fit side by side with gap */
    background: #F5F3FF; /* Light purple */
    padding: clamp(18px, 4.2vw, 26px);
    border-radius: 18px;
    box-shadow: 6px 6px 0px #DDD6FE; /* Flat 2D shadow */
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid #C4B5FD;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.dress-code-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 8px 8px 0px #C4B5FD;
    border-color: #A78BFA;
}

.dress-code-item h4 {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: clamp(1.3rem, 3.7vw, 1.7rem);
    color: #7C3AED; /* Deep Purple */
    margin-bottom: clamp(14px, 3.2vw, 20px);
    font-weight: 700;
    text-shadow: 1px 1px 0px #E9D5FF;
    background: white;
    padding: clamp(8px, 1.8vw, 10px) clamp(14px, 3.2vw, 20px);
    border-radius: 15px;
    display: inline-block;
    border: 2px solid #DDD6FE;
    letter-spacing: -0.01em;
    box-shadow: 3px 3px 0px #E9D5FF;
}

.dress-image-container {
    width: 100%;
    height: clamp(150px, 35vw, 250px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: clamp(10px, 2.5vw, 15px);
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 5px;
}

.dress-code-item img {
    max-width: 100%;
    height: auto;
    max-height: 90%;
    object-fit: contain;
    border-radius: 10px;
    border: 2px solid #E6E6FA;
    box-shadow: 0 3px 6px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: rgba(255, 255, 255, 0.6);
    padding: 3px;
}

.dress-code-item img:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 8px rgba(138, 43, 226, 0.2);
}

.dress-code-item p {
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    color: #8A2BE2;
    line-height: 1.4;
    font-weight: bold;
    margin-top: clamp(5px, 1.5vw, 10px);
    padding: clamp(3px, 1vw, 5px) clamp(6px, 1.5vw, 10px);
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    display: inline-block;
}

.theme-text {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: clamp(1.5rem, 4.2vw, 2.1rem);
    color: #8B5CF6; /* Vibrant Purple */
    margin-top: clamp(25px, 5.5vw, 35px);
    background: white;
    padding: clamp(14px, 3.2vw, 20px) clamp(18px, 4.2vw, 26px);
    border-radius: 18px;
    display: inline-block;
    position: relative;
    box-shadow: 6px 6px 0px #D8B4FE; /* Flat 2D shadow */
    border: 2px solid #A78BFA;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-shadow: 2px 2px 0px #E9D5FF;
    transform: rotate(1deg);
}

.theme-text span {
    font-weight: 700;
    color: #EC4899; /* Playful Pink */
    font-style: normal;
    text-shadow: 2px 2px 0px #FBCFE8; /* 2D shadow for span */
    position: relative;
    display: inline-block;
    animation: gentleFlutter 3.5s infinite ease-in-out; /* Slightly adjusted animation */
}

@keyframes gentleFlutter {
    0%, 100% {
        transform: translateY(0) scale(1);
        text-shadow: 0 2px 6px rgba(255, 105, 180, 0.3);
    }
    50% {
        transform: translateY(-2px) scale(1.02);
        text-shadow: 0 4px 12px rgba(255, 105, 180, 0.5);
    }
}

@keyframes butterflyFlutter {
    0% { transform: rotate(-5deg) scale(1); }
    100% { transform: rotate(5deg) scale(1.1); }
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes floatDress {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(180deg); }
}



@keyframes flutter {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Essential Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
    }
    25% {
        transform: translateY(-10px) translateX(5px);
    }
    50% {
        transform: translateY(-5px) translateX(-5px);
    }
    75% {
        transform: translateY(-15px) translateX(3px);
    }
}

@keyframes sway {
    0%, 100% {
        transform: rotate(-3deg);
    }
    50% {
        transform: rotate(3deg);
    }
}

/* Butterfly base positioning and animation - JavaScript controlled */
.butterfly {
    position: fixed;
    width: clamp(50px, 9vw, 85px); /* Increased from 35px-60px to 50px-85px */
    height: auto;
    pointer-events: none;
    z-index: 0;
    opacity: 0; /* Start hidden, JavaScript will make them visible */
    transition: all 0.3s ease;
}

/* Cloud animations */
.cloud1 { top: 10%; left: -10%; width: 80px; height: 50px; animation: float 30s infinite linear; }
.cloud2 { top: 20%; left: -15%; width: 120px; height: 70px; animation: float 40s infinite linear 10s; }
.cloud3 { top: 60%; left: -12%; width: 100px; height: 60px; animation: float 35s infinite linear 20s; }
.cloud4 { top: 80%; left: -8%; width: 90px; height: 55px; animation: float 45s infinite linear 30s; }

.footer {
    background: linear-gradient(135deg, #F3E8FF, #E9D5FF); /* Lighter purple gradient */
    color: #581C87; /* Darker purple text for contrast */
    text-align: center;
    padding: clamp(25px, 5vw, 40px) clamp(15px, 4vw, 30px);
    margin-top: auto; /* Push footer to bottom */
    border-top: 4px solid #D8B4FE; /* Accent border */
    width: 100%; /* Ensure footer spans full width */
    box-sizing: border-box; /* Include padding in width */
    position: relative; /* For z-index stacking if needed, and pseudo-elements */
    z-index: 2; /* Ensure footer is above general body content/butterflies if they are on z-index 0 or 1 */
    overflow: hidden; /* Prevent any internal overflow */
}

.footer p {
    margin-bottom: clamp(10px, 2vw, 15px);
    font-size: clamp(0.9rem, 2.2vw, 1.1rem);
    line-height: 1.6;
}

.footer p:last-child {
    margin-bottom: 0;
}

.footer-butterflies {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: clamp(15px, 3vw, 20px);
    opacity: 0.7;
}

.footer-butterfly {
    width: clamp(30px, 6vw, 45px);
    height: auto;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.1));
}

/* Ensure the main container content is above the fixed butterflies */

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Extra Large Desktop (1600px and above) - Ultimate desktop experience */
@media screen and (min-width: 1600px) {
    .container {
        max-width: 1400px !important; /* Very wide container */
        padding: 50px 60px !important;
    }
    
    .details {
        max-width: 900px !important; /* Very wide details section */
        padding: 55px 65px !important;
    }
    
    .date-time-wrapper {
        max-width: 750px !important;
        margin-bottom: 35px !important;
        gap: 25px !important;
    }
    
    .styled-box {
        min-width: 330px !important;
        max-width: 340px !important;
        font-size: 1.9rem !important;
        padding: 20px 28px !important;
    }
    
    .date-box {
        font-size: 2rem !important;
    }
    
    .countdown-container {
        padding: 30px 40px !important;
        gap: 22px !important;
        max-width: 750px !important;
    }
    
    .time-unit {
        min-width: 110px !important;
        padding: 20px 25px !important;
    }
    
    .time-number {
        font-size: 3.4rem !important;
    }
    
    .time-label {
        font-size: 1rem !important;
        margin-top: 8px !important;
    }
    
    .colon {
        font-size: 3rem !important;
        padding-bottom: 20px !important;
    }
    
    .photo-container {
        width: 400px !important;
        height: 400px !important;
        margin: 50px auto !important;
        border-width: 10px !important;
    }
}

/* Large Desktop (1200px and above) - Fix responsive sizing for PC web */
@media screen and (min-width: 1200px) and (max-width: 1599px) {
    /* Container sizing for large screens */
    .container {
        max-width: 1200px !important; /* Increased for wider layouts on large screens */
        padding: 40px 50px !important; /* Fixed padding for larger screens */
    }
    
    /* Details section for desktop */
    .details {
        max-width: 800px !important; /* Wider for desktop */
        padding: 45px 55px !important; /* More generous padding */
        margin-top: 50px !important;
    }
    
    /* Better alignment of date-time wrapper */
    .date-time-wrapper {
        flex-direction: row !important; /* Side by side on desktop */
        justify-content: space-between !important;
        max-width: 650px !important; /* Wider container */
        gap: 20px !important;
    }
    
    .styled-box {
        min-width: 300px !important; /* Fixed larger size for desktop */
        max-width: 310px !important; /* Equal width boxes */
        font-size: 1.7rem !important; /* Larger fixed font size */
        padding: 16px 24px !important; /* Fixed padding */
        width: calc(50% - 10px) !important; /* Equal widths with gap consideration */
    }
    
    .date-box {
        font-size: 1.8rem !important; /* Fixed size for desktop */
    }
    
    .time-box {
        font-size: 1.7rem !important; /* Fixed size for desktop */
    }
    
    /* Photo container for desktop */
    .photo-container {
        width: 350px !important; /* Fixed larger size on desktop */
        height: 350px !important;
        margin: 40px auto !important;
    }
    
    /* Countdown improvements */
    .countdown-container {
        padding: 25px 35px !important; /* More generous padding */
        gap: 18px !important; /* Wider gap */
        max-width: 650px !important; /* Control maximum width */
    }
    
    .time-unit {
        min-width: 95px !important; /* Wider time units */
        padding: 16px 20px !important; /* More generous padding */
    }
    
    .time-number {
        font-size: 3rem !important; /* Larger numbers for desktop */
    }
    
    .time-label {
        font-size: 0.9rem !important; /* Slightly larger labels */
    }
      .colon {
        font-size: 2.6rem !important; /* Larger colon size */
    }
}

/* Medium Desktop (769px to 1199px) - Responsive but with better minimums */
@media screen and (min-width: 769px) and (max-width: 1199px) {
    /* Container tweaks for medium screens */
    .container {
        max-width: 1000px !important; /* More appropriate for medium desktop */
        padding: 30px 40px !important;
    }
    
    /* Details section improvements */
    .details {
        max-width: 750px !important; /* Wider than mobile but not as wide as large desktop */
        padding: clamp(35px, 5vw, 50px) !important;
    }

    /* Enable row layout for date-time-wrapper */
    .date-time-wrapper {
        flex-direction: row !important; /* Side by side on desktop */
        justify-content: space-between !important;
        max-width: 600px !important;
        gap: 16px !important;
    }
    
    .styled-box {
        min-width: 260px !important; /* Better desktop range */
        max-width: 280px !important; /* More constrained for equal sizing */
        width: calc(50% - 8px) !important; /* Equal width with gap consideration */
        font-size: clamp(1.5rem, 2.2vw, 1.8rem) !important; /* Better scaling */
        padding: clamp(14px, 1.8vw, 20px) clamp(20px, 2.5vw, 28px) !important;
    }
    
    .date-box {
        font-size: clamp(1.6rem, 2.3vw, 1.9rem) !important; /* Enhanced font size */
    }
    
    .time-box {
        font-size: clamp(1.5rem, 2.2vw, 1.8rem) !important; /* Enhanced font size */
    }
    
    /* Photo container for medium desktop */
    .photo-container {
        width: clamp(250px, 40vw, 320px) !important;
        height: clamp(250px, 40vw, 320px) !important;
        margin: 35px auto !important;
    }
    
    .countdown-container {
        padding: clamp(20px, 2.5vw, 28px) clamp(26px, 3.2vw, 35px) !important;
        gap: clamp(12px, 1.5vw, 18px) !important;
        max-width: 600px !important;
    }
    
    .time-unit {
        min-width: clamp(75px, 8vw, 90px) !important;
        padding: clamp(14px, 1.8vw, 18px) clamp(16px, 2.2vw, 24px) !important;
    }
    
    .time-number {
        font-size: clamp(2.4rem, 3.5vw, 2.8rem) !important;
    }
    
    .time-label {
        font-size: clamp(0.8rem, 1.2vw, 0.95rem) !important;
    }
    
    .colon {
        font-size: clamp(2.2rem, 3.2vw, 2.6rem) !important; /* Better colon sizing */
        padding-bottom: 14px !important; /* Better vertical alignment */
    }
}

/* Tablet and small desktop (768px and below) */
@media screen and (max-width: 768px) {
    .button-group {
        flex-wrap: nowrap !important; /* NEVER allow wrapping - maintain PC layout */
        gap: clamp(8px, 2vw, 12px); /* Reduce gap slightly for mobile */
    }
      .button-group .btn {
        font-size: clamp(0.8rem, 2.2vw, 1rem); /* Slightly smaller text to fit */
        padding: clamp(12px, 2.8vw, 16px) clamp(20px, 5vw, 30px); /* Smaller padding */
        min-width: clamp(110px, 28vw, 140px); /* Adjust minimum width for mobile */
    }

    .photo-container {
        width: clamp(180px, 45vw, 280px);
        height: clamp(180px, 45vw, 280px);
    }
}

/* Large mobile phones (480px and below) */
@media screen and (max-width: 480px) {
    .container {
        padding: clamp(16px, 3.5vw, 28px) !important; /* Better balanced container padding */
    }
      .title {
        padding: clamp(22px, 4.5vw, 32px) clamp(28px, 5.5vw, 40px) !important; /* Improved title padding */
        box-shadow: 6px 6px 0px #C4B5FD !important; /* Reduced shadow to prevent overflow */
        margin: 0 10px clamp(22px, 3.8vw, 30px) 10px !important; /* Side margins to contain shadows */
        font-size: clamp(1.8rem, 8vw, 2.5rem) !important;
        word-break: break-word !important;
        hyphens: auto !important;
    }

    .subtitle {
        margin-bottom: clamp(16px, 2.8vw, 22px) !important;
    }

    .subtitle.special-subtitle {
        padding: clamp(16px, 3.2vw, 22px) clamp(25px, 5vw, 35px) !important; /* Better special subtitle padding */
        box-shadow: 4px 4px 0px #F9A8D4 !important; /* Reduced shadow */
        margin: 0 8px clamp(16px, 2.8vw, 22px) 8px !important; /* Side margins */
    }
      .details {
        padding: clamp(28px, 5.5vw, 42px) !important; /* Improved details section padding */
        box-shadow: 6px 6px 0px #D8B4FE !important; /* Reduced shadow */
        margin: clamp(28px, 4.5vw, 42px) 8px !important; /* Side margins to contain shadows */
    }

    .header {
        margin-bottom: clamp(42px, 7vw, 65px) !important; /* Better header spacing */
    }

    .photo-container {
        margin: clamp(25px, 4.5vw, 35px) auto !important; /* Improved photo container spacing */
    }

    .dress-code-container {
        box-shadow: 6px 6px 0px #D8B4FE !important; /* Reduced shadow */
        margin: clamp(25px, 4vw, 38px) 8px !important; /* Side margins */
    }

    .gallery {
        margin: 0 5px !important; /* Ensure gallery doesn't touch edges */
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .location-map {
        box-shadow: 6px 6px 0px #D8B4FE !important; /* Reduced shadow */
        margin: clamp(55px, 8.5vw, 75px) 8px 0 8px !important; /* Side margins */
    }

    /* Fix button shadows */
    .btn {
        box-shadow: 3px 3px 0px #7C3AED !important; /* Reduced button shadow */
    }

    .btn:hover {
        box-shadow: 5px 5px 0px #6D28D9, 0 0 10px #A78BFA !important; /* Reduced hover shadow */
    }

    /* Ensure butterflies don't cause overflow */
    body .butterfly {
        max-width: 100% !important;
    }

    /* Footer adjustments */
    body .footer {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Ensure photos don't overflow */
    body .gallery-item {
        max-width: 100% !important;
    }

    /* Fix any remaining horizontal scroll */
}

/* iPhone 12/13/14 Pro specific optimization (390x844) */
@media screen and (width: 390px), screen and (max-width: 390px) and (min-width: 375px) {
    .container {
        padding: clamp(15px, 3.3vw, 24px) !important;
        max-width: 374px !important; /* Leave 8px on each side for 390px screen */
    }

    .title {
        font-size: clamp(1.95rem, 5.3vw, 2.9rem) !important;
        padding: clamp(21px, 4.3vw, 29px) clamp(27px, 5.3vw, 37px) !important;
        margin: 0 12px clamp(21px, 3.6vw, 29px) 12px !important;
    }

    .subtitle {
        font-size: clamp(1.35rem, 3.9vw, 2.1rem) !important;
        margin-bottom: clamp(16px, 2.7vw, 21px) !important;
    }

    .subtitle.special-subtitle {
        font-size: clamp(1.55rem, 4.3vw, 2.4rem) !important;
        padding: clamp(16px, 3.1vw, 21px) clamp(25px, 4.9vw, 33px) !important;
        margin: 0 11px clamp(16px, 2.7vw, 21px) 11px !important;
    }

    .details {
        padding: clamp(27px, 5.3vw, 39px) !important;
        margin: clamp(27px, 4.3vw, 39px) 11px !important;
    }

    .photo-container {
        width: clamp(195px, 47vw, 265px) !important;
        height: clamp(195px, 47vw, 265px) !important;
        margin: clamp(23px, 4.3vw, 33px) auto !important;
    }

    .styled-box {
        font-size: clamp(1.08rem, 3.2vw, 1.45rem) !important;
        padding: clamp(12px, 2.4vw, 16px) clamp(16px, 3.4vw, 21px) !important;
        min-width: clamp(175px, 44vw, 245px) !important;
        max-width: clamp(245px, 83vw, 325px) !important;
    }

    .dress-code-container {
        padding: clamp(23px, 4.9vw, 36px) !important;
        margin: clamp(23px, 3.9vw, 36px) 11px !important;
    }

    .dress-code-item {
        padding: clamp(15px, 3.3vw, 21px) !important;
    }

    .countdown-container {
        padding: clamp(13px, 2.6vw, 19px) clamp(17px, 3.6vw, 23px) !important;
        gap: clamp(6px, 1.3vw, 10px) !important;
    }

    .time-unit {
        min-width: clamp(50px, 9.8vw, 64px) !important;
        padding: clamp(8px, 1.7vw, 12px) clamp(10px, 2.2vw, 15px) !important;
    }

    .time-number {
        font-size: clamp(1.35rem, 3.9vw, 1.95rem) !important;
    }

    .location-map {
        margin: clamp(52px, 8.2vw, 72px) 11px 0 11px !important;
    }
      body .gallery {
        margin: 0 6px !important;
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* iPhone SE and similar small screens (375px and below) */
@media screen and (max-width: 375px) {
    body .container {
        max-width: calc(100% - 12px) !important; /* Leave 6px on each side */
    }

    body .title,
    body .subtitle.special-subtitle,
    body .details,
    body .dress-code-container,
    body .location-map {
        margin-left: 6px !important;
        margin-right: 6px !important;
    }

    body .gallery {
        margin-left: 3px !important;
        margin-right: 3px !important;
    }
}

/* Large mobile screens (431px to 480px) - iPhone 14 Plus, etc. */
@media screen and (min-width: 431px) and (max-width: 480px) {
    body .container {
        max-width: calc(100% - 20px) !important; /* Leave 10px on each side */
    }

    body .title,
    body .subtitle.special-subtitle,
    body .details,
    body .dress-code-container,
    body .location-map {
        margin-left: 10px !important;
        margin-right: 10px !important;
    }

    body .gallery {
        margin-left: 6px !important;
        margin-right: 6px !important;
    }
}

/* Samsung Galaxy S20/S21 and similar (360x800) optimization */
@media screen and (max-width: 360px) and (min-height: 700px) {
    body .container {
        padding: clamp(12px, 3vw, 18px) !important;
        max-width: 344px !important; /* Leave 8px on each side for 360px screen */
    }

    body .title {
        font-size: clamp(1.8rem, 5vw, 2.6rem) !important;
        margin: 0 8px clamp(18px, 3vw, 24px) 8px !important;
    }

    body .styled-box {
    min-width: clamp(160px, 42vw, 220px) !important;
        max-width: clamp(220px, 80vw, 300px) !important;
    }
}

/* Modal Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* Modal responsive adjustments */
@media screen and (max-width: 768px) {
    .photo-modal {
        max-width: 96vw;
        max-height: 94vh;
        padding: 15px;
        margin: 2vh 2vw;
        border-radius: 12px;
        border-width: 2px;
    }

    .photo-modal img {
        max-height: calc(94vh - 60px);
        border-radius: 6px;
    }

    .close-modal {
        width: 44px;
        height: 44px;
        font-size: 22px;
        line-height: 40px;
        top: 8px;
        right: 8px;
        min-height: 44px; /* Better touch target */
        min-width: 44px;
    }
}

@media screen and (max-width: 480px) {
    .photo-modal {
        max-width: 98vw;
        max-height: 96vh;
        padding: 10px;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 1vh 1vw;
        border-radius: 10px;
    }

    .photo-modal img {
        max-height: calc(96vh - 50px);
        object-fit: contain;
        border-radius: 4px;
    }

    .close-modal {
        width: 48px;
        height: 48px;
        font-size: 20px;
        line-height: 44px;
        top: 5px;
        right: 5px;
        min-height: 48px; /* Larger touch target on mobile */
        min-width: 48px;
    }
}

/* Extra optimization for very small screens */
@media screen and (max-width: 360px) {
    .photo-modal {
        padding: 8px;
        max-width: 99vw;
        max-height: 98vh;
        border-radius: 8px;
        margin: 0.5vh 0.5vw;
    }

    .photo-modal img {
        max-height: calc(98vh - 40px);
        border-radius: 3px;
    }

    .close-modal {
        width: 50px;
        height: 50px;
        font-size: 18px;
        line-height: 46px;
        top: 3px;
        right: 3px;
        min-height: 50px; /* Even larger for very small screens */
        min-width: 50px;
    }
}

/* Ultra-small screens (280px and below) */
@media screen and (max-width: 280px) {
    .photo-modal {
        padding: 5px;
        max-width: 99.5vw;
        max-height: 99vh;
        border-radius: 6px;
        margin: 0.25vh 0.25vw;
        border-width: 1px;
    }

    .photo-modal img {
        max-height: calc(99vh - 35px);
    }

    .close-modal {
        width: 52px;
        height: 52px;
        font-size: 16px;
        line-height: 48px;
        top: 2px;
        right: 2px;
        min-height: 52px;
        min-width: 52px;
    }
}

/* ===== MODAL STYLES (CONSOLIDATED) ===== */
.photo-modal {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    padding: 20px;
    background: white;
    border-radius: 15px;
    border: 3px solid #A78BFA;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    overflow: hidden;
    box-sizing: border-box;
    margin: 0;
    min-width: 300px;
    min-height: 200px;
}

.photo-modal:not([open]) {
    display: none;
}

.photo-modal[open] {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: modalFadeIn 0.3s ease-out;
}

.photo-modal.closing {
    animation: modalFadeOut 0.2s ease-in;
}

.photo-modal::backdrop {
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.photo-modal img {
    max-width: 100%;
    max-height: calc(90vh - 80px);
    height: auto;
    width: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #8B5CF6;
    color: white;
    border: 2px solid white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1001;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.close-modal:hover {
    background: #7C3AED;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.close-modal:active {
    transform: scale(0.95);
}

.close-modal:focus {
    outline: 2px solid #F3E8FF;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Modal responsive adjustments */
@media screen and (max-width: 768px) {
    .photo-modal {
        max-width: 96vw;
        max-height: 94vh;
        padding: 15px;
        margin: 2vh 2vw;
        border-radius: 12px;
        border-width: 2px;
    }

    .photo-modal img {
        max-height: calc(94vh - 60px);
        border-radius: 6px;
    }

    .close-modal {
        width: 44px;
        height: 44px;
        font-size: 22px;
        line-height: 40px;
        top: 8px;
        right: 8px;
        min-height: 44px; /* Better touch target */
        min-width: 44px;
    }
}

@media screen and (max-width: 480px) {
    .photo-modal {
        max-width: 98vw;
        max-height: 96vh;
        padding: 10px;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 1vh 1vw;
        border-radius: 10px;
    }

    .photo-modal img {
        max-height: calc(96vh - 50px);
        object-fit: contain;
        border-radius: 4px;
    }

    .close-modal {
        width: 48px;
        height: 48px;
        font-size: 20px;
        line-height: 44px;
        top: 5px;
        right: 5px;
        min-height: 48px; /* Larger touch target on mobile */
        min-width: 48px;    }
}

/* Extra optimization for very small screens */
@media screen and (max-width: 360px) {
    .photo-modal {
        padding: 8px;
        max-width: 99vw;
        max-height: 98vh;
        border-radius: 8px;
        margin: 0.5vh 0.5vw;
    }

    .photo-modal img {
        max-height: calc(98vh - 40px);
        border-radius: 3px;
    }

    .close-modal {
        width: 50px;
        height: 50px;
        font-size: 18px;
        line-height: 46px;
        top: 3px;
        right: 3px;
        min-height: 50px;
        min-width: 50px;
    }
}

/* Ultra-small screens (280px and below) */
@media screen and (max-width: 280px) {
    .photo-modal {
        padding: 5px;
        max-width: 99.5vw;
        max-height: 99vh;
        border-radius: 6px;
        margin: 0.25vh 0.25vw;
        border-width: 1px;
    }

    .photo-modal img {
        max-height: calc(99vh - 35px);
    }

    .close-modal {
        width: 52px;
        height: 52px;
        font-size: 16px;
        line-height: 48px;
        top: 2px;
        right: 2px;
        min-height: 52px;
        min-width: 52px;
    }
}
