/* ========================================
   SKRIPSI CEK
   Dimuat setelah dashboard.css. Warna permukaan/teks memakai variabel tema
   (--white, --gray-*, --black, --orange) sehingga ikut mode gelap & aksen.
   ======================================== */

:root {
    --cek-typo: #DC2626;
    --cek-typo-bg: #FEE2E2;
    --cek-writing: #B45309;
    --cek-writing-bg: #FEF3C7;
    --cek-structure: #2563EB;
    --cek-structure-bg: #DBEAFE;
    --cek-good: #059669;
    --cek-warn: #D97706;
    --cek-bad: #DC2626;
}
[data-theme="dark"] {
    --cek-typo: #F87171;
    --cek-typo-bg: rgba(239, 68, 68, 0.22);
    --cek-writing: #FBBF24;
    --cek-writing-bg: rgba(245, 158, 11, 0.22);
    --cek-structure: #60A5FA;
    --cek-structure-bg: rgba(59, 130, 246, 0.24);
    --cek-good: #34D399;
    --cek-warn: #FBBF24;
    --cek-bad: #F87171;
}

/* ---------- Input ---------- */
.cek-input {
    border: 1px solid var(--gray-100);
    background: var(--white);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.cek-tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--gray-100);
    border-radius: 10px;
    margin-bottom: 1rem;
}
.cek-tab {
    padding: 0.4375rem 0.875rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-500);
    transition: var(--transition);
}
.cek-tab.active { background: var(--white); color: var(--black); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.cek-or { text-align: center; margin: 0 0 1rem; font-size: 0.8125rem; color: var(--gray-400); }
.cek-picker-label { font-size: 0.8125rem; font-weight: 600; color: var(--gray-700); display: block; margin-bottom: 0.5rem; }
.cek-paste-meta { font-size: 0.75rem; color: var(--gray-400); margin: -0.5rem 0 1rem; text-align: right; }
.cek-input .checker-textarea { background: var(--white); color: var(--black); }
.cek-run-row { display: flex; align-items: center; gap: 0.875rem; flex-wrap: wrap; }
.cek-run-row .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cek-run-note { font-size: 0.75rem; color: var(--gray-400); }
.cek-progress { margin-top: 1rem; }
.cek-progress-track { height: 6px; border-radius: 99px; background: var(--gray-100); overflow: hidden; }
.cek-progress-fill { height: 100%; width: 0; background: var(--orange); border-radius: 99px; transition: width 0.25s ease; }
.cek-progress-text { font-size: 0.75rem; color: var(--gray-500); margin-top: 0.375rem; }
.cek-alert {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    background: var(--cek-typo-bg);
    color: var(--cek-typo);
    border: 1px solid color-mix(in srgb, var(--cek-typo) 30%, transparent);
}

/* ---------- Ringkasan skor ---------- */
.cek-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr);
    gap: 1rem;
    margin-bottom: 1rem;
}
.cek-score-main {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--gray-100);
    background: var(--gray-50);
    min-width: 0;
}
.cek-ring { position: relative; width: 92px; height: 92px; flex-shrink: 0; }
.cek-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.cek-ring-track { stroke: var(--gray-200); }
.cek-ring-value { font-size: 1.75rem; font-weight: 800; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--black); }
.cek-score-text { min-width: 0; }
.cek-file-title { font-size: 0.9375rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cek-score-text p { font-size: 0.8125rem; color: var(--gray-600); margin: 0.25rem 0 0.375rem; line-height: 1.45; }
.cek-meta { font-size: 0.75rem; color: var(--gray-400); }

.cek-cat-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.cek-cat-card {
    text-align: left;
    padding: 0;
    border-radius: 16px;
    border: 1.5px solid var(--gray-100);
    background: var(--gray-50);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    min-width: 0;
}
/* The card body filters the list; the footer holds "Perbaiki semua". Two buttons, so the card itself is a div. */
.cek-cat-main {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    width: 100%;
    padding: 1rem 1rem 0.5rem;
    text-align: left;
    border-radius: inherit;
    color: inherit;
}
.cek-cat-main:last-child { padding-bottom: 1rem; }
.cek-cat-foot { display: flex; justify-content: flex-end; padding: 0 0.75rem 0.75rem; }
.cek-cat-fix {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 99px;
    border: 1px solid var(--orange);
    color: var(--orange);
    background: var(--white);
    transition: var(--transition);
}
.cek-cat-fix:hover:not(:disabled) { background: var(--orange); color: var(--white); }
.cek-cat-fix:disabled { border-color: transparent; color: var(--cek-good); background: transparent; cursor: default; }
.cek-cat-card:hover { border-color: var(--gray-300); }
.cek-cat-card.active { border-color: var(--black); background: var(--white); }
.cek-cat-score { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.cek-cat-label { font-size: 0.8125rem; font-weight: 600; color: var(--black); display: flex; align-items: center; gap: 0.375rem; }
.cek-cat-label::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cek-cat-card.cat-typo .cek-cat-label::before { background: var(--cek-typo); }
.cek-cat-card.cat-writing .cek-cat-label::before { background: var(--cek-writing); }
.cek-cat-card.cat-structure .cek-cat-label::before { background: var(--cek-structure); }
.cek-cat-count { font-size: 0.75rem; color: var(--gray-500); }
.score-good { color: var(--cek-good); }
.score-warn { color: var(--cek-warn); }
.score-bad { color: var(--cek-bad); }

/* ---------- Prioritas & peta struktur ---------- */
.cek-insights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.cek-insights .content-card { padding: 1.25rem; min-width: 0; }
.cek-insights .content-card-header { margin-bottom: 0.75rem; }
.cek-actions { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; counter-reset: cek; }
.cek-actions li {
    counter-increment: cek;
    display: flex;
    gap: 0.625rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--gray-700);
}
.cek-actions li::before {
    content: counter(cek);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    background: var(--white);
    border: 1px solid var(--gray-200);
}
.cek-actions li.cat-typo::before { border-color: var(--cek-typo); color: var(--cek-typo); }
.cek-actions li.cat-writing::before { border-color: var(--cek-writing); color: var(--cek-writing); }
.cek-actions li.cat-structure::before { border-color: var(--cek-structure); color: var(--cek-structure); }
.cek-outline { display: flex; flex-direction: column; gap: 0.625rem; font-size: 0.8125rem; }
.cek-outline-ch { font-weight: 700; margin-bottom: 0.25rem; }
.cek-outline-ch small { font-weight: 500; color: var(--gray-400); margin-left: 0.25rem; }
.cek-outline-subs { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.cek-chip-ok, .cek-chip-miss {
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    border-radius: 99px;
    font-weight: 600;
}
.cek-chip-ok { background: color-mix(in srgb, var(--cek-good) 14%, transparent); color: var(--cek-good); }
.cek-chip-miss { background: var(--cek-typo-bg); color: var(--cek-typo); }
.cek-muted { font-size: 0.8125rem; color: var(--gray-500); line-height: 1.5; }

/* ---------- Review: dokumen + daftar temuan ---------- */
.cek-review {
    border: 1px solid var(--gray-100);
    border-radius: 16px;
    background: var(--white);
    overflow: hidden;
    margin-bottom: 1rem;
}
.cek-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-50);
}
.cek-chip {
    padding: 0.375rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    background: var(--white);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}
