:root {
    --emerald-green: #009B77;
    --gold: #daa520;
    --dark-gray: #333;
    --off-white: #FFFFFF; /* Pure white for the "page" */
    --page-bg: #f0f0f0; /* Light gray for the body background */
    --white: #ffffff;
    --font-title: 'Montserrat', sans-serif;
    --font-body: 'Lora', serif;
}

body {
    font-family: var(--font-body);
    color: var(--dark-gray);
    background-color: var(--page-bg);
    margin: 0;
    padding: 0;
    line-height: 1.8;
    overflow-x: hidden;
}

/* Prevent horizontal overflow on all elements */
*, *::before, *::after {
    box-sizing: border-box;
    max-width: 100%;
}

h1, h2, h3 {
    font-family: var(--font-title);
    color: var(--emerald-green);
    text-align: center;
    font-weight: 700;
}

h2 {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.title-decoration {
    display: block;
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

/* Full-width sections with background images */
body > section {
    width: 100%;
    margin: 0;
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

/* Container for content within sections */
.section-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 3rem;
    position: relative;
    z-index: 2;
}

/* Section background overlays */
.section-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Alternating section backgrounds */
.section-light {
    background-color: var(--off-white);
}

.section-emerald {
    background: linear-gradient(135deg, rgba(0, 155, 119, 0.05), rgba(0, 155, 119, 0.1));
}

.section-with-bg {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--white);
}

.section-with-bg .section-overlay {
    background: linear-gradient(135deg, rgba(0, 155, 119, 0.8), rgba(0, 155, 119, 0.6));
}

.section-with-bg h2,
.section-with-bg h3 {
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.cta-button {
    display: inline-block;
    background-color: var(--emerald-green);
    color: var(--white);
    padding: 15px 35px;
    border-radius: 30px;
    text-decoration: none;
    font-family: var(--font-title);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.cta-button:hover {
    background-color: #007d62;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Allow button tag to inherit cta-button styles */
button.cta-button {
    border: none;
    cursor: pointer;
}

/* Hero Section (Full-width) */
.hero-section {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('../images/couple/Imagen de WhatsApp 2025-08-26 a las 13.03.18_8a12b51e.jpg');
    background-size: cover;
    background-position: center;
    height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
    margin-bottom: 0; /* Removed white space between hero and countdown section */
}

.hero-text h1 {
    font-size: 6rem;
    color: var(--white);
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}

.hero-text p {
    font-size: 1.8rem;
    font-family: var(--font-title);
}

/* Countdown Section */
#timer {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-family: var(--font-title);
}

#timer > div {
    text-align: center;
    position: relative;
}

.countdown-circle {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--white), #f8f8f8);
    border: 4px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2.25rem;
    font-weight: bold;
    color: var(--emerald-green);
    box-shadow: 0 8px 25px rgba(218, 165, 32, 0.3);
    position: relative;
    overflow: hidden;
}

.countdown-circle::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--gold), var(--emerald-green), var(--gold));
    border-radius: 50%;
    z-index: -1;
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.countdown-label {
    display: block;
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--dark-gray);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* General Card Style */
.card {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 155, 119, 0.1);
    text-align: center;
    transition: all 0.4s ease;
    border: 1px solid rgba(218, 165, 32, 0.2);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--emerald-green));
}

.card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 155, 119, 0.2);
    border-color: rgba(218, 165, 32, 0.4);
}

.card h3 {
    color: var(--emerald-green);
    margin-bottom: 1rem;
    position: relative;
}

.card h3::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: var(--gold);
}

/* Our Story Section */
.our-story-section .story-content {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-top: 2rem;
}

.our-story-section .story-image {
    flex: 0 0 300px; /* Fixed width for the image container */
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 4px solid var(--white);
}

.our-story-section .story-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.our-story-section .story-image:hover img {
    transform: scale(1.05);
}

.our-story-section .story-text {
    flex: 1;
    text-align: left;
    font-size: 1.1rem;
}
/* Locations Section */
.locations-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.location-card {
    width: 320px;
    max-width: 100%; /* Prevent overflow */
}

.location-time {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 1rem;
}

.map-container {
    width: 100%;
    height: 250px;
    margin: 1.5rem 0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(218, 165, 32, 0.3);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 13px;
}

.location-address {
    font-size: 0.95rem;
    color: var(--dark-gray);
    margin: 1rem 0;
    line-height: 1.6;
}

.map-link {
    display: inline-block;
    color: var(--emerald-green);
    text-decoration: none;
    font-weight: bold;
    font-family: var(--font-title);
    padding: 8px 16px;
    border: 2px solid var(--emerald-green);
    border-radius: 25px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.map-link:hover {
    background-color: var(--emerald-green);
    color: var(--white);
    transform: translateY(-2px);
}

/* Gifts Section */
.gifts-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.gift-option {
    width: 380px;
    max-width: 100%; /* Prevent overflow */
}

/* Dress Code Section */
.dresscode-section {
    text-align: center;
}

/* Itinerary Section */
.timeline {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: min(600px, calc(100vw - 2rem)); /* Responsive max-width */
    position: relative;
}

.timeline:before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 15px;
    width: 3px;
    background-color: var(--emerald-green);
}

.timeline li {
    padding: 1rem 0 1rem 60px;
    position: relative;
}

.timeline li:after {
    content: '';
    position: absolute;
    left: 0;
    top: 28px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--gold);
    border: 4px solid var(--off-white);
    box-shadow: 0 0 10px rgba(218, 165, 32, 0.5);
}

.timeline h4 {
    color: var(--dark-gray);
    text-align: left;
}

.timeline p {
    text-align: left;
}

