﻿/* --- CONFIGURACIÓN DE PALETA: CHAMPAGNE & GOLD LUXURY --- */
html {
    scroll-behavior: smooth;
}
:root {
    --fondo-principal: #F9F7F2;    /* Crema suave / Champagne muy claro */
    --blanco-puro: #FFFFFF;        /* Para tarjetas y cajas */
    --dorado-lujo: #D4AF37;        /* Dorado metálico clásico */
    --dorado-suave: #E6D2B5;       /* Champagne para fondos suaves */
    --texto-principal: #4A4A4A;    /* Gris oscuro cálido (para lectura) */
    --texto-titulo: #8E793E;       /* Dorado oscuro/Bronce para títulos */
    --borde-fino: 1px solid var(--dorado-lujo);
}

* { box-sizing: border-box; }

body { 
    font-family: 'Lato', sans-serif; 
    background-color: var(--fondo-principal); 
    color: var(--texto-principal); 
    margin: 0; 
    /* Textura de papel sutil o ruido muy suave */
    background-image: 
        radial-gradient(circle at 50% 50%, #ffffff 0%, transparent 60%);
    background-attachment: fixed;
}

/* --- 1. INTRODUCCIÓN (ENTRADA DE LUJO) --- */
#envelope-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    /* Degradado Dorado Premium */
    background: radial-gradient(ellipse at center, #c7a96c 0%, #8E793E 100%);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 2000; cursor: pointer; 
    transition: opacity 1.5s ease-in-out, transform 1.5s ease-in-out;
    overflow: hidden;
}

/* A. DESTELLOS (Las luciérnagas ahora son brillos de diamante/oro) */
.cosmos-background {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    /* Puntos blancos y dorados pálidos */
    background-image: 
        radial-gradient(white, rgba(255, 255, 255, 0.4) 2px, transparent 4px),
        radial-gradient(#F9F7F2, rgba(249, 247, 242, 0.3) 1px, transparent 3px);
    background-size: 500px 500px, 300px 300px;
    opacity: 0.8;
    animation: sparkles-move 60s linear infinite;
}

/* B. ESTRELLA FUGAZ (Brillo dorado) */
.shooting-star {
    position: absolute; top: 50%; left: 50%; width: 4px; height: 4px;
    background: white; border-radius: 50%;
    box-shadow: 0 0 20px 5px rgba(255, 255, 255, 0.6);
    animation: wisp-float 12s ease-in-out infinite; opacity: 0;
}

/* C. PORTAL (ANILLO DORADO) */
.mystical-portal {
    width: 170px; height: 170px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1); /* Ligeramente blanco */
    border: 2px solid var(--fondo-principal); /* Borde claro */
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.1);
    display: flex; flex-direction: row; align-items: center; justify-content: center;
    position: relative; z-index: 10;
    animation: breathe 5s infinite ease-in-out;
}

.mystical-portal::before {
    content: ''; position: absolute; inset: -10px;
    border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 50%;
    animation: spin-slow 40s linear infinite;
}

.portal-text {
    font-family: 'Cinzel Decorative', cursive; 
    font-size: 3.5rem; font-weight: 700;
    color: var(--fondo-principal); /* Texto claro sobre el fondo dorado */
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    letter-spacing: 1px; white-space: nowrap;
}

.tap-text {
    margin-top: 40px; color: var(--fondo-principal);
    font-family: 'Cinzel', serif; letter-spacing: 4px;
    text-transform: uppercase; font-size: 0.8rem; z-index: 10; opacity: 0.9;
}

/* --- 2. PORTADA (HERO) --- */
.hero { 
    height: 90vh; 
    /* IMPORTANTE: Usa una foto luminosa si puedes. Si usas la misma, el filtro de abajo la aclarará */
    background: url('https://images.unsplash.com/photo-1519741497674-611481863552?q=80&w=2000&auto=format&fit=crop') center/cover;
    display: flex; flex-direction: column; align-items: center; justify-content: center; 
    text-align: center; position: relative;
    border-bottom: 5px solid var(--dorado-lujo);
}
.hero .overlay { 
    position: absolute; inset: 0; 
    /* Capa blanca semitransparente para que el texto resalte si la foto es oscura */
    background: rgba(0, 0, 0, 0.2); 
}
.hero .content { position: relative; z-index: 2; padding: 20px; }

