/* ===================================================================
   WISDOM HILL ACADEMY — SIGNATURES, STAMP PNG EXTRACTOR & GES TRAITS
   Standalone module (zero edits to app.js, style.css, api.php, report.php)
   =================================================================== */

.wha-ges-sig-icon-bg {
    background: linear-gradient(135deg, #7c3aed, #db2777) !important;
    color: #ffffff !important;
}

/* Conduct / Attitude / Interest Entry Strip inside Assessment Modal */
.wha-ges-entry-card {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #7c3aed;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    box-sizing: border-box;
}

html[data-theme="dark"] .wha-ges-entry-card {
    background: rgba(30, 41, 59, 0.72);
    border-color: #334155;
    border-left-color: #a78bfa;
}

.wha-ges-entry-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 800;
    color: #0f2b59;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-wrap: wrap;
}

html[data-theme="dark"] .wha-ges-entry-head {
    color: #e2e8f0;
}

.wha-ges-entry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.wha-ges-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wha-ges-field label {
    font-size: 11.5px;
    font-weight: 700;
    color: #334155;
}

html[data-theme="dark"] .wha-ges-field label {
    color: #cbd5e1;
}

.wha-ges-field select,
.wha-ges-field input {
    width: 100%;
    padding: 7px 9px;
    border-radius: 7px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-size: 12.5px;
    font-family: inherit;
    box-sizing: border-box;
}

html[data-theme="dark"] .wha-ges-field select,
html[data-theme="dark"] .wha-ges-field input {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

/* Signature & Stamp Studio Modal */
.wha-sig-overlay {
    position: fixed;
    inset: 0;
    z-index: 10600;
    background: rgba(15, 23, 42, 0.74);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    box-sizing: border-box;
}

.wha-sig-overlay.hidden {
    display: none !important;
}

.wha-sig-dialog {
    width: 100%;
    max-width: 960px;
    max-height: 92vh;
    background: #ffffff;
    color: #0f172a;
    border-radius: 18px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.36);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Plus Jakarta Sans', 'Segoe UI', Arial, sans-serif;
}

html[data-theme="dark"] .wha-sig-dialog {
    background: #0f172a;
    color: #f8fafc;
    border-color: #1e293b;
}

.wha-sig-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1e1b4b 0%, #5b21b6 100%);
    color: #ffffff;
    flex-shrink: 0;
}

.wha-sig-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wha-sig-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.wha-sig-title {
    margin: 0;
    font-size: 16.5px;
    font-weight: 800;
}

.wha-sig-sub {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: #ddd6fe;
}

.wha-sig-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wha-sig-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wha-sig-slots-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

html[data-theme="dark"] .wha-sig-slots-bar {
    background: #1e293b;
    border-color: #334155;
}

.wha-sig-slot-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wha-sig-slot-btn {
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

html[data-theme="dark"] .wha-sig-slot-btn {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

.wha-sig-slot-btn.active {
    background: linear-gradient(135deg, #6d28d9, #7c3aed);
    border-color: #6d28d9;
    color: #ffffff;
}

.wha-sig-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
}

.wha-sig-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    box-sizing: border-box;
}

html[data-theme="dark"] .wha-sig-card {
    background: #1e293b;
    border-color: #334155;
}

.wha-sig-card h4 {
    margin: 0 0 10px 0;
    font-size: 13.5px;
    font-weight: 800;
}

.wha-sig-checkerboard {
    min-height: 155px;
    border-radius: 10px;
    border: 1.5px dashed #94a3b8;
    background-color: #ffffff;
    background-image:
        linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
        linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
        linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow: hidden;
    position: relative;
}

.wha-sig-checkerboard canvas,
.wha-sig-checkerboard img {
    max-width: 100%;
    max-height: 145px;
    object-fit: contain;
    display: block;
}

.wha-sig-line-demo {
    margin-top: 10px;
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 14px 8px;
    text-align: center;
}

.wha-sig-line-demo-img-wrap {
    height: 44px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: 2px;
}

.wha-sig-line-demo-img-wrap img {
    max-height: 42px;
    max-width: 180px;
    object-fit: contain;
}

.wha-sig-line-demo-bar {
    border-top: 1.5px solid #0f172a;
    padding-top: 3px;
    font-size: 10.5px;
    font-weight: 700;
}

.wha-sig-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
}

.wha-sig-ctrl-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.wha-sig-ctrl-row select,
.wha-sig-ctrl-row input[type="range"] {
    width: 56%;
}

.wha-sig-ctrl-row select {
    padding: 6px 8px;
    border-radius: 7px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-size: 12px;
}

html[data-theme="dark"] .wha-sig-ctrl-row select {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

.wha-sig-btn-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.wha-sig-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

html[data-theme="dark"] .wha-sig-btn {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

.wha-sig-btn-primary {
    background: linear-gradient(135deg, #6d28d9, #7c3aed);
    border-color: #6d28d9;
    color: #ffffff !important;
}

.wha-sig-btn-danger {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b !important;
}

.wha-sig-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wha-sig-cam-wrap {
    margin-top: 10px;
    border-radius: 10px;
    overflow: hidden;
    background: #020617;
    border: 1px solid #475569;
    text-align: center;
}

.wha-sig-cam-wrap.hidden {
    display: none !important;
}

.wha-sig-cam-wrap video {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    display: block;
}

/* ===================================================================
   REPORT CARD PRINT INJECTED ELEMENTS (Conduct/Attitude/Interest + PNG Signatures)
   Designed to fit cleanly on 1 single A4 page with zero extra vertical bloat
   =================================================================== */
.rc-ges-traits-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #0f2b59;
    border-radius: 4px;
    padding: 3px 9px;
    margin-bottom: 3px;
    font-size: 10px;
    line-height: 1.25;
    color: #0f172a;
    box-sizing: border-box;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.report-card-print:has(.rc-ges-traits-strip) .rc-table th,
.report-card-print:has(.rc-ges-traits-strip) .rc-table td {
    padding: 5.5px 6px !important;
}

.report-card-print:has(.rc-ges-traits-strip) .rc-signatures {
    margin-top: 14px !important;
    margin-bottom: 3px !important;
}

.report-card-print:has(.rc-ges-traits-strip) .rc-summary-box {
    margin-bottom: 3px !important;
}

.report-card-print:has(.rc-ges-traits-strip) .rc-remark-card {
    min-height: 44px !important;
    padding: 5px 10px !important;
}

.rc-ges-trait-cell {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rc-ges-trait-lbl {
    font-weight: 800;
    color: #0f2b59;
    text-transform: uppercase;
    font-size: 9.5px;
    flex-shrink: 0;
}

.rc-ges-trait-val {
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rc-sig-block {
    position: relative;
}

.rc-sig-overlay-wrap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 15px;
    height: 34px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
}

.rc-sig-overlay-img {
    max-height: 36px;
    max-width: 155px;
    object-fit: contain;
    mix-blend-mode: multiply;
    margin-bottom: -3px;
    position: relative;
    z-index: 2;
}

.rc-stamp-overlay-img {
    position: absolute;
    right: -12px;
    bottom: -10px;
    max-height: 54px;
    max-width: 72px;
    object-fit: contain;
    opacity: 0.88;
    mix-blend-mode: multiply;
    z-index: 1;
    pointer-events: none;
}

@media (max-width: 768px) {
    .wha-ges-entry-grid {
        grid-template-columns: 1fr;
    }
    .wha-sig-workspace {
        grid-template-columns: 1fr;
    }
    .wha-sig-overlay {
        padding: 6px;
    }
}
