/* ==========================================================================
   SISTEMA DE ESTILOS Y TEMAS VISUALES PARA INVITACIONES DIGITALES
   ========================================================================== */

/* --- RESET & BASIC SETUP --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100vw;
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   TEMAS CROMÁTICOS (SE APLICAN AUTOMÁTICAMENTE SEGÚN TIPO DE EVENTO)
   ========================================================================== */

/* Tema 1: XV Años (Rosa, Dorado Elegante, Blanco Marfil) */
.theme-quinceanos, .theme-default {
    --bg-color: #fff9fa;
    --card-bg: #ffffff;
    --text-color: #4a3e4e;
    --text-muted: #8e7a95;
    --accent-color: #d4af37;
    --accent-glow: rgba(212, 175, 55, 0.25);
    --secondary-color: #e8b4b8;
    --primary-btn-bg: linear-gradient(135deg, #d4af37 0%, #aa771c 100%);
    --primary-btn-text: #ffffff;
    --font-heading: 'Playfair Display', serif;
    --font-hand: 'Great Vibes', cursive;
    --border-color: rgba(212, 175, 55, 0.3);
}

/* Tema 2: Boda (Dorado Champán, Blanco, Esmeralda Suave) */
.theme-boda {
    --bg-color: #fbf9f5;
    --card-bg: #ffffff;
    --text-color: #2c2825;
    --text-muted: #736b63;
    --accent-color: #c5a059;
    --accent-glow: rgba(197, 160, 89, 0.25);
    --secondary-color: #2d5a27;
    --primary-btn-bg: linear-gradient(135deg, #c5a059 0%, #997a3a 100%);
    --primary-btn-text: #ffffff;
    --font-heading: 'Cormorant Garamond', serif;
    --font-hand: 'Cormorant Garamond', serif;
    --border-color: rgba(197, 160, 89, 0.35);
}

/* Tema 3: Cumpleaños / Fiesta (Oscuro Neón, Cian, Violeta) */
.theme-cumpleanos {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --text-color: #f0f6fc;
    --text-muted: #8b949e;
    --accent-color: #00f2fe;
    --accent-glow: rgba(0, 242, 254, 0.3);
    --secondary-color: #ff416c;
    --primary-btn-bg: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    --primary-btn-text: #ffffff;
    --font-heading: 'Outfit', sans-serif;
    --font-hand: 'Outfit', sans-serif;
    --border-color: rgba(0, 242, 254, 0.3);
}

/* ==========================================================================
   PANTALLA DE ERROR / 404
   ========================================================================== */
.full-screen-center {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0f172a;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 99999;
}

.error-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px 25px;
    text-align: center;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.error-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.error-card h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    margin-bottom: 10px;
    color: #f8fafc;
}

.error-card p {
    color: #94a3b8;
    font-size: 0.95rem;
    margin-bottom: 25px;
}

/* ==========================================================================
   PORTADA OVERLAY DE APERTURA (COVER SCREEN)
   ========================================================================== */
.cover-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 30%, var(--accent-glow) 0%, transparent 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: 25px;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.cover-overlay.hide-cover {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

.cover-content {
    text-align: center;
    max-width: 450px;
    width: 100%;
    animation: fadeIn 1s ease;
}

.cover-badge {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent-color);
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: 30px;
    margin-bottom: 20px;
    font-weight: 600;
}

.cover-title {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    line-height: 1.1;
    color: var(--text-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.cover-quote {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 25px;
    padding: 0 15px;
}

.cover-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 35px;
    color: var(--accent-color);
}

.cover-decoration .line {
    width: 60px;
    height: 1px;
    background: var(--accent-color);
    opacity: 0.5;
}

/* ==========================================================================
   BOTONES & INTERACCIONES
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.btn-full {
    width: 100%;
}

.btn-gold {
    background: var(--primary-btn-bg);
    color: var(--primary-btn-text);
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1.5px solid var(--border-color);
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #ffffff;
    font-size: 1.05rem;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.3);
}

.btn:hover, .btn:active {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.18);
}

.btn-pulse {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 var(--accent-glow);
    }
    70% {
        box-shadow: 0 0 0 16px rgba(0, 0, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

/* ==========================================================================
   REPRODUCTOR DE MÚSICA FLOTANTE
   ========================================================================== */
.floating-music-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 8000;
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.floating-music-btn:hover {
    transform: scale(1.05);
}

.eq-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
}

.bar {
    width: 3px;
    height: 100%;
    background: var(--accent-color);
    border-radius: 2px;
    transition: height 0.2s ease;
}

.floating-music-btn.playing .bar:nth-child(1) {
    animation: eqBar 0.8s ease-in-out infinite alternate;
}
.floating-music-btn.playing .bar:nth-child(2) {
    animation: eqBar 0.8s ease-in-out 0.3s infinite alternate;
}
.floating-music-btn.playing .bar:nth-child(3) {
    animation: eqBar 0.8s ease-in-out 0.6s infinite alternate;
}

@keyframes eqBar {
    0% { height: 4px; }
    100% { height: 16px; }
}

.music-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
}

