/* MODIFICARE 3 — stiluri pentru secțiunea „Informatică”.
   Folosește și clasele din teorie.css (theory-block, theory-heading, plain-list, pi-table). */

/* În antet sunt acum 6 linkuri: pe telefon trec pe două rânduri. */
@media (max-width: 760px) {
    .site-header nav {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 6px 18px;
        overflow: visible;
    }
}

/* Blocurile din această secțiune au experimentul pe toată lățimea, sub text. */
.info-block {
    grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
}
.info-block > .workbench,
.info-block > .code-details,
.info-block > .connection {
    grid-column: 1 / -1;
}
.info-block > .code-details {
    margin-top: 0;
}
.info-block > .connection {
    padding-top: 0;
}
.info-workbench .canvas-panel > canvas {
    min-height: 380px;
}
.info-workbench .control-panel .button-row {
    flex-wrap: wrap;
}
.info-message {
    margin: 16px 0 0;
    padding-left: 12px;
    border-left: 3px solid var(--orange);
    font-size: 15px;
    line-height: 1.7;
    min-height: 26px;
}
.info-message:empty {
    display: none;
}
.info-legend {
    justify-content: flex-start;
    gap: 6px 18px;
}
.key {
    display: inline-block;
    width: 14px;
    height: 10px;
    margin-right: 6px;
    vertical-align: -1px;
}
.key-current {
    border: 2px solid var(--ink);
}
.key-waiting {
    border: 2px solid rgba(62, 91, 156, 0.7);
}
.key-waiting.dashed {
    border-style: dashed;
}
.key-drawn {
    background: var(--orange);
}
.key-visited {
    background: var(--green);
    border-radius: 50%;
    width: 11px;
    height: 11px;
}
.key-queued {
    background: var(--blue);
    border-radius: 50%;
    width: 11px;
    height: 11px;
}
.key.key-current.round,
.tree-panel .key-current {
    background: var(--orange);
    border: 0;
    border-radius: 50%;
    width: 11px;
    height: 11px;
}

/* Stiva desenată ca o listă de „cutii”. */
.stack-box,
.order-box {
    margin-top: 18px;
}
.stack-title {
    display: block;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.6px;
    color: var(--muted);
    margin-bottom: 8px;
    text-transform: uppercase;
}
.stack-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 240px;
    overflow-y: auto;
}
.stack-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 6px 10px;
    margin-bottom: 4px;
    border: 1px solid var(--line);
    background: #f8f6f0;
    font-size: 13px;
    color: var(--muted);
}
.stack-list li code {
    color: var(--ink);
    font-size: 13px;
}
.stack-list li.top {
    border-color: var(--ink);
    background: #fff;
}
.stack-list li.top code {
    color: var(--orange);
    font-weight: 600;
}
.stack-empty {
    font-size: 14px;
    color: var(--muted);
    padding: 6px 0;
}
.counter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    margin: 20px 0 0;
}
.counter-grid dt {
    font-size: 12px;
    color: var(--muted);
}
.counter-grid dd {
    margin: 2px 0 0;
    font-family: var(--serif);
    font-size: 30px;
    line-height: 1.1;
}

/* I3 */
.cx-panel {
    background: #eae9e0;
}
.cx-table-wrap {
    padding: 16px 19px 6px;
    overflow-x: auto;
}
.cx-table td,
.cx-table th {
    padding-left: 8px;
    padding-right: 8px;
}
.cx-panel > canvas,
.info-workbench .cx-panel > canvas {
    min-height: 160px;
    height: 170px;
    flex: none;
}
.cx-choice {
    flex-wrap: wrap;
}
.cx-choice label {
    min-width: 45%;
}

/* I4 */
.queue-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 34px;
}
.queue-boxes span {
    min-width: 34px;
    padding: 5px 7px;
    text-align: center;
    background: var(--blue);
    color: #fff;
    font-family: Consolas, monospace;
    font-size: 14px;
}
.queue-boxes[data-mode='dfs'] span:last-child,
.queue-boxes[data-mode='bfs'] span:first-child {
    background: var(--ink);
}
.order-box p {
    font-family: Consolas, monospace;
    font-size: 14px;
    line-height: 1.7;
    word-spacing: 2px;
    color: var(--ink);
}

/* I5 */
.ls-panel {
    background: #eef0ec;
}
.ls-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}
.ls-fields label,
.ls-rules-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}
.ls-rules-label {
    margin-top: 12px;
}
.ls-fields input,
.ls-rules-label textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #bfc1b4;
    background: #fff;
    color: var(--ink);
    font-family: Consolas, 'Courier New', monospace;
    font-size: 15px;
    border-radius: 0;
}
.ls-rules-label textarea {
    resize: vertical;
    min-height: 64px;
}
.ls-draw {
    margin-top: 14px;
    width: 100%;
}
.ls-preview {
    font-size: 12px !important;
    word-break: break-all;
    max-height: 92px;
    overflow: hidden;
}

/* I6 */
.bc-panel {
    background: #eae9e0;
}
.info-workbench .bc-panel > canvas {
    min-height: 460px;
}
.bc-choice {
    flex-wrap: wrap;
}
.bc-choice label {
    min-width: 45%;
}
.bc-results {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    margin-top: 18px;
    align-items: start;
}
.bc-table {
    font-size: 13px;
}
.bc-table td,
.bc-table th {
    padding: 4px 8px;
}
#bc-plot {
    width: 100%;
    height: 200px;
    background: #f8f6f0;
    border: 1px solid var(--line);
}
.counter-grid.two dd {
    font-size: 26px;
}
#bc-run {
    margin-top: 6px;
}

@media (max-width: 1050px) {
    .info-block {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 760px) {
    .info-workbench .canvas-panel > canvas {
        height: 320px;
        min-height: 320px;
    }
    .info-workbench .bc-panel > canvas {
        height: 340px;
        min-height: 340px;
    }
    .info-workbench .cx-panel > canvas {
        height: 150px;
        min-height: 150px;
    }
    .bc-results {
        grid-template-columns: 1fr;
    }
    .counter-grid dd {
        font-size: 26px;
    }
}
@media print {
    .info-workbench .button-row,
    .ls-fields,
    .ls-rules-label {
        display: none !important;
    }
}

/* Titlurile capitolelor de aici nu rămân lipite sus, ca să nu acopere experimentul. */
.info-block .theory-heading {
    position: static;
}
.info-message + .explain {
    margin-top: 14px;
}
.counter-grid.two dd {
    font-size: 22px;
}

/* MODIFICARE 5 (corectură): pe telefon, codul C++ lat nu mai împinge capitolul în afara ecranului.
   Un element dintr-un grid are implicit lățimea minimă egală cu conținutul; aici o lăsăm să scadă. */
.theory-block > *,
.info-block > * {
    min-width: 0;
}