.cek-chip.active { background: var(--black); border-color: var(--black); color: var(--white); }
.cek-chip.chip-fixed { color: var(--cek-good); border-color: color-mix(in srgb, var(--cek-good) 40%, transparent); }
.cek-chip.chip-fixed.active { background: var(--cek-good); border-color: var(--cek-good); color: var(--white); }
.cek-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cek-dot.cat-typo { background: var(--cek-typo); }
.cek-dot.cat-writing { background: var(--cek-writing); }
.cek-dot.cat-structure { background: var(--cek-structure); }
.cek-select {
    padding: 0.375rem 0.625rem;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    font-size: 0.75rem;
    background: var(--white);
    color: var(--black);
}
.cek-toolbar-spacer { flex: 1; }
.cek-view-toggle { display: inline-flex; border: 1px solid var(--gray-200); border-radius: 8px; overflow: hidden; }
.cek-view-toggle button { padding: 0.375rem 0.75rem; font-size: 0.75rem; font-weight: 600; color: var(--gray-500); background: var(--white); }
.cek-view-toggle button.active { background: var(--black); color: var(--white); }

.cek-review-body {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    height: min(78vh, 900px);
}
.cek-doc {
    overflow: auto;
    padding: 1.25rem;
    border-right: 1px solid var(--gray-100);
    background: var(--gray-50);
    min-width: 0;
}
.cek-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.875rem;
    line-height: 1.85;
    color: var(--black);
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 760px;
    margin: 0 auto;
}
mark.cek-hl {
    color: inherit;
    border-radius: 3px;
    padding: 0.05em 0;
    cursor: pointer;
    transition: box-shadow 0.15s;
}
mark.cek-hl.cat-typo { background: var(--cek-typo-bg); box-shadow: inset 0 -2px 0 var(--cek-typo); }
mark.cek-hl.cat-writing { background: var(--cek-writing-bg); box-shadow: inset 0 -2px 0 var(--cek-writing); }
mark.cek-hl.cat-structure { background: var(--cek-structure-bg); box-shadow: inset 0 -2px 0 var(--cek-structure); }
mark.cek-hl.wide { background: transparent; box-shadow: none; text-decoration: underline dashed; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
mark.cek-hl.wide.cat-typo { text-decoration-color: var(--cek-typo); }
mark.cek-hl.wide.cat-writing { text-decoration-color: var(--cek-writing); }
mark.cek-hl.wide.cat-structure { text-decoration-color: var(--cek-structure); }
mark.cek-hl.focus { outline: 2px solid var(--orange); outline-offset: 1px; animation: cek-pulse 1.2s ease-in-out 2; }
mark.cek-hl.fixed { background: color-mix(in srgb, var(--cek-good) 16%, transparent); box-shadow: inset 0 -2px 0 var(--cek-good); color: var(--cek-good); font-weight: 600; }
@keyframes cek-pulse {
    0%, 100% { outline-color: var(--orange); }
    50% { outline-color: transparent; }
}

.cek-pdf { display: flex; flex-direction: column; gap: 1rem; align-items: center; }
.cek-pdf-page {
    position: relative;
    width: 100%;
    max-width: 760px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    overflow: hidden;
    container-type: inline-size; /* font size of fixed words is set in cqw */
}
.cek-pdf-canvas { display: block; width: 100%; height: auto; }
.cek-pdf-ph {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    color: #9CA3AF;
}
.cek-pdf-box { position: absolute; border-radius: 2px; cursor: pointer; }
.cek-pdf-box.cat-typo { background: rgba(239, 68, 68, 0.28); box-shadow: inset 0 -2px 0 #DC2626; }
.cek-pdf-box.cat-writing { background: rgba(245, 158, 11, 0.30); box-shadow: inset 0 -2px 0 #D97706; }
.cek-pdf-box.cat-structure { background: rgba(59, 130, 246, 0.26); box-shadow: inset 0 -2px 0 #2563EB; }
.cek-pdf-box.wide { background: transparent; }
.cek-pdf-box.focus { outline: 2px solid var(--orange); outline-offset: 1px; animation: cek-pulse 1.2s ease-in-out 2; }
.cek-pdf-box.fixed, .cek-pdf-box.fixed.wide { background: rgba(22, 163, 74, 0.22); box-shadow: inset 0 -2px 0 #16A34A; }
/* Accepted fix written over the original word on the page */
.cek-pdf-fix { position: absolute; display: flex; align-items: center; background: #fff; box-shadow: inset 0 -2px 0 #16A34A; cursor: pointer; }
.cek-pdf-fix span { white-space: nowrap; line-height: 1; color: #111; transform-origin: left center; }
.cek-pdf-fix.focus { outline: 2px solid var(--orange); outline-offset: 1px; animation: cek-pulse 1.2s ease-in-out 2; }

.cek-issues { overflow: auto; padding: 0.75rem; min-width: 0; }
.cek-issues-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-500);
    padding: 0.25rem 0.25rem 0.625rem;
}
.cek-link { font-size: 0.75rem; font-weight: 600; color: var(--orange); }
.cek-issue {
    border: 1px solid var(--gray-100);
    border-left: 3px solid var(--gray-300);
    border-radius: 10px;
    padding: 0.75rem 0.875rem;
    margin-bottom: 0.5rem;
    background: var(--white);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.cek-issue.cat-typo { border-left-color: var(--cek-typo); }
.cek-issue.cat-writing { border-left-color: var(--cek-writing); }
.cek-issue.cat-structure { border-left-color: var(--cek-structure); }
.cek-issue.active { box-shadow: 0 0 0 2px var(--orange); }
.cek-issue-top { display: flex; align-items: center; gap: 0.375rem; flex-wrap: wrap; margin-bottom: 0.375rem; }
.cek-num { font-size: 0.6875rem; font-weight: 700; color: var(--gray-400); }
.cek-tag { font-size: 0.6875rem; font-weight: 600; padding: 0.0625rem 0.5rem; border-radius: 99px; }
.cek-tag.cat-typo { background: var(--cek-typo-bg); color: var(--cek-typo); }
.cek-tag.cat-writing { background: var(--cek-writing-bg); color: var(--cek-writing); }
.cek-tag.cat-structure { background: var(--cek-structure-bg); color: var(--cek-structure); }
.cek-sev { font-size: 0.6875rem; color: var(--gray-500); }
.cek-sev.sev-high { color: var(--cek-bad); font-weight: 600; }
.cek-loc { font-size: 0.6875rem; color: var(--gray-400); margin-left: auto; }
.cek-issue-msg { font-size: 0.8125rem; line-height: 1.5; color: var(--gray-700); }
.cek-change { margin-top: 0.375rem; font-size: 0.8125rem; display: flex; align-items: center; gap: 0.375rem; flex-wrap: wrap; }
.cek-change del { background: var(--cek-typo-bg); color: var(--cek-typo); padding: 0 0.375rem; border-radius: 4px; }
.cek-change ins { background: color-mix(in srgb, var(--cek-good) 14%, transparent); color: var(--cek-good); padding: 0 0.375rem; border-radius: 4px; text-decoration: none; font-weight: 600; }
.cek-change-label { color: var(--gray-500); }
.cek-ctx {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.55;
    color: var(--gray-500);
    background: var(--gray-50);
    border-radius: 6px;
    padding: 0.375rem 0.5rem;
    word-break: break-word;
}
.cek-ctx b { color: var(--black); font-weight: 600; background: color-mix(in srgb, var(--orange) 18%, transparent); border-radius: 3px; }
.cek-issue-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.cek-issue-actions button {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    color: var(--black);
    background: var(--white);
}
.cek-issue-actions button:hover { border-color: var(--gray-400); }
.cek-issue-actions button.ghost { border-color: transparent; color: var(--gray-500); }
.cek-issue-actions button.fix { border-color: var(--orange); color: var(--orange); }
.cek-issue-actions button.fix:hover { background: var(--orange); color: var(--white); }
.cek-issue.fixed { border-left-color: var(--cek-good); background: color-mix(in srgb, var(--cek-good) 5%, var(--white)); }
.cek-issue.fixed .cek-ctx { display: none; }
.cek-fixed-badge { margin-left: auto; font-size: 0.6875rem; font-weight: 700; color: var(--cek-good); }
.cek-issues-head-links { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: flex-end; }
.cek-fixed-note { font-size: 0.75rem; color: var(--cek-good); background: color-mix(in srgb, var(--cek-good) 8%, transparent); border-radius: 8px; padding: 0.5rem 0.75rem; margin-bottom: 0.625rem; line-height: 1.5; }
.cek-more {
    width: 100%;
    padding: 0.625rem;
    border-radius: 10px;
    border: 1px dashed var(--gray-300);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-600);
}
.cek-empty { padding: 2rem 1rem; text-align: center; font-size: 0.875rem; color: var(--gray-500); }

/* ---------- Unduhan ---------- */
.cek-downloads { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.cek-downloads .btn { font-size: 0.8125rem; padding: 0.5rem 0.875rem; }
.cek-downloads .btn:disabled { opacity: 0.6; cursor: wait; }
/* The single download button: white in both themes. */
.cek-dl-btn {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.625rem 1.125rem;
    border-radius: 10px;
    background: #FFFFFF;
    color: #111111;
    border: 1px solid #D4D4D4;
    transition: var(--transition);
}
.cek-dl-btn:hover:not(:disabled) { background: #F2F2F2; }
.cek-dl-btn:disabled { opacity: 0.7; cursor: wait; }
.cek-dl-btn.cek-dl-primary { background: #16A34A; border-color: #16A34A; color: #fff; }
.cek-dl-btn.cek-dl-primary:hover:not(:disabled) { background: #15803D; }
.cek-export-msg { font-size: 0.875rem; line-height: 1.6; margin-bottom: 0.75rem; }
.cek-disclaimer { font-size: 0.75rem; color: var(--gray-400); line-height: 1.5; }

/* ---------- Responsif ---------- */
@media (max-width: 1100px) {
    .cek-summary { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .cek-insights { grid-template-columns: 1fr; }
    .cek-review-body { grid-template-columns: 1fr; height: auto; }
    .cek-doc { max-height: 65vh; border-right: none; border-bottom: 1px solid var(--gray-100); padding: 0.75rem; }
    .cek-issues { max-height: 70vh; }
    .cek-text { padding: 1rem; }
}
@media (max-width: 560px) {
    .cek-cat-cards { grid-template-columns: 1fr; }
    .cek-cat-card { flex-direction: row; align-items: center; }
    .cek-cat-main { flex-direction: row; align-items: center; gap: 0.75rem; flex: 1; padding: 0.75rem; }
    .cek-cat-main:last-child { padding-bottom: 0.75rem; }
    .cek-cat-foot { padding: 0 0.75rem 0 0; }
    .cek-cat-score { font-size: 1.5rem; min-width: 2.5rem; }
    .cek-cat-count { margin-left: auto; }
    .cek-score-main { padding: 1rem; gap: 1rem; }
    .cek-ring { width: 72px; height: 72px; }
    .cek-toolbar-spacer { display: none; }
}