/* ==========================================================================
   ESTRUCTURA PRINCIPAL Y SECCIONES
   ========================================================================== */
#invitation-app {
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: 60px;
    background: var(--bg-color);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.05);
    min-height: 100vh;
}

.section {
    padding: 40px 20px;
    text-align: center;
}

.section-subtitle {
    font-size: 0.75rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 8px;
    font-weight: 700;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--text-color);
    margin-bottom: 25px;
    line-height: 1.2;
}

.section-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 30px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    position: relative;
}

.gold-border {
    border-color: var(--accent-color);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
    padding-top: 30px;
}

.hero-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-frame {
    width: 260px;
    height: 330px;
    border-radius: 130px 130px 24px 24px;
    overflow: hidden;
    border: 4px solid var(--card-bg);
    outline: 2px solid var(--accent-color);
    box-shadow: 0 15px 35px var(--accent-glow);
    margin-bottom: 25px;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-subtitle {
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--text-color);
    line-height: 1.1;
    margin-bottom: 5px;
}

.hero-name {
    font-family: var(--font-hand);
    font-size: 3.2rem;
    color: var(--accent-color);
    margin-bottom: 20px;
    font-weight: 400;
}

.hero-date-badge {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.date-line {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
}

.time-line {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 600;
}

/* ==========================================================================
   CUENTA REGRESIVA
   ========================================================================== */
.timer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.timer-box {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer-number {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
    margin-bottom: 4px;
}

.timer-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* ==========================================================================
   MENSAJE PRINCIPAL
   ========================================================================== */
.quote-icon {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    color: var(--accent-color);
    line-height: 0.5;
    opacity: 0.4;
    text-align: left;
    margin-bottom: 10px;
}

.quote-icon.right {
    text-align: right;
    margin-top: 10px;
    margin-bottom: 0;
}

.message-text {
    font-size: 1.05rem;
    font-style: italic;
    color: var(--text-color);
    line-height: 1.7;
    padding: 0 10px;
}

/* ==========================================================================
   GALERÍA DE FOTOS & LIGHTBOX
   ========================================================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.gallery-item {
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 2px solid var(--card-bg);
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: #ffffff;
    font-size: 2.5rem;
    cursor: pointer;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

.lightbox-caption {
    color: #ffffff;
    margin-top: 15px;
    font-size: 1rem;
    text-align: center;
}

/* ==========================================================================
   VIDEO SECTION
   ========================================================================== */
.video-container {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    background: #000;
}

.video-container video, .video-container iframe {
    width: 100%;
    height: 250px;
    border: none;
    display: block;
}

/* ==========================================================================
   UBICACIÓN & DETALLES
   ========================================================================== */
.location-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.location-address {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.detail-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px 15px;
    text-align: center;
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.detail-card h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.detail-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ==========================================================================
   RSVP WHATSAPP & FOOTER
   ========================================================================== */
.rsvp-card {
    background: var(--card-bg);
    border: 2px solid #25D366;
    border-radius: 24px;
    padding: 30px 20px;
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.15);
    text-align: center;
}

.rsvp-badge {
    display: inline-block;
    background: rgba(37, 211, 102, 0.1);
    color: #25D366;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 2px;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.rsvp-card h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 8px;
}

.rsvp-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.footer-section {
    padding: 30px 20px 10px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

.final-message {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--text-color);
    margin-bottom: 15px;
    font-style: italic;
}

.footer-brand {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* ==========================================================================
   ANIMACIONES SCROLL REVEAL
   ========================================================================== */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (375px, 390px, 414px, 768px, 1366px)
   ========================================================================== */

/* Small Devices (375px - iPhone SE) */
@media screen and (max-width: 375px) {
    .cover-title { font-size: clamp(2rem, 8vw, 2.5rem); }
    .hero-title { font-size: clamp(1.8rem, 7vw, 2.3rem); }
    .hero-name { font-size: clamp(2.4rem, 9vw, 3rem); }
    .timer-number { font-size: 1.5rem; }
    .btn { padding: 14px 20px; font-size: 0.85rem; }
    .details-grid { grid-template-columns: 1fr; }
    .section { padding: 30px 15px; }
}

/* Medium Mobile (390px - 414px - iPhone 12/13/14/Pro Max) */
@media screen and (min-width: 376px) and (max-width: 480px) {
    #invitation-app { max-width: 100vw; }
}

/* Tablets & Larger Screens (768px - 1366px) */
@media screen and (min-width: 768px) {
    body {
        background-color: #0b0f19;
        background-image: radial-gradient(circle at 50% 30%, rgba(212, 175, 55, 0.15) 0%, transparent 70%);
        padding: 40px 0;
    }

    #invitation-app {
        margin: 0 auto;
        border-radius: 36px;
        border: 2px solid var(--border-color);
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
        position: relative;
    }

    .floating-music-btn {
        right: calc(50vw - 220px);
        top: 40px;
    }

    .cover-overlay {
        background: #0b0f19;
    }

    .cover-content {
        background: var(--bg-color);
        padding: 40px;
        border-radius: 30px;
        border: 1px solid var(--border-color);
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    }
}

