html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    /* Quitamos overflow: hidden para evitar bloqueos de scroll en pantallas táctiles */
    background-color: #000;
    position: relative;
}


/* --- VARIABLES GLOBALES DE COLOR --- */
:root {
    --bg-color: #fdfcf7; 
    --text-color: #1a1a1a;
    --card-bg: #ffffff;
    --gold: #D4AF37;
    --gold-light: #F1D592;
    --gradient-master: radial-gradient(circle at top, #ffffff 0%, #fdfcf7 100%);
    --border-subtle: rgba(0,0,0,0.05);
    --report-text-color: #1e3a8a; 
    --report-title-color: #1d4ed8;
}

/* Contenedor Maestro Aislante */
#vlp-landing-master {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    z-index: 9999999; 
    overflow-y: auto; 
    overflow-x: hidden;
    background-color: var(--bg-color) !important;
    background: var(--gradient-master) !important;
    color: var(--text-color) !important;
    transition: background 0.3s ease, color 0.3s ease;
}

.app-shell {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* --- BOTÓN DE CONFIGURACIÓN MAESTRO --- */
.settings-btn {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    transition: opacity 0.2s, transform 0.2s;
}

.settings-btn:active {
    transform: scale(0.9);
}


.dropdown-menu {
    display: none;
    position: absolute;
    top: 65px;
    right: 20px;
    width: 180px;
    background: var(--card-bg) !important;
    border: 1px solid var(--gold);
    border-radius: 12px;
    z-index: 110;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    overflow: hidden;
}

/* --- TEXTOS DEL MENÚ DESPLEGABLE CONFIGURACIÓN (TAMAÑO FIJO MEJORADO) --- */
.menu-item {
    padding: 14px 18px; 
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem; 
    color: var(--text-color) !important;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}
.menu-item:hover { background: rgba(212, 175, 55, 0.15); }
.menu-item.border-t { border-top: 1px solid var(--border-subtle); }

.title-container {
    text-align: center;
    padding: 60px 20px 15px;
}

.main-title {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    color: var(--gold);
    line-height: 1.1;
}

.glow-gold { text-shadow: 0 0 15px rgba(212, 175, 55, 0.6); }

.btn-gold {
    background: linear-gradient(to right, #aa820a, var(--gold));
    box-shadow: 0 10px 25px -10px rgba(212, 175, 55, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--gold-light);
}
.btn-gold:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 15px 35px -10px rgba(212, 175, 55, 0.7); 
}

.verse-card {
    background: var(--card-bg) !important;
    color: var(--text-color) !important;
    margin: 0 20px 10px;
    padding: 24px;
    border-radius: 15px;
    border-right: 5px solid var(--gold);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: relative;
}

.verse-card::before {
    content: ''; position: absolute; top: -1px; left: 10%;
    width: 30%; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.rect-btn {
    color: white;
    margin: 0 20px 20px;
    padding: 20px;
    border-radius: 15px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
}

.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 0 20px 40px;
}

.square-btn {
    background: var(--card-bg) !important;
    border: 2px solid var(--gold);
    aspect-ratio: 1/1;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
    color: var(--text-color) !important;
}
.square-btn:hover { transform: scale(1.02); }

.candle-flame {
    font-size: 3.5rem;
    animation: burn 2s infinite alternate ease-in-out;
    display: block;
    margin: 0 auto;
}

@media (orientation: portrait) {
    #chartEstadisticas {
        max-height: 230px;
    }
}

@keyframes burn {
    from { transform: scale(1); filter: drop-shadow(0 0 5px var(--gold-light)); }
    to { transform: scale(1.08); filter: drop-shadow(0 0 15px var(--gold)); }
}

/* --- MODAL CONFIGURACIÓN Y PANELES --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 100000000 !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto; 
}


.modal-content {
    background: var(--card-bg) !important;
    color: var(--text-color) !important;
    padding: 25px;
    border-radius: 24px;
    border: 2px solid var(--gold);
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.theme-selector-btn {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 2px solid rgba(212, 175, 55, 0.4);
    background: transparent;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-color) !important;
}
.theme-selector-btn.active {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.15);
}

/* --- VISTAS INTERNES FULLSCREEN --- */
.fullscreen-view {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999999; 
    overflow-y: auto; 
    overflow-x: hidden;
    background-color: var(--bg-color) !important;
    background: var(--gradient-master) !important;
    color: var(--text-color) !important;
}

#view-resultado-examen {
    color: var(--report-text-color) !important;
}

@media print {
    body > * { display: none !important; }
    
    html, body {
        height: auto !important;
        overflow: visible !important;
        background: #ffffff !important;
    }
    
    #view-resultado-examen, #view-consulta-pasada { 
        display: block !important; 
        position: relative !important; 
        width: 100% !important; 
        height: auto !important; 
        background: #ffffff !important; 
        color: #000000 !important; 
        overflow: visible !important; 
    }

    #view-resultado-examen *, #view-consulta-pasada * { visibility: visible; }
    
    .no-print { display: none !important; }

    .bloque-print {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 24px;
        color: #000000 !important;
    }
}



/* Animación suave para elementos del nuevo modal */
#modal-confirmar-reinicio-vlp .modal-content {
    animation: modalPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Forzar que las vistas de examen ocupen el alto exacto del dispositivo y permitan scroll */
