/* Stijlen voor AI-nakijken (voortgang + cursusbeheer), bovenop style.css + exercises.css. */
/* AI-badges */
.ai-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.ai-busy { background: #fef3c7; color: #92400e; }
.ai-proposal { background: #ede9fe; color: #5b21b6; }
.ai-approved { background: #d1fae5; color: #065f46; }
.ai-unchecked { background: #ffedd5; color: #9a3412; }
.ai-none { background: #f1f5f9; color: var(--text-muted); }

/* Kleine "AI"/"⚠"-tekens in de voortgangstabel (module- en cursuszicht) */
.ai-badge.ai-mini {
    padding: 0.05rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: help;
}

.ai-col-markers {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.3rem;
}

.ai-cell-marker {
    margin-left: 0.35rem;
}

.ai-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ai-legend .ai-badge {
    margin-right: 0.25rem;
}

.stat-card.stat-ai {
    background: #f5f3ff;
    border-color: #c4b5fd;
}

.stat-card.stat-ai .stat-number {
    color: #5b21b6;
}

.stat-ai-unchecked {
    font-size: 0.9rem;
    color: #9a3412;
}

.ai-detail-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-detail-nav .help-text {
    margin: 0;
}

/* AI-voorstelblok */
.ai-panel {
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: #f5f3ff;
    border: 1px solid #c4b5fd;
    border-left: 4px solid #7c3aed;
    border-radius: var(--radius);
}

.ai-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ai-panel-header h4 {
    margin: 0;
    color: #5b21b6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #5b21b6;
}

.ai-score small {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.ai-checkpoints {
    list-style: none;
    margin: 0.5rem 0 1rem;
    padding: 0;
}

.ai-checkpoints li {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.45rem 0.75rem;
    margin-bottom: 0.4rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.ai-checkpoints li.ai-cp-ok { border-color: #bbf7d0; }
.ai-checkpoints li.ai-cp-fail { border-color: #fecaca; }

.ai-cp-mark {
    font-weight: 700;
    flex-shrink: 0;
}

.ai-cp-ok .ai-cp-mark { color: #16a34a; }
.ai-cp-fail .ai-cp-mark { color: #dc2626; }
.ai-cp-neutral .ai-cp-mark { color: #64748b; }

.ai-cp-toggle {
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    line-height: 1;
}

.ai-cp-neutral .ai-cp-toggle { background: #f1f5f9; }

.ai-score input {
    width: 4.5rem;
    padding: 0.35rem;
    border: 1px solid #c4b5fd;
    border-radius: var(--radius);
    color: inherit;
    font: inherit;
    text-align: right;
}

.ai-edit-feedback {
    width: 100%;
    min-height: 5rem;
    box-sizing: border-box;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    line-height: 1.6;
    resize: vertical;
}

.ai-cache-help { margin-left: auto; }

.ai-errors {
    list-style: none;
    margin: 0.5rem 0 1rem;
    padding: 0;
}

.ai-errors li {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.4rem;
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    font-size: 0.9rem;
    display: flex;
    gap: 0.5rem;
}

.ai-errors li::before {
    content: "✗";
    color: var(--danger);
    font-weight: 700;
}

.ai-feedback-text {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 1rem;
}

.ai-panel-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.ai-panel-actions .help-text {
    margin: 0 0 0 auto;
}

.ai-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
}

/* Foutenfrequentie-balken */
.freq-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 1rem;
}

.freq-row {
    display: grid;
    grid-template-columns: 300px 1fr 3rem;
    align-items: center;
    gap: 1rem;
}

.freq-label {
    font-size: 0.95rem;
}

.freq-label code {
    background: var(--bg);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.85em;
}

.freq-bar {
    height: 22px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.freq-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
}

.freq-fill.warn { background: #f59e0b; }
.freq-fill.low { background: #94a3b8; }

.freq-count {
    font-weight: 700;
    text-align: right;
}

/* Rubric-editor */
.checkpoint-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.checkpoint-row .text-input {
    flex: 1;
}

.checkpoint-num {
    width: 1.5rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.rubric-box {
    display: inline-block;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 1rem;
    font-weight: 500;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    vertical-align: middle;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch .slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.switch .slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.toggle-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.ai-error-badge { background: #fee2e2; color: #991b1b; }

.ai-summary {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.ai-config-editor {
    margin-top: 0.75rem;
    padding: 1rem 1.25rem;
    background: #f5f3ff;
    border: 1px solid #c4b5fd;
    border-radius: var(--radius);
}

.ai-config-editor .textarea-input.mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.85rem;
}

@media (max-width: 700px) {
    .freq-row { grid-template-columns: 1fr 3rem; }
    .freq-label { grid-column: 1 / -1; }
}

.detail-assignment {
    margin: 1rem 0;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    background: #f8fafc;
}

.detail-assignment summary {
    cursor: pointer;
    padding: 0.6rem 1rem;
    font-weight: 600;
}

.detail-assignment-text {
    padding: 0 1rem 0.75rem;
}

.detail-assignment-text p {
    margin: 0.25rem 0;
}

.detail-assignment-text ul,
.detail-assignment-text ol {
    margin: 0.25rem 0;
    padding-left: 1.5rem;
}

.detail-code-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-code-compare > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.detail-code-compare h4 {
    margin: 0 0 0.5rem;
}

.detail-code-compare pre {
    flex: 1;
    max-height: 420px;
    margin: 0;
    overflow: auto;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
}

@media (max-width: 900px) {
    .detail-code-compare {
        grid-template-columns: 1fr;
    }
}