h1 { 
    font-family: 'Cinzel Decorative', cursive; font-size: 4.5rem; margin: 0; 
    color: #FFFFFF;
    text-shadow: 0 2px 15px rgba(0,0,0,0.4); /* Sombra para leerse sobre la foto */
}
h2 { 
    font-family: 'Cinzel', serif; letter-spacing: 6px; 
    text-transform: uppercase; font-size: 1rem; color: #FFFFFF; margin-bottom: 15px; 
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.date { 
    font-size: 1.5rem; font-family: 'Cinzel', serif; font-weight: bold;
    border-top: 1px solid #FFFFFF; border-bottom: 1px solid #FFFFFF; 
    padding: 15px 40px; margin-top: 25px; color: #FFFFFF; 
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* --- 3. SECCIONES GENERALES --- */
.section { padding: 80px 20px; text-align: center; max-width: 800px; margin: 0 auto; }
.section-title { 
    font-family: 'Cinzel Decorative', cursive; font-size: 2.8rem; 
    color: var(--texto-titulo); margin-bottom: 40px; 
}
.section-title::after {
    content: "❖"; display: block; font-size: 1.5rem; color: var(--dorado-lujo); margin-top: 10px;
}
p { line-height: 1.8; color: var(--texto-principal); font-size: 1.1rem; }

/* --- 4. CUENTA REGRESIVA (ARCOS BLANCOS Y DORADOS) --- */
.countdown-container { 
    margin-top: -60px; 
    position: relative; z-index: 10; padding-bottom: 0; 
    display: flex; justify-content: center;
}

.timer { 
    display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; 
    flex-direction: row; width: 100%;
}

.time-box { 
    /* Fondo BLANCO PURO */
    background: var(--blanco-puro); 
    padding: 20px 15px; 
    /* Arcos superiores */
    border-radius: 100px 100px 0 0; 
    /* Borde Dorado */
    border: 2px solid var(--dorado-lujo); 
    min-width: 90px; height: 130px; 
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.2); /* Sombra dorada suave */
}

.time-number { 
    font-size: 2.5rem; font-weight: 700; font-family: 'Cinzel', serif; 
    color: var(--texto-titulo); /* Número Dorado Oscuro */
    line-height: 1; margin-bottom: 8px;
}

.time-label { 
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 2px; 
    color: var(--texto-principal); /* Texto gris */
}

/* --- 5. CARRUSEL --- */
.swiper { 
    width: 100%; height: 450px; 
    border: 4px solid var(--blanco-puro); 
    outline: 2px solid var(--dorado-lujo); /* Doble borde elegante */
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}
.swiper-slide img { 
    width: 100%; height: 100%; object-fit: cover; 
    /* Filtro más cálido y brillante, no sepia oscuro */
    filter: brightness(105%) contrast(102%); 
}

/* --- 6. TIMELINE & MAPA --- */
.timeline-item { border-bottom: 1px solid var(--dorado-suave); }
.timeline-icon { color: var(--dorado-lujo); font-size: 2rem; }
.timeline-content h3 { font-family: 'Cinzel', serif; color: var(--texto-titulo); }

.map-container { 
    border: 4px solid var(--blanco-puro); 
    outline: 1px solid var(--dorado-lujo);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* --- 7. BOTONES (GOLD & WHITE) --- */
.btn, .upload-btn {
    display: inline-block; padding: 15px 40px; 
    background: var(--dorado-lujo); /* Fondo Dorado */
    color: white; /* Texto Blanco */
    text-decoration: none; 
    border: none;
    margin-top: 25px; font-family: 'Cinzel', serif; letter-spacing: 2px; font-weight: bold;
    text-transform: uppercase; font-size: 0.9rem;
    transition: all 0.4s;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}
.btn:hover, .upload-btn:hover { 
    background-color: #bfa145; 
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.6);
}

/* --- 8. TARJETAS (INFO & UPLOAD) --- */
.info-card {
    background: var(--blanco-puro);
    border: 1px solid var(--dorado-suave);
    padding: 30px; margin: 15px 10px; border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.upload-card {
    background: var(--blanco-puro);
    padding: 40px; 
    border-radius: 4px;
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.15); /* Sombra dorada muy suave */
    
    /* Centrado */
    margin-top: 50px; margin-bottom: 50px;
    margin-left: auto; margin-right: auto;
    max-width: 800px;
    
    /* Bordes */
    border: 1px solid var(--dorado-lujo);
    outline: 1px dashed var(--dorado-lujo); outline-offset: -8px;
}
.info-card h3, .upload-card h2 { color: var(--texto-titulo); }

/* Animaciones */
@keyframes sparkles-move { 0% { background-position: 0 0; } 100% { background-position: 500px 500px; } }
@keyframes wisp-float { 
    0% { transform: translate(-50px, 50px) scale(0.8); opacity: 0; }
    50% { transform: translate(50px, -50px) scale(1.2); opacity: 0.8; }
    100% { transform: translate(100px, 50px) scale(0.8); opacity: 0; }
}
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }
@keyframes spin-slow { 100% { transform: rotate(360deg); } }

