/* css/ope.css — Portal OPE: ventana del simulador, páginas de especialidad e índice. Va después de psq.css. */

/* Variables que usa ope_portal.js */
:root { --primary: var(--brand, #2560a5); --card: var(--surface, #fff); }

/* --- Ventana del simulador --- */
#modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .8); display: none; justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background: var(--surface, #fff); width: 95%; max-width: 800px; max-height: 90vh; border-radius: 12px; display: flex; flex-direction: column; overflow-y: auto; position: relative; }
#cronometro-container { display: none; background: var(--brand-grad, #2560a5); color: #fff; font-family: monospace; font-size: 1.2rem; padding: 10px 20px; text-align: center; font-weight: bold; position: sticky; top: 0; z-index: 1001; box-shadow: 0 2px 5px rgba(0, 0, 0, .2); }
.btn-cerrar-modal { position: absolute; top: 15px; right: 20px; background: none; border: none; font-size: 24px; color: var(--text-muted); cursor: pointer; z-index: 1002; }

/* --- Cabecera de la página de especialidad --- */
.ope-miga { font-size: .85rem; opacity: .85; margin: 0 0 .5rem; }
.ope-miga a { color: inherit; }
.ope-botones { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.5rem; }
.ope-botones .psq-btn { margin: 0; }
.ope-btn-sec { background: transparent !important; color: var(--brand) !important; border: 2px solid var(--brand) !important; box-shadow: none !important; }

/* --- Listado de preguntas --- */
.ope-main { max-width: 860px; margin: 0 auto 3rem; padding: 0 1rem; }
.ope-conv { margin-top: 2.5rem; }
.ope-conv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 2px solid var(--border); padding-bottom: .5rem; }
.ope-conv-head h2 { margin: 0; font-size: 1.3rem; color: var(--text-main); }
.ope-num { font-size: .85rem; color: var(--text-muted); font-weight: 700; }
.ope-conv-txt { font-size: .92rem; color: var(--text-muted); line-height: 1.5; }
.ope-conv-acciones { display: flex; flex-wrap: wrap; gap: .6rem; margin: .4rem 0 0; }
.ope-conv-acciones .psq-btn { margin: 0; }
.ope-preguntas[hidden] { display: none; }
.ope-listado { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .9rem; }
.ope-preg { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 14px; padding: 1rem 1.1rem; }
.ope-preg .enunciado { margin: 0 0 .6rem; font-weight: 700; color: var(--text-main); line-height: 1.45; }
.ope-preg .opciones { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.ope-preg .opciones li { font-size: .93rem; color: var(--text-main); line-height: 1.45; padding: .25rem .5rem; border-radius: 8px; }
.ope-preg .opciones b { color: var(--text-muted); margin-right: .2rem; }
.ope-preg details { margin-top: .6rem; font-size: .9rem; color: var(--text-muted); }
.ope-preg summary { cursor: pointer; font-weight: 700; color: var(--brand); }
.ope-preg details p { margin: .4rem 0 0; line-height: 1.5; }
/* La opción correcta solo se resalta al desplegar la respuesta */
.ope-preg:has(details[open]) .opciones li.ok { background: rgba(34, 197, 94, .12); }
.ope-cargando, .ope-error { color: var(--text-muted); font-size: .92rem; padding: 1rem; }

/* --- Enlaces a otras especialidades y al índice --- */
.ope-otras { margin-top: 3rem; }
.ope-otras h2, .ope-indice h2 { font-size: 1.15rem; color: var(--text-main); margin: 0 0 .8rem; }
.ope-otras div { display: flex; flex-wrap: wrap; gap: .5rem; }
.ope-otras a { font-size: .88rem; padding: .35rem .75rem; border: 1px solid var(--border); border-radius: 999px; color: var(--text-main); text-decoration: none; background: var(--surface, #fff); }
.ope-otras a:hover { border-color: var(--brand); color: var(--brand); }
/* Parte Común: primera y con un tono distinto */
.ope-otras a.ope-comun { background: rgba(217, 119, 6, .08); border-color: rgba(217, 119, 6, .4); }
.ope-indice li.ope-comun a { background: rgba(217, 119, 6, .08); border-color: rgba(217, 119, 6, .4); }

.ope-indice { margin-top: 2.5rem; }
.ope-indice ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; }
.ope-indice a { display: flex; flex-direction: column; gap: .15rem; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface, #fff); text-decoration: none; color: var(--text-main); }
.ope-indice a:hover { border-color: var(--brand); }
.ope-indice a span { font-size: .8rem; color: var(--text-muted); }
