/* =========================================
   1. VARIABLES GLOBALES (Colores y Fuentes)
   ========================================= */
:root {
    /* Paleta Oficial Boda (Rose Gold & Blanco) */
    --rose-gold: #d4af37;       
    --rose-gold-dark: #d4af37;  
    --gold-accent: #d6b446;     
    --white-soft: #fcfcfc;      
    
    /* Colores App/Cámara */
    --primary-color: #4A90E2; 
    --secondary-color: #4A90E2; 
    --accent-color: #50E3C2;  
    
    /* Textos y Fondos Generales */
    --text-dark: #555555;       
    --text-light: #f4f4f4;
    --bg-light: #fff;
    --bg-gray: #f4f7f6;
}

/* =========================================
   2. ESTILOS BASE Y TIPOGRAFÍA
   ========================================= */
body, html {
    margin: 0; 
    padding: 0;
    font-family: 'Poppins', sans-serif;
    scroll-behavior: smooth;
    color: var(--text-dark);
    background-color: var(--white-soft);
}

.script-font {
    font-family: 'Great Vibes', cursive;
    font-weight: 400;
    margin-bottom: 15px;
    text-align: center;
}

h1.script-font {
    font-size: 4.5rem; 
    color: #ffff; 
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2); 
    line-height: 1.1;
    margin-top: 20px;
}

h2.script-font {
    font-size: 3.2rem;
    color: var(--gold-accent); 
    margin-top: 40px;
    text-shadow: 1px 1px 1px rgba(255,255,255,0.8);
}

h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    margin-bottom: 5px;
}

/* =========================================
   3. ESTILOS ESPECÍFICOS: INDEX (HOME)
   ========================================= */
.hero {
    height: 85vh; 
    min-height: 500px;
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('../img/portada_boda.jpg');
    background-size: cover;
    background-position: 30%; 
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-light);
    padding: 20px;
}

