/* SKOS Relation Triple Builder - vis-network MicroSim Stylesheet
 * =============================================================
 * Rows: title / progress / two-node graph (flex) / fixed feedback / controls.
 * The feedback row is a fixed height so revealing an answer never shifts the
 * buttons under the learner's cursor.
 */

/* Must stay in sync with CANVAS_HEIGHT in skos-relation-triple-builder.js */
:root {
    --sim-height: 490px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: aliceblue;
}

.container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: var(--sim-height);
    padding: 6px 8px 8px 8px;
    gap: 6px;
}

/* ===========================================
   TITLE
   =========================================== */
.title {
    flex: 0 0 auto;
    text-align: center;
    font-size: 17px;
    font-weight: bold;
    color: black;
    line-height: 1.2;
}

/* ===========================================
   PROGRESS ROW
   =========================================== */
.progress-row {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 5px 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-text {
    font-size: 13px;
    font-weight: bold;
    color: #37474f;
    white-space: nowrap;
}

.dots {
    display: flex;
    gap: 5px;
}

.dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background-color: #e0e0e0;
    border: 1.5px solid #b0bec5;
}

.dot.correct {
    background-color: #4caf50;
    border-color: #2e7d32;
}

.dot.wrong {
    background-color: #e53935;
    border-color: #b71c1c;
}

.dot.active {
    border-color: #1565c0;
    border-width: 2.5px;
}

.score {
    font-size: 12px;
    font-weight: bold;
    color: #546e7a;
    white-space: nowrap;
}

/* ===========================================
   GRAPH PANEL (two concept boxes + one arrow)
   =========================================== */
.graph-panel {
    flex: 1 1 auto;
    min-height: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

#network {
    width: 100%;
    height: 100%;
    background-color: aliceblue;
}

/* ===========================================
   FEEDBACK BANNER (fixed height, no layout shift)
   =========================================== */
.feedback {
    flex: 0 0 auto;
    height: 74px;
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.97);
    border-radius: 8px;
    border: 2px solid transparent;
    padding: 6px 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 12px;
    line-height: 1.45;
    color: #263238;
    overflow: hidden;
}

.feedback.correct {
    border-color: #4caf50;
    background-color: #f5fbf5;
}

.feedback.wrong {
    border-color: #e53935;
    background-color: #fff8f7;
}

.feedback.done {
    border-color: #ffa000;
    background-color: #fffdf5;
}

.fb-idle {
    width: 100%;
    text-align: center;
    color: #78909c;
    font-size: 12.5px;
}

.fb-head {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 2px;
}

.fb-head.correct { color: #2e7d32; }
.fb-head.wrong   { color: #c62828; }

.fb-body {
    font-size: 12px;
    line-height: 1.45;
}

.triple {
    font-family: "Courier New", Courier, monospace;
    font-weight: bold;
    background-color: #eceff1;
    border-radius: 3px;
    padding: 0 4px;
    white-space: nowrap;
}

/* ===========================================
   SCORECARD (after all six pairs)
   =========================================== */
.card-rows {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.card-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    line-height: 1.3;
}

.card-mark {
    font-weight: bold;
    width: 11px;
    flex-shrink: 0;
}

.card-mark.ok { color: #2e7d32; }
.card-mark.no { color: #c62828; }

.card-pair {
    font-family: "Courier New", Courier, monospace;
    color: #37474f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===========================================
   CONTROLS
   =========================================== */
.controls {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 7px 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.relation-buttons,
.nav-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    white-space: nowrap;
}

.btn-rel {
    background-color: #1e88e5;
    color: white;
}

.btn-rel:hover:not(:disabled) {
    background-color: #1565c0;
}

.btn-rel:disabled {
    background-color: #cfd8dc;
    color: #90a4ae;
    cursor: not-allowed;
}

.btn-swap {
    background-color: #7e57c2;
    color: white;
}

.btn-swap:hover:not(:disabled) {
    background-color: #5e35b1;
}

.btn-swap:disabled {
    background-color: #cfd8dc;
    color: #90a4ae;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #43a047;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2e7d32;
}

.btn-primary:disabled {
    background-color: #cfd8dc;
    color: #90a4ae;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #757575;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #616161;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 500px) {
    .title {
        font-size: 14px;
    }

    /* spec: relation buttons wrap to two rows below 500px */
    .controls {
        justify-content: center;
        gap: 5px;
        padding: 5px 6px;
    }

    .relation-buttons,
    .nav-buttons {
        justify-content: center;
        width: 100%;
    }

    .btn {
        padding: 6px 9px;
        font-size: 11px;
    }

    .progress-text,
    .score {
        font-size: 11px;
    }

    .score {
        display: none;
    }

    .feedback {
        height: 78px;
        font-size: 11px;
    }
}
