@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;700&family=Playfair+Display:wght@700&family=Great+Vibes&family=Cinzel+Decorative:wght@700&family=Inter:wght@400&display=swap');

:root {
    --bayou-dark: #121d17;
    --bayou-green: #1b4d3e;
    --emerald-deep: #14332a;
    --lotus-pink: #f4c2c2;
    --gold: #d4af37;
    --gold-glow: rgba(212, 175, 55, 0.5);
    --paper-bg: #fdfaf5;
    --text-dark: #2c2a22;
    --firefly: #fdfd96;
    --music-btn-bg: rgba(27, 77, 62, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bayou-dark);
    color: white;
    font-family: 'Cormorant Garamond', serif;
    overflow: hidden; /* El libro es la experiencia principal */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(27, 77, 62, 0.4) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(197, 160, 89, 0.2) 0%, transparent 40%);
}

h3, .bayou-msg {
    font-family: 'Great Vibes', cursive !important;
    font-size: 3rem !important;
    color: var(--bayou-green);
    margin-bottom: 20px;
}

#downloadJsonBtn {
    display: none; /* Oculto para invitados - 'transparente' para el usuario final */
}

#fireflies {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.firefly {
    position: absolute;
    background: var(--firefly);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--firefly);
    filter: blur(1px);
}

/* BOOK WRAPPER */
.book-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* 3D BOOK LOGIC */
.book {
    width: 350px;
    height: 500px;
    position: relative;
    transition: transform 1s;
    transform-style: preserve-3d;
}

.book.book-open {
    transform: translateX(50%);
}

.book.book-at-end {
    transform: translateX(100%);
}

.page {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transform-style: preserve-3d;
    transform-origin: left;
    transition: transform 1.2s cubic-bezier(0.445, 0.05, 0.55, 0.95);
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    cursor: pointer;
}

.page.flipped {
    transform: rotateY(-180deg);
}

/* Efecto de profundidad en el lomo */
.page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 10px;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.1), transparent);
    z-index: 10;
}

.front, .back {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.front {
    background-color: var(--paper-bg);
    color: var(--text-dark);
    z-index: 2;
    border-radius: 0 15px 15px 0;
}

.back {
    background-color: var(--paper-bg);
    color: var(--text-dark);
    z-index: 1;
    transform: rotateY(180deg);
    border-radius: 15px 0 0 15px;
    border-right: 15px solid rgba(0,0,0,0.05); /* Sombra lomo Libro Abierto */
}

/* DISEÑO PORTADA (Hoja 1 Front) */
#p1 .front {
    background: linear-gradient(135deg, var(--bayou-green), var(--bayou-dark));
    color: var(--gold);
    border-left: 8px solid var(--gold);
    display: flex;
    flex-direction: column;
    text-align: center;
}

.royal-title { font-family: 'Playfair Display', serif; font-size: 1.5rem; letter-spacing: 4px; }
.royal-name { 
    font-family: 'Cinzel Decorative', serif; 
    font-size: 1.6rem; 
    font-weight: 700;
    margin: 10px 0; 
    color: #fff; 
    text-shadow: 0 0 8px var(--gold-glow); 
    text-transform: uppercase;
    letter-spacing: 2px;
}
.lotus-glow { font-size: 3rem; margin-bottom: 10px; }
.click-hint { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 2px; opacity: 0.6; margin-top: 20px; }

/* DISEÑO INTERIOR (Contenido páginas) */
.page-content-left, .page-content-right {
    text-align: center;
    width: 100%;
    border: 1px solid rgba(212, 175, 55, 0.2);
    height: 100%;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
}

.frog-image-box {
    text-align: center;
    margin-top: 10px;
}

.custom-icon-img {
    width: 120px; /* Ajustado para que se vea bien como icono */
    height: auto;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2));
}

.info-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.info-card {
    display: flex;
    justify-content: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.info-content {
    width: 100%;
}

.info-content strong {
    color: var(--bayou-green);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 2px;
    display: block;
}

.info-content p {
    font-size: 1rem;
    font-weight: bold;
    margin-top: 2px;
}

.address-detail {
    font-size: 0.8rem !important;
    font-weight: normal !important;
    color: #666;
}

.envelope-area { 
    text-align: center; 
    padding: 10px; 
    background: rgba(212, 175, 55, 0.05); 
    border-radius: 15px; 
    border: 1px solid var(--gold-glow);
    margin-top: 10px;
}
.envelope-img { 
    width: 80px; 
    height: auto; 
    margin-bottom: 5px; 
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.2));
}

.envelope-poem {
    font-family: 'Great Vibes', cursive;
    font-size: 1.7rem;
    color: var(--text-dark);
    line-height: 1.2;
    padding: 0 5px;
    margin-top: 5px;
}