/* Ajustes Móviles */
@media (max-width: 600px) {
    h1 { font-size: 3.2rem; }
    .hero .content { padding: 30px 15px; }
    .swiper { height: 350px; }
    .time-box { min-width: 70px; height: 100px; padding: 10px; }
    .time-number { font-size: 1.8rem; }
}

/* --- ESTILOS PARA EL ZOOM DEL QR --- */
.qr-modal {
    display: none; 
    position: fixed; 
    z-index: 9999 !important; /* Forzamos que esté encima de todo en el cel */
    padding-top: 100px; /* Un poco más abajo para que no choque con barras del cel */
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.9); 
    backdrop-filter: blur(5px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    -webkit-overflow-scrolling: touch; /* Suavidad en iPhone */
}

.qr-modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 500px; /* Tamaño máximo al ampliar */
    border: 4px solid var(--dorado-lujo);
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.5);
    animation: zoom 0.6s;
}

.qr-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.qr-close:hover,
.qr-close:focus {
    color: var(--dorado-lujo);
    text-decoration: none;
    cursor: pointer;
}

.qr-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    font-family: 'Lato', sans-serif;
}

/* Animación de zoom */
@keyframes zoom {
  from {transform:scale(0)} 
  to {transform:scale(1)}
}

/* --- LLUVIA DE ESTRELLAS FUGACES --- */
.stars-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden;
    z-index: 1; /* Detrás del portal (L&A) pero delante del fondo */
    pointer-events: none; /* Para que no bloquee el clic de abrir sobre */
}

.stars-container span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1), 0 0 0 8px rgba(255, 255, 255, 0.1), 0 0 20px rgba(255, 255, 255, 1);
    animation: meteor 3s linear infinite;
    opacity: 0;
}

/* La cola de la estrella */
.stars-container span::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    height: 1px;
    background: linear-gradient(90deg, #fff, transparent);
}

/* Animación de caída */
@keyframes meteor {
    0% {
        transform: rotate(-45deg) translateX(0);
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        transform: rotate(-45deg) translateX(-1000px); /* Ajusta la distancia si es necesario */
        opacity: 0;
    }
}

/* --- Posiciones y retrasos aleatorios para cada estrella --- */
.stars-container span:nth-child(1) { top: 0; right: 0; left: initial; animation-delay: 0s; animation-duration: 1s; }
.stars-container span:nth-child(2) { top: 0; right: 80px; left: initial; animation-delay: 0.2s; animation-duration: 3s; }
.stars-container span:nth-child(3) { top: 80px; right: 0; left: initial; animation-delay: 0.4s; animation-duration: 2s; }
.stars-container span:nth-child(4) { top: 0; right: 180px; left: initial; animation-delay: 0.6s; animation-duration: 1.5s; }
.stars-container span:nth-child(5) { top: 0; right: 400px; left: initial; animation-delay: 0.8s; animation-duration: 2.5s; }
.stars-container span:nth-child(6) { top: 0; right: 600px; left: initial; animation-delay: 1s; animation-duration: 3s; }
.stars-container span:nth-child(7) { top: 300px; right: 0; left: initial; animation-delay: 1.2s; animation-duration: 1.75s; }
.stars-container span:nth-child(8) { top: 0; right: 700px; left: initial; animation-delay: 1.4s; animation-duration: 1.25s; }
.stars-container span:nth-child(9) { top: 0; right: 1000px; left: initial; animation-delay: 0.75s; animation-duration: 2.25s; }
.stars-container span:nth-child(10) { top: 0; right: 450px; left: initial; animation-delay: 2.75s; animation-duration: 2.25s; }


/* --- BOTÓN DE MÚSICA FLOTANTE --- */
.music-control {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--dorado-lujo);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 3000; /* Por encima de todo */
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    outline: none;
    opacity: 0; /* Oculto al inicio hasta que abran el sobre */
    visibility: hidden; 
}

.music-control:hover {
    transform: scale(1.1);
    background-color: #bfa145;
}

/* Clase para cuando está sonando (gira el disco) */
.music-control.playing {
    animation: spin-music 4s linear infinite;
    opacity: 1;
    visibility: visible;
}

/* Clase para mostrar el botón aunque esté pausado */
.music-control.show {
    opacity: 1;
    visibility: visible;
}

@keyframes spin-music {
    100% { transform: rotate(360deg); }
}