/* RSVP Section */
.rsvp-section {
    text-align: center;
}

.rsvp-form-container {
    margin-top: 2rem;
    width: 100%; /* Will be constrained by modal */
    height: 80vh; /* Take 80% of the viewport height */
    max-height: 878px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0,0,0,0.05);
}
.rsvp-form-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    background-color: var(--off-white);
    padding: 1rem;
    border-radius: 15px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2.5rem;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
}
/* Gallery Section - Filmstrip Style */
.photo-grid {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1rem;
    margin-bottom: 3rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
}

.photo-grid::-webkit-scrollbar {
    height: 8px;
}

.photo-grid::-webkit-scrollbar-track {
    background: #efefef;
    border-radius: 4px;
}

.photo-grid::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.photo-grid::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.photo-grid img {
    height: 350px; /* Fixed height for all images */
    width: auto; /* Width adjusts to maintain aspect ratio */
    margin-right: 1rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0; /* Prevents images from shrinking */
    scroll-snap-align: start; /* Snaps to the start of each image */
}

.photo-grid img:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.collaborative-gallery {
    text-align: center;
}

/* Footer (Full-width) */
footer {
    background-color: var(--emerald-green);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
}

.footer-hearts {
    font-size: 1.5rem;
    color: var(--gold);
    margin-top: 1rem;
    letter-spacing: 0.5rem;
}

/* Animation Classes */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1200px) {
    .section-container {
        padding: 0 2rem;
    }
}
@media (max-width: 992px) {
    .our-story-section .story-content {
        flex-direction: column;
        gap: 2rem;
    }
    .our-story-section .story-text {
        text-align: center;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 3.5rem; }
    h2 { font-size: 2.2rem; }
    
    body > section {
        padding: 4rem 0;
    }
    
    .section-container {
        padding: 0 1.5rem;
    }
    
    /* Countdown responsive */
    #timer {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .countdown-circle {
        width: 81px;
        height: 81px;
        font-size: 1.62rem;
    }
    
    .countdown-label {
        font-size: 0.9rem;
    }
    
    /* Cards responsive */
    .locations-container, 
    .gifts-container { 
        flex-direction: column; 
        align-items: center; 
    }
    
    .location-card,
    .gift-option {
        width: 100%;
        max-width: 350px;
    }
    
    .card {
        padding: 2rem;
    }
    
    /* Map responsive */
    .map-container {
        height: 200px;
        margin: 1rem 0;
    }
    
    .location-time {
        font-size: 1.1rem;
    }
    
    .map-link {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    
    /* Timeline responsive */
    .timeline:before { left: 15px; }
    .timeline li { padding-left: 60px; }
    .timeline li:after { left: 0; }
    
    /* Gallery responsive */
    .photo-grid img {
        height: 280px;
    }
    
    /* Hero responsive */
    .hero-text h1 {
        font-size: 3rem;
    }
    
    .hero-text p {
        font-size: 1.4rem;
    }
    
    /* Background attachment fix for mobile */
    .section-with-bg {
        background-attachment: scroll;
    }
}

/* Large mobile devices (Galaxy S25 Ultra, iPhone 14 Pro Max, etc.) */
@media (min-width: 390px) and (max-width: 430px) {
    .section-container {
        padding: 0 1rem; /* Reduce lateral padding to prevent overflow */
    }
    
    .location-card,
    .gift-option {
        width: 100%;
        max-width: calc(100vw - 3rem); /* Ensure cards never exceed viewport */
        min-width: 280px;
    }
    
    .card {
        padding: 1.8rem; /* Reduce internal padding */
        margin: 0 0.5rem; /* Add small margin for breathing room */
    }
    
    /* Optimize countdown for large mobile */
    #timer {
        gap: 1.2rem;
    }
    
    .countdown-circle {
        width: 85px;
        height: 85px;
        font-size: 1.8rem;
    }
    
    /* Gallery optimization */
    .photo-grid {
        padding: 1rem 0.5rem; /* Reduce lateral padding */
    }
    
    .photo-grid img {
        height: 300px; /* Slightly smaller for better fit */
    }
    
    /* Map container adjustments */
    .map-container {
        margin: 1rem 0;
        border-radius: 12px;
    }
    
    /* Timeline adjustments */
    .timeline {
        max-width: calc(100vw - 4rem); /* Prevent timeline overflow */
    }
}

@media (max-width: 480px) {
    h2 { 
        font-size: 1.8rem; 
    }
    
    .title-decoration {
        font-size: 2rem;
    }
    
    #timer {
        gap: 0.8rem;
    }
    
    .countdown-circle {
        width: 72px;
        height: 72px;
        font-size: 1.35rem;
    }
    
    .countdown-label {
        font-size: 0.8rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .hero-text p {
        font-size: 1.2rem;
    }
    
    body > section {
        padding: 3rem 0;
    }
    
    /* Small mobile map adjustments */
    .map-container {
        height: 180px;
        border-radius: 12px;
    }
    
    .location-address {
        font-size: 0.9rem;
    }
}

@media (max-width: 680px) {
    .rsvp-form-container {
        height: 85vh; /* Adjust height for smaller screens */
    }
}

/* Music Toggle Button */
.music-toggle-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: auto;
    padding: 10px 15px;
    background-color: var(--emerald-green);
    color: var(--white);
    border: none;
    border-radius: 30px; /* Same as cta-button */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 999;
    transition: transform 0.3s ease, background-color 0.3s ease;
    line-height: 1; /* Ensure icon is centered vertically */
}

.music-toggle-button:hover {
    transform: scale(1.1);
    background-color: #007d62;
}