.secondary-btn {
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--gold);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: var(--gold);
    color: white;
}


.thank-you-header { text-align: center; margin-bottom: 20px; }
.crown-icon { font-size: 2.5rem; display: block; margin-bottom: 5px; animation: floatIcon 3s ease-in-out infinite; }
.final-text { font-style: italic; color: #555; font-size: 0.9rem; line-height: 1.4; margin-top: 10px; }
.gold-divider { border: 0; height: 1px; background: linear-gradient(to right, transparent, var(--gold), transparent); margin: 20px 0; width: 80%; }


@keyframes floatIcon { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }


.rsvp-form-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px;
}

.rsvp-field {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rsvp-label {
    font-size: 0.85rem;
    color: var(--bayou-green);
    text-transform: uppercase;
    font-weight: bold;
    margin-bottom: 5px;
}

.rsvp-form-box input {
    width: 90%;
    padding: 12px;
    border: 1px solid var(--gold-glow);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    text-align: center;
    outline: none;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.rsvp-form-box input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.rsvp-companion-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 5px;
}

.rsvp-companion-group .rsvp-label {
    margin-bottom: 0;
}

.rsvp-form-box input[type="number"] {
    width: 60px;
    padding: 8px;
}

/* Quitar flechas del input number */
.rsvp-form-box input[type=number]::-webkit-inner-spin-button, 
.rsvp-form-box input[type=number]::-webkit-outer-spin-button { 
    appearance: none;
    -webkit-appearance: none; 
    margin: 0; 
}
.rsvp-form-box input[type=number] { 
    appearance: textfield;
    -moz-appearance: textfield; 
}

.rsvp-form-box button {
    margin-top: 10px;
    background: var(--bayou-green);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(27, 77, 62, 0.3);
    transition: transform 0.2s, background 0.3s;
}

.rsvp-form-box button:active {
    transform: scale(0.98);
}

.guest-list-mini {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.guest-mini-item {
    background: white;
    border: 1px solid var(--gold);
    border-radius: 20px;
    font-size: 0.8rem;
    padding: 8px 12px;
    display: inline-block;
    word-break: break-word;
}


.page-footer { margin-top: auto; font-size: 0.7rem; opacity: 0.4; text-transform: uppercase; }

/* MOBILE RE-IMAGINED: SINGLE-SURFACE CARD STACK (NOT A BOOK) */
@media (max-width: 600px) {
    body {
        overflow-x: hidden;
    }

    .book-wrapper {
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 10px;
    }

    .book {
        width: 100%;
        max-width: 380px;
        height: 85vh;
        position: relative;
        transform: none !important;
        transform-style: flat;
    }

    /* Animación Base Suave (Princess Bloom) */
    .front, .back {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        backface-visibility: visible !important;
        transform: scale(0.95);
        opacity: 0;
        visibility: hidden;
        transition: opacity 1.5s ease, transform 1.5s cubic-bezier(0.19, 1, 0.22, 1);
        border-radius: 20px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.5);
        border: 2px solid var(--gold-glow);
        padding: 30px 20px !important;
    }

    /* Superficie Activa: Aparece suavemente con un ligero zoom */
    .mobile-side-active {
        opacity: 1 !important;
        visibility: visible !important;
        transform: scale(1) !important;
        z-index: 100 !important;
    }

    /* Superficie Pasada: Desaparece expandiéndose */
    .mobile-side-past {
        opacity: 0 !important;
        visibility: hidden !important;
        transform: scale(1.1) !important;
        z-index: 1 !important;
    }

    /* Ajustes de Texto en Móvil (Final y Seguro) */
    .royal-name { font-family: 'Cinzel Decorative', serif !important; font-size: 1.8rem !important; margin: 10px 0 !important; letter-spacing: 2px !important; }
    .bayou-msg { font-size: 2.2rem !important; }
    .poetic-text { font-size: 1.25rem !important; line-height: 1.3 !important; }
    .envelope-poem { font-size: 1.5rem !important; line-height: 1.1 !important; }
    .info-item { margin-bottom: 12px !important; }
    .info-item p { font-size: 0.95rem !important; }
    .info-item strong { margin-bottom: 2px !important; }
    .rsvp-form-box p { font-size: 0.9rem !important; }
    .rsvp-label { font-size: 0.9rem !important; }
    .guest-list-mini { max-height: 200px !important; }
}

/* EFECTO NOTAS MUSICALES */
.music-note {
    position: fixed;
    color: var(--gold);
    font-size: 1.5rem;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    animation: floatNote 4s linear forwards;
    text-shadow: 0 0 5px var(--gold-glow);
}

@keyframes floatNote {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-200px) rotate(360deg) translateX(50px);
        opacity: 0;
    }
}
