/* ══════════════════════════════════════════════
   COMPACT RESIZER WIDGET — for embedding one active
   instance of js/resizer-engine.js somewhere other than
   the full 3-column desktop dashboard (css/resizer-editor.css).

   Deliberately self-contained: every class the engine's JS
   itself manipulates via classList (.hidden, .check-icon +
   state, .drag-over) is styled here, so this file can be used
   WITHOUT also loading css/resizer-editor.css. New layout
   classes are prefixed sk-widget- to avoid colliding with
   anything else on the host page.

   Engine contract this markup must satisfy (see
   js/resizer-engine.js's own header comment + the plan this
   was built from): #editorExamName, #editorExamSpecs,
   #specList, #dropTitle, #dropSub, #dropzone, #editorZone,
   #mainCanvas, #scoreCircle, #scoreText, #readinessLabel,
   #readinessSub, #fileSizeInfo, the 4 ck-*/ckv-* pairs,
   #downloadBtn, #toast, #sharePrompt, #shareWhatsappBtn.
   Deliberately NOT included (feature-gated behind buttons
   this markup never renders, so the engine never reaches
   for them): PDF/Photo mode tabs, #pdfPreview, the crop
   modal, background-color swatches, the tips panel, the
   mobile bottom bar, #landingPage (showEditor/showLanding
   are never called — this widget is visible by default).
   ══════════════════════════════════════════════ */

.hidden {
    display: none !important;
}

.sk-widget {
    background: #fff;
    border: 1px solid var(--border2, rgba(15, 15, 26, 0.15));
    border-radius: 16px;
    overflow: hidden;
    font-family: var(--font-body, 'Roboto Condensed', sans-serif);
    color: var(--ink, #0f0f1a);
}

.sk-widget-topbar {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border, rgba(15, 15, 26, 0.08));
    background: var(--surface2, #f7f7fc);
}

.sk-widget-exam-name {
    font-family: var(--font-display, 'Roboto Condensed', sans-serif);
    font-weight: 700;
    font-size: 15px;
}

.sk-widget-exam-specs {
    font-size: 12px;
    color: var(--ink3, #5a5a7a);
    margin-top: 2px;
}

.sk-widget-body {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 0;
}

@media (max-width: 560px) {
    .sk-widget-body {
        grid-template-columns: 1fr;
    }
}

.sk-widget-panel {
    padding: 16px;
    border-right: 1px solid var(--border, rgba(15, 15, 26, 0.08));
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@media (max-width: 560px) {
    .sk-widget-panel {
        border-right: none;
        border-bottom: 1px solid var(--border, rgba(15, 15, 26, 0.08));
    }
}

.sk-widget-readiness {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sk-widget-score-ring {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.sk-widget-score-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.sk-widget-readiness-label {
    font-size: 12px;
    font-weight: 700;
}

.sk-widget-readiness-sub {
    font-size: 10.5px;
    color: var(--ink3, #5a5a7a);
}

.sk-widget-checklist {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.check-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
    color: #fff;
}

.check-icon.idle {
    background: #cbd5e1;
    color: #64748b;
}

.check-icon.pass {
    background: var(--green, #059669);
}

.check-icon.warn {
    background: var(--amber, #d97706);
}

.check-icon.fail {
    background: #dc2626;
}

.check-label {
    flex: 1;
    color: var(--ink2, #2a2a3d);
}

.check-value {
    font-family: var(--font-mono, monospace);
    color: var(--ink3, #5a5a7a);
    white-space: nowrap;
}

.sk-widget-spec-list {
    font-size: 11px;
    color: var(--ink3, #5a5a7a);
    line-height: 1.6;
}

.sk-widget-download-btn {
    margin-top: auto;
    background: var(--accent, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px;
    font-family: var(--font-display, 'Roboto Condensed', sans-serif);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.sk-widget-download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sk-widget-workspace {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
}

.sk-widget-dropzone {
    width: 100%;
    border: 2px dashed var(--border2, rgba(15, 15, 26, 0.15));
    border-radius: 12px;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.sk-widget-dropzone:hover,
.sk-widget-dropzone.drag-over {
    border-color: var(--accent, #4f46e5);
    background: var(--surface2, #f7f7fc);
}

.sk-widget-dropzone h3 {
    font-family: var(--font-display, 'Roboto Condensed', sans-serif);
    font-size: 13.5px;
    margin: 6px 0 2px;
}

.sk-widget-dropzone p {
    font-size: 11.5px;
    color: var(--ink3, #5a5a7a);
    margin: 0;
}

.sk-widget-toolbar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 10px;
}

.sk-widget-tool-btn {
    background: var(--surface2, #f7f7fc);
    border: 1px solid var(--border2, rgba(15, 15, 26, 0.15));
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11px;
    cursor: pointer;
    color: var(--ink2, #2a2a3d);
}

#mainCanvas {
    max-width: 100%;
    max-height: 320px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.sk-widget-filesize {
    margin-top: 10px;
    font-size: 11px;
    color: var(--ink3, #5a5a7a);
}

/* Toast + share prompt — required by the engine on every download,
   kept minimal/unobtrusive rather than the full dashboard's styling */
#toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    background: var(--ink, #0f0f1a);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 1000;
    max-width: 90vw;
    text-align: center;
}

#toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#sharePrompt {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: #fff;
    border: 1px solid var(--border2, rgba(15, 15, 26, 0.15));
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    max-width: 260px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
    z-index: 1000;
}

#sharePrompt.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#sharePrompt p {
    font-size: 12.5px;
    margin-bottom: 8px;
}

#shareWhatsappBtn {
    display: inline-block;
    background: #25d366;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 8px;
}