.hero h1 { font-size: 4rem; margin-bottom: 10px; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
.hero p { font-size: 1.5rem; letter-spacing: 3px; text-transform: uppercase; text-shadow: 1px 1px 3px rgba(0,0,0,0.5); }
.hero .date { font-size: 1.2rem; margin-top: 20px; font-weight: 600; background: rgba(0,0,0,0.4); padding: 10px 20px; border-radius: 50px; }

.section-content {
    padding: 60px 20px;
    text-align: center;
    background-color: var(--bg-light);
    max-width: 900px;
    margin: auto;
}
.section-content h2 { font-size: 3rem; margin-bottom: 20px; }
.section-content p { line-height: 1.8; color: #666; margin-bottom: 20px; font-size: 1.05rem; }

.parallax-section {
    height: 400px;
    background-attachment: fixed;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    position: relative;
}
.parallax-overlay { position: absolute; top:0; left:0; right:0; bottom:0; background: rgba(0,0,0,0.1); }
.bg-historia { 
    background-image: url('../img/nuestra_historia.jpg'); 
    background-position: top center !important; 
}
.bg-detalles { background-image: url('../img/detalles_boda.jpg');
background-position: center 50% !important; 
background-attachment: scroll !important; 
 }

.countdown-container { padding: 40px 20px; background: #f9f9f9; text-align: center; border-bottom: 1px solid #eee; }
.countdown-timer { display: flex; justify-content: center; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.time-box { background: white; padding: 15px 20px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); min-width: 70px; }
.time-box span { display: block; font-size: 2rem; font-weight: 600; color: var(--gold-accent); }
.time-box small { text-transform: uppercase; font-size: 0.7rem; color: #999; }

.map-responsive {
    overflow: hidden; padding-bottom: 56.25%; position: relative; height: 0;
    border-radius: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.15); margin-top: 30px; border: 5px solid white;
}
.map-responsive iframe { left: 0; top: 0; height: 100%; width: 100%; position: absolute; border: 0; }

.gift-intro { max-width: 600px; margin: 0 auto 30px auto; color: #555; }
.bank-card {
    background: #fff; border: 1px solid #e0e0e0; border-radius: 12px; padding: 20px;
    max-width: 500px; margin: 0 auto 30px auto; box-shadow: 0 4px 15px rgba(0,0,0,0.05); text-align: left;
}
.bank-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed #ddd; font-size: 0.95rem; }
.bank-row:last-child { border-bottom: none; }
.label { font-weight: 600; color: var(--gold-accent); margin-right: 10px; }
.value { color: #333; font-weight: 400; text-align: right; word-break: break-word; }
.gift-note { font-style: italic; color: #888; font-size: 0.9rem; }

.observations-section { padding: 60px 20px; background-color: #f9f9f9; text-align: center; }
.obs-container { display: flex; justify-content: center; gap: 30px; max-width: 900px; margin: 40px auto 0 auto; flex-wrap: wrap; }
.obs-card {
    background: white; padding: 40px 30px; border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05); flex: 1; min-width: 280px; max-width: 400px; transition: transform 0.3s ease;
}
.obs-card:hover { transform: translateY(-5px); }
.obs-icon { font-size: 3rem; margin-bottom: 20px; display: block; }
.obs-card h3 { color: var(--rose-gold-dark); margin-bottom: 15px; font-weight: 600; }

footer { background: #222; color: #ffff; text-align: center; padding: 40px 20px; }

/* =========================================
   4. ESTILOS ESPECÍFICOS: CÁMARA & GALERÍA
   ========================================= */

/* Para centrar la galería si se usa la clase body-galeria */
.body-galeria {
    background: var(--bg-gray);
    padding: 20px;
    text-align: center;
}

.app-container {
    background: var(--bg-light); 
    width: 100%; 
    max-width: 420px; 
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.05); 
    display: flex; 
    flex-direction: column;
    align-items: center; 
    position: relative; 
    margin: 0 auto;
}

.header-image { 
    width: 100%; 
    height: auto; 
    border-bottom-left-radius: 20px; 
    border-bottom-right-radius: 20px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
    margin-bottom: 20px; 
    display: block; 
}

.app-container .content {
    padding: 20px;
    width: 85%;
    text-align: center;
}

.app-container h1 { font-size: 1.5rem; margin-bottom: 5px; color: #2c3e50; }
.app-container p.subtitle { font-size: 0.9rem; color: #7f8c8d; margin-bottom: 30px; }

/* Zona de carga */
.upload-area {
    border: 2px dashed #cbd5e0; border-radius: 15px; padding: 30px 20px;
    background-color: #fafbfc; cursor: pointer; transition: all 0.3s ease; margin-bottom: 20px;
}
.upload-area:hover, .upload-area:active { border-color: var(--primary-color); background-color: #edf2f7; }
.upload-icon { font-size: 40px; color: var(--primary-color); margin-bottom: 10px; }
input[type="file"] { display: none; }

/* Estado y Botones Cámara */
#status-container { width: 100%; text-align: left; margin-bottom: 20px; font-size: 0.85rem; max-height: 150px; overflow-y: auto; }
.status-item { margin: 5px 0; padding: 8px; background: #f8f9fa; border-radius: 5px; display: flex; justify-content: space-between; }
.status-success { color: #2ecc71; }
.status-error { color: #e74c3c; }

.btn-main {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border: none; padding: 15px; width: 100%;
    border-radius: 50px; font-size: 1rem; font-weight: 600; box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4); cursor: pointer; transition: transform 0.2s;
}
.btn-main:disabled { background: #bdc3c7; box-shadow: none; cursor: not-allowed; }
.btn-main:active { transform: scale(0.98); }

.spinner {
    display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%; border-top-color: #fff; animation: spin 1s ease-in-out infinite; margin-right: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Botones Secundarios */
.btn, .btn-secondary, .btn-back {
    display: inline-block; text-align: center; padding: 12px 30px; border-radius: 50px;
    text-decoration: none; font-weight: 600; transition: all 0.3s ease; box-sizing: border-box; cursor: pointer;
}
.btn { border: 2px solid var(--rose-gold-dark); color: var(--rose-gold-dark); }
.btn:hover { background: var(--rose-gold-dark); color: white; }
.btn-filled { background: var(--rose-gold-dark); color: white; border: 2px solid var(--rose-gold-dark); }

.btn-back { margin-bottom: 20px; background: var(--primary-color); color: white; border: none; }

/* Galería Grid */
.gallery-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; max-width: 1000px; margin: auto; }
.photo-card { background: white; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.1); height: 200px; display: flex; align-items: center; justify-content: center; transition: transform 0.2s; position: relative;}
.photo-card:hover { transform: scale(1.03); }
.photo-card img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
#loading { font-size: 1.2rem; color: #666; margin-top: 50px; }

/* =========================================
   5. TICKETS (Boarding Pass)
   ========================================= */
.boarding-pass-container {
    background-color: var(--white-soft);
    padding: 50px 20px;
    border-top: 5px solid var(--rose-gold); 
}

.boarding-pass {
    background: #fff;
    max-width: 600px;
    margin: 0 auto 35px auto;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(203, 161, 142, 0.2); 
    overflow: hidden;
    position: relative;
    border: 1px solid #f0e6e6; 
    transition: transform 0.3s ease;
}
.boarding-pass:hover { transform: translateY(-5px); }

.pass-header {
    background: var(--rose-gold);
    color: #fff;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    letter-spacing: 2px;
    font-size: 0.85rem;
    text-transform: uppercase;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
}

.pass-header.party-header {
    background: #fff; 
    color: var(--gold-accent); 
    border-bottom: 2px solid var(--gold-accent); 
}
.pass-header.party-header .airline, .pass-header.party-header .flight-no { font-weight: 700; }

.pass-body {
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    background-image: radial-gradient(#f0e6e6 1px, transparent 1px);
    background-size: 20px 20px;
}

.pass-location, .pass-destination { flex: 1; text-align: center; }
.pass-location h3, .pass-destination h3 { font-size: 1.1rem; color: var(--text-dark); margin: 0 0 5px 0; font-weight: 700; }
.pass-location p, .pass-destination p { font-size: 0.8rem; color: #999; margin: 0 0 10px 0; text-transform: uppercase; letter-spacing: 1px; }

.time-big { font-size: 1.6rem; color: var(--rose-gold-dark); font-weight: 800; margin-top: 5px; }
.date-small {
    font-size: 1.1rem; color: var(--gold-accent); font-weight: 700; border: 2px solid var(--gold-accent);
    display: inline-block; padding: 4px 10px; border-radius: 8px; transform: rotate(-8deg);
}

.pass-icon { font-size: 2.5rem; margin: 0 15px; color: #eaddd9; animation: floatIcon 3s ease-in-out infinite; }

.pass-footer {
    background: #fdfbfb; border-top: 2px dashed #eaddd9; padding: 15px; text-align: center; font-size: 0.9rem; color: #777; position: relative;
}
.pass-footer::before, .pass-footer::after {
    content: ''; position: absolute; top: -10px; width: 20px; height: 20px;
    background-color: var(--white-soft); border-radius: 50%; border: 1px solid #f0e6e6; border-top: none; 
}
.pass-footer::before { left: -11px; border-right: none; }
.pass-footer::after { right: -11px; border-left: none; }

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

/* =========================================
   6. RESPONSIVE (Móviles y Tablets)
   ========================================= */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.8rem; }
    .hero, .parallax-section { background-attachment: scroll; } 
    .parallax-section { height: 250px; }
    .section-content h2 { font-size: 2.2rem; }
    .bank-row { flex-direction: column; text-align: center; }
    .value { text-align: center; margin-top: 4px; }
}

@media (max-width: 480px) {
    .pass-body { flex-direction: column; gap: 25px; text-align: center; }
    .pass-icon { transform: rotate(90deg); margin: 10px 0; animation: none; }
}

@media (min-width: 1024px) {
    .hero { height: 70vh; max-height: 700px; background-attachment: scroll; }
    .parallax-section { background-position: top center; height: 500px; }
}

/* =========================================
   7. LIGHTBOX Y NAVEGACIÓN
   ========================================= */
.lightbox {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox img {
    max-width: 90%;
    max-height: 85vh; /* Evita que la foto se salga de la pantalla */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    object-fit: contain; 
}

.cerrar-lightbox {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

/* Botones de navegación (Flechas) */
.btn-nav {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 15px 20px;
    margin-top: -30px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s ease;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.btn-nav.prev { left: 0; border-radius: 0 5px 5px 0; }
.btn-nav.next { right: 0; border-radius: 5px 0 0 5px; }

.btn-nav:hover {
    background-color: rgba(212, 175, 55, 0.9); /* Dorado al pasar el mouse */
}

/* Ocultar flechas en pantallas muy pequeñas si es necesario, aunque suelen verse bien */
@media (max-width: 480px) {
    .btn-nav { padding: 10px 15px; font-size: 20px; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.8rem; }
    .hero, .parallax-section { background-attachment: scroll; } 
    .parallax-section { height: 250px; } /* <--- AQUÍ ESTÁ EL CULPABLE */
    .section-content h2 { font-size: 2.2rem; }
    .bank-row { flex-direction: column; text-align: center; }
    .value { text-align: center; margin-top: 4px; }
}

/* Estilo para la foto de Nuestra Historia sin recortes */
.foto-historia {
    width: 100%;
    max-width: 500px; /* Evita que sea gigantesca en PC */
    height: auto;
    border-radius: 15px; /* Bordes redondeados elegantes */
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); /* Sombra suave */
    margin-top: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}