/* ============================================================
   java_practica.css — estilos compartidos por los ejemplos de
   Java (páginas nuevas: operadores, control de flujo, métodos,
   strings, scanner, colecciones, excepciones, ficheros, hilos,
   moderno, estructuras de datos, algoritmos, regex, junit, http,
   maven, javafx).
   Se acota TODO a .tutorial-article para no filtrar al nav-bar.
   Color base: el del nav-bar, azul marino plano #2c3e50.
   ============================================================ */
.tutorial-article {
    --jp-grad: #2c3e50;
    --jp-ink: #2c3e50;
    --jp-body: #384049;
    --jp-muted: #5f6c72;
    --jp-border: #e6e8ee;
    --jp-bg-soft: #f7f8fb;
    --jp-accent: #2c3e50;
    --jp-ok: #1e8449;
    --jp-err: #c0392b;
    --jp-code-bg: #1e2530;
}

.tutorial-article .content-section { margin-bottom: 2.8rem; }
.tutorial-article .content-section > h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--jp-ink);
    margin: 0 0 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--jp-border);
    display: flex;
    align-items: center;
    gap: .6rem;
}
.tutorial-article .content-section > h2 i { color: var(--jp-accent); }
.tutorial-article .content-section > h3 {
    font-size: 1.15rem; color: var(--jp-ink); margin: 1.4rem 0 .6rem;
}
.tutorial-article .content-section p { line-height: 1.75; color: var(--jp-body); margin: 0 0 1rem; }
.tutorial-article .content-section ul,
.tutorial-article .content-section ol { margin: 0 0 1rem 1.3rem; line-height: 1.9; color: var(--jp-body); }
.tutorial-article .lead {
    font-size: 1.08rem; color: var(--jp-body); background: var(--jp-bg-soft);
    border-left: 4px solid #2c3e50; border-radius: 8px; padding: 1rem 1.2rem; margin-bottom: 1.6rem;
}

