body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

/* Estilo para todos los h2 de sección */
h2 {
    text-align: center;
    color: #444; /* Un poco más suave que h1 */
    margin-top: 30px; /* Espacio antes del título de sección */
    margin-bottom: 15px;
}

/* Estilos para cualquier .input-section */
.input-section {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
}

/* Estilo para todos los input de texto dentro de .input-section */
.input-section input[type="text"] {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* Estilo para todos los botones dentro de .input-section */
.input-section button {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    white-space: nowrap; /* Para que el texto del botón no se parta si es un poco más largo */
}

.input-section button:hover {
    background-color: #0056b3;
}

.input-section button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.status-message {
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
}

.status-message.loading {
    background-color: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #0050b3;
}

.status-message.error {
    background-color: #fff1f0;
    border: 1px solid #ffa39e;
    color: #cf1322;
}

.status-message.success {
    background-color: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #389e0d;
}

.results-container {
    margin-top: 20px;
}

.result-item {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.result-item h3 {
    margin-top: 0;
    color: #0050b3;
    font-size: 1.1em;
}

.result-item p {
    white-space: pre-wrap; /* Para conservar saltos de línea en la respuesta de OpenAI */
    font-size: 0.95em;
    color: #555;
}

.contexto-original {
    background-color: #f0f0f0; /* Un gris ligeramente más oscuro que result-item para diferenciar */
    border: 1px solid #e0e0e0;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
}

.contexto-original pre {
    margin: 0;
    font-family: inherit;
    white-space: pre-wrap;  /* Conserva saltos y espacios, y ajusta líneas largas. */
    word-wrap: break-word; /* Ayuda adicional para romper palabras largas si es necesario */
    font-size: 0.9em; /* Ligeramente más pequeño para diferenciarlo del texto principal */
    color: #444; /* Un gris un poco más oscuro que el p normal */
}

.referencias-biblicas-container {
    background-color: #f0f0f0; /* Mismo color que contexto-original */
    border: 1px solid #e0e0e0;    /* Mismo borde que contexto-original */
    padding: 10px;
    margin-top: 5px; /* Un poco menos de margen superior que el header h4 */
    border-radius: 4px;
}

.referencias-biblicas-list {
    list-style-type: disc;
    padding-left: 20px; /* Indentación para los bullets dentro del contenedor */
    margin: 0; /* Eliminar margen de la lista ul para que se ajuste al contenedor */
    font-size: 0.85em; /* Reducir un poco más si es necesario, o igual que contexto pre */
    color: #444;
}

.referencias-biblicas-list li {
    margin-bottom: 5px;
}

/* Estilos para Ayudas de Estudio por Párrafo */
.ayuda-parrafo-details {
    margin-top: 15px;
    border: 1px solid #d1e7dd; /* Verde claro, tema educativo */
    border-radius: 4px;
}

.ayuda-parrafo-details summary {
    padding: 10px;
    background-color: #f0f9f4; /* Fondo muy claro para el summary */
    font-weight: bold;
    cursor: pointer;
    border-bottom: 1px solid #d1e7dd; /* Línea separadora si está cerrado */
}

.ayuda-parrafo-details[open] summary {
    border-bottom: 1px solid #d1e7dd;
}

.ayuda-parrafo-contenido {
    padding: 15px;
    background-color: #f8fefc;
}

.ayuda-parrafo-contenido h5 {
    color: #0a512e; /* Verde oscuro */
    margin-top: 10px;
    margin-bottom: 5px;
    border-bottom: 1px dotted #b6dcc8;
    padding-bottom: 3px;
}

.ayuda-parrafo-contenido pre {
    background-color: #eef7f3;
    padding: 8px;
    border-radius: 3px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.9em;
    color: #333;
    margin-bottom: 10px;
}

.ideas-claves-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.ideas-claves-table th, .ideas-claves-table td {
    border: 1px solid #c3e0d1;
    padding: 8px;
    text-align: left;
}

.ideas-claves-table th {
    background-color: #e1f3e9;
    color: #0a512e;
    font-weight: bold;
}

.ideas-claves-table td:first-child {
    width: 60%; /* Más espacio para la idea principal */
}

/* Estilos para Preguntas Clave */
.preguntas-clave-list {
    list-style-type: decimal; /* Números para las preguntas */
    padding-left: 20px;
    margin-top: 5px;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.preguntas-clave-list li {
    margin-bottom: 6px;
    line-height: 1.4;
}

.info-text {
    font-size: 0.85em;
    color: #555;
    margin-top: -10px; /* Acercarlo un poco al input section */
    margin-bottom: 20px;
    text-align: center;
}

.section-divider {
    margin-top: 30px;
    margin-bottom: 30px;
    border: 0;
    border-top: 1px solid #ddd;
}

/* Estilos para el texto de los subtítulos */
.subtitles-text {
    white-space: pre-wrap; /* Conservar saltos de línea y ajustar líneas largas */
    word-wrap: break-word;
    background-color: #f8f9fa; /* Fondo claro */
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-family: monospace; /* Opcional: usar monoespacio para VTTs */
    font-size: 0.9em;
    line-height: 1.5;
    max-height: 400px; /* Opcional: limitar altura y añadir scroll si es muy largo */
    overflow-y: auto;   /* Opcional: scroll vertical */
}

/* Estilos para botón secundario */
.secondary-button {
    background-color: #6c757d !important;
    color: white !important;
    border: none !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    margin-left: 10px !important;
}

.secondary-button:hover {
    background-color: #5a6268 !important;
}

/* Estilos para modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

/* Estilos para contenedor de historial */
.historial-container {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.historial-item {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 15px;
    padding: 15px;
    background-color: #fff;
    transition: box-shadow 0.2s;
}

.historial-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.historial-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.historial-item-title {
    font-weight: bold;
    color: #333;
    margin: 0;
    flex: 1;
    margin-right: 15px;
}

.historial-item-fecha {
    color: #666;
    font-size: 0.9em;
    white-space: nowrap;
}

.historial-item-url {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
    word-break: break-all;
}

.historial-item-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.historial-empty {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px;
}

/* ===========================================
   ESTILOS RESPONSIVOS
   =========================================== */

/* Tablets y pantallas medianas */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        border-radius: 6px;
    }

    .input-section {
        flex-direction: column;
        gap: 15px;
    }

    .input-section input[type="text"] {
        width: 100%;
        font-size: 16px; /* Prevenir zoom en iOS */
    }

    .input-section button {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    h2 {
        font-size: 20px;
        margin-top: 25px;
    }

    .result-item {
        padding: 12px;
        margin-bottom: 12px;
    }

    .ayuda-estudio {
        margin-bottom: 20px;
        padding: 12px;
        border-radius: 6px;
    }

    .ayuda-estudio h4 {
        font-size: 15px;
    }

    .pregunta-respuesta {
        margin-left: 15px;
        padding: 8px;
    }

    .pregunta {
        font-weight: 600;
        font-size: 14px;
    }

    .respuesta {
        font-size: 13px;
    }
}

/* Móviles */
@media (max-width: 480px) {
    body {
        padding: 5px;
        font-size: 14px;
    }

    .container {
        padding: 10px;
        border-radius: 4px;
        margin: 5px;
    }

    h1 {
        font-size: 20px;
        margin-bottom: 10px;
    }

    h2 {
        font-size: 18px;
        margin-top: 20px;
        margin-bottom: 10px;
    }

    .input-section {
        margin-bottom: 15px;
    }

    .input-section input[type="text"] {
        padding: 8px;
        font-size: 16px;
    }

    .input-section button {
        padding: 10px;
        font-size: 16px;
    }

    .status-message {
        margin-bottom: 15px;
        padding: 8px;
        font-size: 14px;
    }

    .result-item {
        padding: 10px;
        margin-bottom: 10px;
        border-radius: 4px;
    }

    .result-item h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .result-item p {
        font-size: 14px;
    }

    .contexto-original {
        padding: 8px;
        margin-top: 8px;
    }

    .contexto-original pre {
        font-size: 13px;
    }

    .referencias-biblicas-container {
        padding: 8px;
        margin-top: 4px;
    }

    .referencias-biblicas-list {
        font-size: 12px;
        padding-left: 15px;
    }

    .ayuda-estudio {
        margin-bottom: 15px;
        padding: 10px;
        border-radius: 4px;
    }

    .ayuda-estudio h4 {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .pregunta-respuesta {
        margin-left: 10px;
        padding: 6px;
        margin-bottom: 8px;
    }

    .pregunta {
        font-weight: 600;
        font-size: 13px;
        margin-bottom: 4px;
    }

    .respuesta {
        font-size: 12px;
        line-height: 1.4;
    }

    .compactado {
        font-size: 13px;
    }

    .compactado strong {
        font-size: 14px;
    }
}

/* Móviles muy pequeños */
@media (max-width: 360px) {
    body {
        font-size: 13px;
        padding: 3px;
    }

    .container {
        padding: 8px;
        margin: 2px;
    }

    h1 {
        font-size: 18px;
    }

    h2 {
        font-size: 16px;
    }

    .ayuda-estudio {
        padding: 8px;
    }

    .ayuda-estudio h4 {
        font-size: 13px;
    }

    .pregunta {
        font-size: 12px;
    }

    .respuesta {
        font-size: 11px;
    }

    .compactado {
        font-size: 12px;
    }

    .compactado strong {
        font-size: 13px;
    }
}

/* Orientación landscape en móviles */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        margin: 10px auto;
        max-width: 95%;
    }

    .ayuda-estudio {
        margin-bottom: 12px;
    }

    .pregunta-respuesta {
        margin-bottom: 6px;
    }
}

/* Dispositivos grandes (desktop) */
@media (min-width: 1200px) {
    .container {
        max-width: 1000px;
        padding: 30px;
    }

    .result-item {
        padding: 20px;
    }

    .ayuda-estudio {
        padding: 20px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .container {
        box-shadow: 0 0 15px rgba(0,0,0,0.05);
    }

    .result-item {
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }
} 