/* === ESTILOS GENERALES Y TIPOGRAFÍA === */
:root {
    /* Colores base para legibilidad */
    --text-main: #1a1a2e; /* Azul marino profundo para secciones */
    --text-timer: #fdfcf0; /* Blanco hueso para el cronómetro */
    --bg-base: #f4f4f4;
}
body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: #333;
    font-size: clamp(16px, 1.8vw, 18px);
    background-color: #f4f4f4; /* Un fondo base por si acaso */
}

/* === CRONÓMETRO FIJO === */
.timer-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #4158d0 0%, #c850c0 46%, #ffcc70 100%);
    color: var(--text-timer);
    padding: 15px;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.timer {
    font-size: clamp(2rem, 5.5vw, 2.5rem);
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.timer:hover {
    transform: scale(1.05);
}

.timer-controls {
    margin-top: 10px;
}

.timer-btn {
    background: rgba(255,255,255,0.15);
    border: 2px solid var(--text-timer);
    color: var(--text-timer);
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.timer-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* === CONTENIDO PRINCIPAL === */
.main-content {
    margin-top: 120px; /* Margen para el cronómetro */
    padding: 20px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* === ESTILOS DE SECCIONES CON GRADIENTES === */
.section {
    position: relative;
    margin: 30px 0;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    color: #1a1a2e; /* Color oscuro por defecto para texto legible */
}

.section:hover {
    transform: translateY(-5px);
}

.section h1, .section h2, .section h3, .section h4 {
    font-family: 'Georgia', 'Times New Roman', serif;
}

.section h2 {
    margin-bottom: 20px;
    font-size: clamp(1.6rem, 4.5vw, 2.5rem);
    text-align: center;
}

.section p {
    margin-bottom: 15px;
    font-size: clamp(1rem, 2.2vw, 1.2rem); /* Aumentado para legibilidad */
}

.section ul {
    margin: 15px 0;
    padding-left: 25px;
    list-style-type: square;
}

.section li {
    margin-bottom: 10px;
    font-size: clamp(0.95rem, 2vw, 1.1rem);
}

/* Citas bíblicas reutilizables */
.verse {
    background: rgba(255,255,255,0.18);
    padding: clamp(12px, 2.2vw, 16px);
    border-left: clamp(3px, 0.6vw, 4px) solid rgba(0,0,0,0.15);
    margin: 10px 0;
    font-style: italic;
    border-radius: 8px;
}

/* Colores de las secciones — !important para ganar ante cualquier caché o herencia */
.section-1 { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); color: #2c1810 !important; }
.section-2 { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); color: #1a1a2e !important; }
.section-3 { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); color: #2c1810 !important; }
.section-4 { background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%); color: #1a1a2e !important; }
.section-5 { background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%); color: #1a1a2e !important; }
.section-6 { background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%); color: #1a1a2e !important; }
.section-7 { background: linear-gradient(135deg, #f6d365 0%, #fda085 100%); color: #2c1810 !important; }

/* Eliminados overrides de color que causaban baja legibilidad */


/* === TOOLTIP PARA CITAS BÍBLICAS === */
.cita-hover {
    position: relative;
    cursor: help;
    text-decoration: underline;
    text-decoration-style: dotted;
    font-weight: bold; /* Hacer la cita más visible */
}

.texto-biblico {
    visibility: hidden;
    opacity: 0;
    width: 300px;
    background-color: #3a3a3a;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -150px;
    transition: opacity 0.3s;
    font-size: 0.9rem;
    line-height: 1.5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Usar sans-serif para el tooltip */
    font-style: normal;
}

.cita-hover:hover .texto-biblico,
.cita-hover.active .texto-biblico {
    visibility: visible;
    opacity: 1;
}

/* === TOOLTIP PARA AUTORES === */
.autor-hover {
    position: relative;
    cursor: help;
    text-decoration: underline;
    text-decoration-style: dotted;
    font-weight: bold;
}

.autor-desc {
    visibility: hidden;
    opacity: 0;
    width: 250px;
    background-color: #2c3e50;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -125px;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    line-height: 1.4;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-style: normal;
    font-weight: normal;
}

.autor-hover:hover .autor-desc,
.autor-hover.active .autor-desc {
    visibility: visible;
    opacity: 1;
}

/* === OTROS ELEMENTOS === */
.volver-link {
    display: inline-block;
    margin-top: 1.5em;
    padding: 0.5em 1em;
    border: 1px solid;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s;
}
.volver-link:hover {
    background: rgba(0,0,0,0.1);
}

/* === DISEÑO RESPONSIVO === */
@media (max-width: 768px) {
    body {
        font-size: clamp(15px, 4.2vw, 16px);
    }
    .timer {
        font-size: clamp(1.6rem, 6vw, 2rem);
    }
    .main-content {
        margin-top: 110px;
        padding: 10px;
    }
    .section {
        padding: 20px;
        margin: 20px 0;
    }
    .section h2 {
        font-size: clamp(1.3rem, 5.5vw, 2rem);
    }
    .section p {
        font-size: clamp(0.95rem, 2.8vw, 1.1rem);
    }
    .texto-base blockquote {
        font-size: 1.2rem;
    }

    /* --- MEJORA: Tooltips tipo Bottom Sheet en Móviles --- */
    .texto-biblico, .autor-desc {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 40vh;
        overflow-y: auto;
        margin: 0;
        border-radius: 20px 20px 0 0;
        padding: 25px 20px;
        background: rgba(30,30,30,0.96);
        backdrop-filter: blur(8px);
        box-shadow: 0 -10px 40px rgba(0,0,0,0.4);
        z-index: 2000; /* Por encima del cronómetro si es necesario */
        font-size: 1.1rem;
        border-top: 2px solid var(--text-timer);
        visibility: visible;
        opacity: 1;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .cita-hover:hover .texto-biblico, 
    .cita-hover.active .texto-biblico,
    .autor-hover:hover .autor-desc,
    .autor-hover.active .autor-desc {
        transform: translateY(0);
    }

    /* Ajuste para que el texto no se corte con el timer */
    .timer-container {
        padding: 10px 15px;
    }
}