/* ---------- bloque de demo interactiva ---------- */
.jp-demo {
    border: 1px solid var(--jp-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
    margin: 1.3rem 0 1.8rem;
    overflow: hidden;
}
.jp-demo-head {
    background: var(--jp-grad);
    color: #fff;
    padding: .7rem 1.1rem;
    font-weight: 700;
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.jp-demo-head .jp-tag {
    margin-left: auto;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: rgba(255, 255, 255, .2);
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    padding: .15rem .6rem;
}
.jp-demo-body { padding: 1.1rem; }
.jp-demo-body > *:last-child { margin-bottom: 0; }

/* controles */
.jp-controls { display: flex; flex-wrap: wrap; gap: .7rem 1rem; align-items: flex-end; margin-bottom: 1rem; }
.jp-field { display: flex; flex-direction: column; gap: .25rem; }
.jp-field label { font-size: .8rem; font-weight: 700; color: var(--jp-muted); }
.jp-field input[type="text"],
.jp-field input[type="number"],
.jp-field select,
.jp-field textarea {
    font: inherit;
    padding: .5rem .65rem;
    border: 1px solid var(--jp-border);
    border-radius: 7px;
    background: #fff;
    color: var(--jp-ink);
    min-width: 8rem;
}
.jp-field textarea { min-width: 16rem; resize: vertical; font-family: 'Courier New', monospace; }
.jp-field input:focus, .jp-field select:focus, .jp-field textarea:focus {
    outline: 0; border-color: #2c3e50; box-shadow: 0 0 0 3px rgba(44, 62, 80, .15);
}
.jp-range-row { display: flex; align-items: center; gap: .6rem; }
.jp-range-row output { font-weight: 800; color: var(--jp-accent); min-width: 2.5rem; }

.jp-btn {
    font: inherit; font-weight: 700;
    padding: .55rem 1.1rem;
    border: 0; border-radius: 8px;
    background: var(--jp-grad); color: #fff;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.jp-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, .22); }
.jp-btn:active { transform: translateY(0); }
.jp-btn.jp-btn-ghost {
    background: #fff; color: var(--jp-accent); border: 1px solid var(--jp-border);
}
.jp-btn.jp-btn-ghost:hover { background: var(--jp-bg-soft); }
.jp-btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* consola de salida (simula la terminal de Java) */
.jp-console {
    background: var(--jp-code-bg);
    color: #d6d9e0;
    font-family: 'Courier New', Consolas, monospace;
    font-size: .9rem;
    line-height: 1.55;
    border-radius: 8px;
    padding: .9rem 1rem;
    min-height: 3rem;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}
.jp-console .jp-c-ok { color: #7ee2b8; }
.jp-console .jp-c-err { color: #ff9d9d; }
.jp-console .jp-c-dim { color: #8a90a6; }
.jp-console .jp-c-key { color: #c9a4ff; }
.jp-console .jp-c-num { color: #ffd479; }
.jp-console .jp-c-str { color: #9fe38f; }
.jp-console .jp-prompt { color: #7aa2ff; }

/* código estático */
.tutorial-article pre[class*="language-"] {
    border-radius: 10px; margin: 1rem 0; font-size: .88rem;
}
.jp-code-caption { font-size: .82rem; color: var(--jp-muted); margin: .2rem 0 .1rem; font-weight: 700; }

/* tabla de referencia */
.jp-table-wrap { overflow-x: auto; margin: 1rem 0; }
.jp-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.jp-table th, .jp-table td { padding: .55rem .7rem; border: 1px solid var(--jp-border); text-align: left; vertical-align: top; }
.jp-table th { background: var(--jp-bg-soft); color: var(--jp-ink); font-weight: 700; }
.jp-table code { background: rgba(44, 62, 80, .08); padding: .1em .4em; border-radius: 4px; }

/* pills / chips seleccionables */
.jp-pills { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0 1rem; }
.jp-pill {
    font: inherit; font-size: .85rem; font-weight: 700;
    padding: .35rem .8rem; border-radius: 999px;
    border: 1px solid var(--jp-border); background: #fff; color: var(--jp-muted);
    cursor: pointer; transition: all .15s ease;
}
.jp-pill.is-active { background: var(--jp-grad); color: #fff; border-color: transparent; }

/* nota / aviso */
.jp-note {
    border-left: 4px solid #f39c12; background: #fff8ec;
    padding: .8rem 1rem; border-radius: 8px; margin: 1rem 0; color: #5b4a2a; line-height: 1.6;
}
.jp-note.jp-note-tip { border-left-color: #27ae60; background: #ecf9f0; color: #1f5133; }
.jp-note.jp-note-warn { border-left-color: #e74c3c; background: #fdecea; color: #7b241c; }

/* mini-quiz */
.jp-quiz { border: 1px solid var(--jp-border); border-radius: 12px; padding: 1.1rem; background: var(--jp-bg-soft); }
.jp-quiz-q { font-weight: 700; color: var(--jp-ink); margin-bottom: .8rem; }
.jp-quiz-opts { display: flex; flex-direction: column; gap: .5rem; }
.jp-quiz-opt {
    display: block; padding: .6rem .8rem; border: 1px solid var(--jp-border);
    border-radius: 8px; background: #fff; cursor: pointer; transition: all .12s ease;
}
.jp-quiz-opt:hover { border-color: #2c3e50; }
.jp-quiz-opt.is-correct { border-color: var(--jp-ok); background: #eafaf1; }
.jp-quiz-opt.is-wrong { border-color: var(--jp-err); background: #fdecea; }
.jp-quiz-feedback { margin-top: .8rem; font-weight: 700; min-height: 1.2rem; }

/* visualizador genérico (celdas, cajas de memoria, etc.) */
.jp-viz { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.jp-cell {
    min-width: 3rem; padding: .5rem .4rem; text-align: center;
    border: 2px solid #2c3e50; border-radius: 8px; background: #fff;
    font-family: 'Courier New', monospace; font-weight: 700; color: var(--jp-ink);
    transition: background .2s ease, transform .2s ease;
}
.jp-cell .jp-cell-idx { display: block; font-size: .68rem; color: var(--jp-muted); font-weight: 600; }
.jp-cell.is-hot { background: #fff3cd; transform: translateY(-4px); }
.jp-cell.is-done { background: #eafaf1; border-color: #27ae60; }

.tutorial-article .article-header { text-align: center; margin-bottom: 2.4rem; }
.tutorial-article .article-title { font-size: clamp(1.8rem, 4vw, 2.4rem); color: var(--jp-ink); font-weight: 800; margin-bottom: .5rem; }
.tutorial-article .article-subtitle { color: var(--jp-muted); font-size: 1.05rem; }

/* navegación entre módulos */
.tutorial-article .module-navigation {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
    margin-top: 3rem; padding-top: 1.5rem; border-top: 2px dashed var(--jp-border);
}
.tutorial-article .module-navigation .nav-link {
    display: inline-flex; align-items: center; gap: .6rem; text-decoration: none;
    color: var(--jp-accent); font-weight: 700; padding: .7rem 1.2rem;
    border: 2px solid var(--jp-border); border-radius: 10px; transition: all .2s ease;
}
.tutorial-article .module-navigation .nav-link:hover { border-color: #2c3e50; transform: translateY(-2px); }

/* ---------- modo oscuro ---------- */
.dark-theme .tutorial-article .content-section > h2 { color: #e8eaed; border-bottom-color: #2e2e2e; }
.dark-theme .tutorial-article .content-section > h3 { color: #e2e4e8; }
.dark-theme .tutorial-article .content-section p,
.dark-theme .tutorial-article .content-section li { color: #c7ccd4; }
.dark-theme .tutorial-article .article-title { color: #e8eaed; }
.dark-theme .tutorial-article .lead { background: #1c1c28; color: #c7ccd4; }
.dark-theme .jp-demo { background: #1c1c1c; border-color: #2e2e2e; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.dark-theme .jp-field input, .dark-theme .jp-field select, .dark-theme .jp-field textarea {
    background: #262626; color: #e8eaed; border-color: #3a3a3a;
}
.dark-theme .jp-btn.jp-btn-ghost { background: #262626; color: #b8a6e0; border-color: #3a3a3a; }
.dark-theme .jp-table th { background: #262626; color: #e8eaed; }
.dark-theme .jp-table td { border-color: #3a3a3a; }
.dark-theme .jp-table th { border-color: #3a3a3a; }
.dark-theme .jp-pill { background: #262626; color: #b9bdc6; border-color: #3a3a3a; }
.dark-theme .jp-quiz { background: #181818; border-color: #2e2e2e; }
.dark-theme .jp-quiz-opt { background: #232323; border-color: #3a3a3a; color: #d4d7dd; }
.dark-theme .jp-quiz-q { color: #e8eaed; }
.dark-theme .jp-cell { background: #232323; color: #e8eaed; }
.dark-theme .jp-note { background: #2a2410; color: #e8d9b8; }
.dark-theme .jp-note.jp-note-tip { background: #14261b; color: #b6e2c6; }
.dark-theme .jp-note.jp-note-warn { background: #2a1512; color: #f0c3bc; }
.dark-theme .jp-code-caption, .dark-theme .jp-range-row output { color: #b8a6e0; }

@media (max-width: 560px) {
    .tutorial-article .content-section > h2 { font-size: 1.3rem; }
    .jp-field input, .jp-field select, .jp-field textarea { min-width: 0; width: 100%; }
    .jp-field { width: 100%; }
}
