/* ===== IMPORT GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@300;400;600;700&family=Open+Sans:wght@300;400;500;600&display=swap');

/* ===== CSS CUSTOM PROPERTIES (VARIABLES) ===== */
:root {
    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Open Sans', sans-serif;
    
    /* Beach Wedding Color Palette */
    --color-sand-light: #F4EBD0;
    --color-sand-medium: #EAD2AC;
    --color-coral: #FF6F61;
    --color-coral-dark: #E55A50;
    --color-text-primary: #2C3E50;
    --color-text-secondary: #5D6D7E;
    --color-white: #FFFFFF;
    --color-overlay: rgba(44, 62, 80, 0.3);
    
    /* Spacing and Layout */
    --section-padding-mobile: 3rem 1.5rem;
    --section-padding-desktop: 5rem 2rem;
    --container-max-width: 1200px;
    --border-radius: 8px;
    
    /* Animations */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===== GLOBAL RESET AND BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--color-sand-light) 0%, var(--color-white) 100%);
    color: var(--color-text-primary);
    line-height: 1.7;
    font-weight: 400;
    overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--color-coral);
    margin-bottom: 1.5rem;
    position: relative;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

p {
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
}

/* ===== CONTAINER AND LAYOUT ===== */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===== HEADER SECTION (PORTADA) ===== */
#portada {
    position: relative;
    background-image: url('../images/fondo-portada.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    overflow: hidden;
}

#portada::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-overlay);
    z-index: 1;
}

.contenido-portada {
    position: relative;
    z-index: 2;
    animation: fadeInUp 1.2s ease-out;
    padding: 2rem;
}

.contenido-portada h1 {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
    animation: fadeInScale 1.5s ease-out 0.3s both;
}

.contenido-portada p {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 300;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
    animation: fadeInUp 1.2s ease-out 0.6s both;
}

.contenido-portada h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    color: var(--color-sand-light);
    font-weight: 400;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1.2s ease-out 0.9s both;
}

/* ===== COUNTDOWN ===== */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    animation: fadeInUp 1.2s ease-out 1.2s both;
}

.countdown-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 1rem 0.5rem;
    min-width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.countdown-item span {
    display: block;
}

.countdown-item span:first-child {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--color-white);
    margin-bottom: 0.25rem;
}

.countdown-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-sand-medium);
}

@media (min-width: 576px) {
    .countdown-container {
        gap: 1.5rem;
    }
    .countdown-item {
        min-width: 90px;
        padding: 1.25rem 1rem;
    }
    .countdown-item span:first-child {
        font-size: 2.5rem;
    }
    .countdown-label {
        font-size: 0.9rem;
    }
}

/* ===== MAIN SECTIONS ===== */
main {
    position: relative;
    z-index: 1;
}

section {
    padding: var(--section-padding-mobile);
    text-align: center;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInSection 0.8s ease-out forwards;
}

section:nth-child(even) {
    background: rgba(255, 255, 255, 0.5);
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-coral), var(--color-sand-medium));
    border-radius: 2px;
    animation: expandLine 0.8s ease-out 0.5s both;
}

/* ===== NOSOTROS SECTION ===== */
#nosotros {
    animation-delay: 0.2s;
}

#nosotros img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    transition: var(--transition-smooth);
    animation: fadeInScale 1s ease-out 0.8s both;
}

#nosotros img:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* ===== DETALLES SECTION ===== */
#detalles {
    animation-delay: 0.4s;
}

.evento {
    background: var(--color-white);
    padding: 2rem;
    margin: 1rem auto;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: var(--transition-smooth);
    border-top: 3px solid var(--color-coral);
    max-width: 400px;
}

.evento:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.evento h3 {
    color: var(--color-coral);
    margin-bottom: 1rem;
}

.evento p {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* ===== UBICACION SECTION ===== */
#ubicacion {
    animation-delay: 0.6s;
}

#mapa {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin: 2rem auto;
    max-width: 800px;
    transition: var(--transition-smooth);
}

#mapa:hover {
    transform: scale(1.01);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

#mapa iframe {
    width: 100%;
    height: 350px;
    border: 0;
    display: block;
}

/* ===== BUTTONS ===== */
.boton {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-coral), var(--color-coral-dark));
    color: var(--color-white);
    padding: 1rem 2.5rem;
    text-decoration: none;
    border-radius: 50px;
    margin-top: 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
    transition: var(--transition-bounce);
    box-shadow: 0 4px 20px rgba(255, 111, 97, 0.3);
    position: relative;
    overflow: hidden;
}

.boton::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.boton:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(255, 111, 97, 0.4);
}

.boton:hover::before {
    left: 100%;
}

.boton:active {
    transform: translateY(-1px) scale(1.02);
}

/* ===== SPECIFIC SECTION DELAYS ===== */
#asistencia {
    animation-delay: 0.8s;
}

#regalos {
    animation-delay: 1s;
}

#playlist {
    animation-delay: 1.2s;
}

#vestimenta {
    animation-delay: 1.4s;
}

/* ===== FOOTER ===== */
footer {
    background: var(--color-text-primary);
    color: var(--color-sand-light);
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
    animation: fadeInUp 0.8s ease-out 1.6s both;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInSection {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes expandLine {
    from {
        width: 0;
    }
    to {
        width: 60px;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        padding: 0 2rem;
    }
    
    #mapa iframe {
        height: 400px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    section {
        padding: var(--section-padding-desktop);
    }
    
    #detalles {
        display: flex;
        gap: 2rem;
        align-items: stretch;
        justify-content: center;
        text-align: center;
    }
    
    #detalles .evento {
        flex: 1;
        max-width: none;
        margin: 0;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    #mapa iframe {
        height: 450px;
    }
    
    /* Disable parallax on tablets for better performance */
    #portada {
        background-attachment: scroll;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .container {
        padding: 0 3rem;
    }
    
    #nosotros {
        display: grid;
        grid-template-columns: 1fr 2fr;
        gap: 3rem;
        align-items: center;
        text-align: left;
        max-width: 1000px;
        margin: 0 auto;
    }
    
    #nosotros img {
        margin-bottom: 0;
    }
    
    #nosotros p {
        margin-left: 0;
        margin-right: 0;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    :root {
        --section-padding-desktop: 6rem 3rem;
    }
    
    #portada {
        background-attachment: fixed;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    #portada {
        background-attachment: scroll;
    }
}

/* Focus styles for better accessibility */
.boton:focus {
    outline: 3px solid var(--color-coral);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --color-coral: #FF0000;
        --color-text-primary: #000000;
        --color-text-secondary: #333333;
    }
}