.fullscreen-view {
    height: 100dvh !important;
    overflow-y: auto; 
    overflow-x: hidden; 
}


/* Scroll suave y estético para el bloque de preguntas internas */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 10px;
    opacity: 0.3;
}

/* ======================================================== */
/*  ADAPTACIÓN PREMIUM DE LA TARJETA DE LA FLAMA HORIZONTAL  */
/* ======================================================== */

.tarjeta-vela-premium {
    position: relative;
    margin-left: auto;
    margin-right: auto;
    width: 100% !important; 
    max-width: 440px;
    padding: 22px 24px; /* Incrementamos padding para mayor confort */
    border-radius: 2.2rem; /* Curvatura limpia inspirada en la app litúrgica */
    border: 1px solid rgba(212, 175, 55, 0.25);
    background: var(--card-bg) !important;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.12);
    
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 20px !important;
    overflow: hidden;
    transition: all 0.5s ease;
    margin-top: 5px !important; 
}

.vela-aura-glow {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    background: rgba(212, 175, 55, 0.22);
    border-radius: 50%;
    pointer-events: none;
    transition: all 0.5s ease;
    z-index: 1;
}

.vela-lado-izquierdo {
    position: relative;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 76px; /* Ampliado para dar soporte al nuevo tamaño de la flama */
    height: 76px;
    flex-shrink: 0;
    z-index: 2;
}

.flama-imagen-viva {
    width: 70px; /* Flama expandida para mayor presencia visual */
    height: 70px;
    object-fit: contain !important;
    user-select: none;
    transition: all 0.5s ease;
}

.vela-lado-derecho {
    flex-grow: 1;
    display: flex !important;
    flex-direction: column !important; 
    justify-content: center;
    text-align: left !important;
    position: relative;
    z-index: 2;
    padding-left: 4px !important;
}

/* Ajustes finos de protección en pantallas pequeñas de smartphones */
@media (max-width: 380px) {
    .tarjeta-vela-premium {
        padding: 16px 18px;
        gap: 14px !important;
        border-radius: 1.8rem;
    }
    .vela-lado-izquierdo {
        width: 64px;
        height: 64px;
    }
    .flama-imagen-viva {
        width: 58px;
        height: 58px;
    }
}


/* ======================================================== */
/* IMAGEN TOTAL CON DESVANECIMIENTO Y TEXTO SUPERPUESTO      */
/* ======================================================== */

.contenedor-imagen-calida-total {
    width: 100%;
    height: 160px; /* Incrementado para que la tipografía respire */
    position: relative;
    margin: 0;
    padding: 0;
    
    /* Máscara lineal tersa para el desvanecimiento superior */
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.1) 15%, rgba(0,0,0,1) 100%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.1) 15%, rgba(0,0,0,1) 100%);
}

.imagen-calida-horizontal {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.absoluto-centrado-texto {
    position: absolute;
    bottom: 30px; 
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 10;
    padding: 0 20px;
}

/* ======================================================== */
/* NUEVAS REGLAS: OPTIMIZACIÓN DE VISIBILIDAD EN HISTORIAL  */
/* ======================================================== */

#contenedor-historial-gregoriano p.text-xs {
    font-size: 0.85rem !important; /* Incrementa la visibilidad de la fecha */
    font-weight: 600;
}

#contenedor-historial-gregoriano p.text-\[11px\] {
    font-size: 0.8rem !important; /* Incrementa la visibilidad del contador de faltas */
    font-weight: 600;
    opacity: 0.85 !important;
}

#contenedor-historial-gregoriano button {
    font-size: 0.75rem !important; /* Ajuste del botón Consultar */
    padding: 10px 14px !important;
}

/* ======================================================== */
/* CAROUSEL NATIVO DESLIZABLE Y PREMIUM PARA EL TUTORIAL     */
/* ======================================================== */

.contenedor-carrusel-tutorial {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    height: auto;
}

.contenedor-carrusel-tutorial::-webkit-scrollbar {
    display: none;
}
.contenedor-carrusel-tutorial {
    -ms-overflow-style: none;  
    scrollbar-width: none;  
}

.class-tarjeta-tutorial {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: block !important; 
    box-sizing: border-box;
}

/* MARCO CONTRASTANTE: Soluciona el problema de las fotos con fondo blanco */
.marco-foto-tutorial-protector {
    width: 100%;
    padding: 16px 16px 0 16px; /* Deja espacio elegante arriba y a los lados */
    box-sizing: border-box;
}

.contenedor-foto-tutorial-total {
    width: 100%;
    height: 190px; 
    position: relative;
    margin: 0;
    padding: 0;
    border-radius: 1.2rem; /* Redondeado interior armonioso */
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.45); /* Capa oscura de contraste de fondo */
    border: 1px solid rgba(212, 175, 55, 0.15); /* Marco dorado muy fino */
    
    /* El desvanecimiento se aplica al contenedor para fusionarse con el fondo negro del marco */
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 75%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 75%, rgba(0,0,0,0) 100%);
}

.foto-tutorial-horizontal {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.punto-indicador {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(212, 175, 55, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.punto-indicador.activo {
    background-color: var(--gold);
    width: 18px; 
    border-radius: 4px;
}
