/* Custom Stylesheet for BudakDekanAi Portal */

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}

/* Ruang selamat untuk telefon bertakuk (notch) */
.pt-safe { padding-top: max(env(safe-area-inset-top), 0.625rem); }
.pb-safe { padding-bottom: max(env(safe-area-inset-bottom), 0.75rem); }

.custom-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: #f1f5f9; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

.tab-btn.active {
    color: #0284c7;
    border-bottom-color: #0284c7;
    background-color: #f0f9ff;
}

@keyframes pulse-red {
    0%, 100% { border-color: #f87171; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { border-color: #ef4444; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.overdue-card { animation: pulse-red 2s infinite; }

/* Kad PDF (pratonton & editor) */
.pdf-page {
    max-width: 820px;
    contain: layout;
}
.pdf-page.is-active { box-shadow: 0 0 0 3px #f59e0b, 0 10px 25px rgba(0,0,0,0.15); }

/* Nod teks dalam Editor PDF: boleh diheret dengan jari atau tetikus */
.pdf-text-node {
    position: absolute;
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    white-space: pre;
    line-height: 1.2;
    outline: 1px dashed transparent;
    outline-offset: 2px;
    border-radius: 2px;
}

.pdf-text-node:hover { outline-color: rgba(2, 132, 199, 0.6); }
.pdf-text-node.selected {
    outline: 2px dashed #0284c7;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
    z-index: 5;
}

.pdf-text-node .delete-node-btn {
    display: none;
    position: absolute;
    top: -14px;
    right: -14px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
    border: 2px solid white;
    padding: 0;
    line-height: 1;
}

.pdf-text-node.selected .delete-node-btn { display: flex; }

@media (hover: hover) {
    .pdf-text-node:hover .delete-node-btn { display: flex; }
}

/* Kanvas cop: hadkan ketinggian supaya muat dalam skrin */
#stampMainCanvas { max-height: 72vh; }

.busy-show { display: flex !important; }

/* Peguam AI */
.lawyer-wrap { height: calc(100dvh - 9.5rem); min-height: 420px; }
@media (min-width: 640px) { .lawyer-wrap { height: calc(100dvh - 11rem); } }
.lw-md h2, .lw-md h3 { font-weight: 800; color: #4c1d95; margin: 0.9rem 0 0.35rem; font-size: 0.85rem; }
.lw-md h2:first-child, .lw-md h3:first-child { margin-top: 0; }
.lw-md p { margin: 0.35rem 0; line-height: 1.6; }
.lw-md ul, .lw-md ol { margin: 0.3rem 0 0.5rem 1.2rem; }
.lw-md ul { list-style: disc; }
.lw-md ol { list-style: decimal; }
.lw-md li { margin: 0.15rem 0; line-height: 1.55; }
.lw-md code { background: #f1f5f9; padding: 0 4px; border-radius: 4px; font-size: 0.85em; }
.lw-md blockquote { border-left: 3px solid #c4b5fd; padding-left: 0.6rem; color: #475569; margin: 0.4rem 0; }
.lw-md table { border-collapse: collapse; margin: 0.5rem 0; font-size: 0.8em; display: block; overflow-x: auto; }
.lw-md th, .lw-md td { border: 1px solid #e2e8f0; padding: 4px 8px; text-align: left; vertical-align: top; }
.lw-md th { background: #f5f3ff; }
.lw-cite { display: inline-flex; align-items: center; font-size: 0.68rem; font-weight: 800; color: #6d28d9; background: #ede9fe; border-radius: 6px; padding: 0 5px; margin: 0 1px; cursor: pointer; vertical-align: baseline; }
.lw-cite:hover { background: #ddd6fe; }
.lw-caret::after { content: '▍'; animation: lwblink 1s steps(2) infinite; color: #7c3aed; }
@keyframes lwblink { 50% { opacity: 0; } }

/* Paparan penuh Word & PowerPoint */
.office-host .docx-wrapper { padding: 12px !important; background: transparent !important; }
.office-host .docx-wrapper > section.docx { margin-bottom: 12px !important; box-shadow: 0 2px 10px rgba(0,0,0,0.12) !important; }
.pptx-host .pptx-preview-wrapper { height: auto !important; overflow: visible !important; background: transparent !important; }
.pptx-host .pptx-preview-slide-wrapper { margin: 0 auto 12px !important; box-shadow: 0 2px 10px rgba(0,0,0,0.15); border-radius: 4px; }

/* Catat Nota (skrin belah dua) */
.doc-split.jot-on { --split: 50; }
.doc-split.jot-on > .doc-pane { flex: var(--split) 1 0; min-height: 0; min-width: 0; }
.doc-split.jot-on > .jot-panel { display: flex !important; flex: calc(100 - var(--split)) 1 0; min-width: 0; }
.jot-divider { flex: 0 0 22px; display: flex; align-items: center; justify-content: center; cursor: row-resize; touch-action: none; user-select: none; -webkit-user-select: none; }
.jot-divider span { display: flex; align-items: center; justify-content: center; width: 64px; height: 14px; border-radius: 9px; background: #e2e8f0; color: #64748b; font-size: 11px; transition: background .15s, color .15s; }
.jot-divider:hover span, .jot-divider.dragging span { background: #f59e0b; color: #fff; }
body.jot-resizing, body.jot-resizing * { user-select: none !important; -webkit-user-select: none !important; }
::highlight(jot-search) { background-color: #fde047; color: #0f172a; }
.doc-split.jot-on > .jot-divider { display: flex !important; }
@media (min-width: 1024px) {
    .doc-split.jot-on { flex-direction: row; }
    .jot-divider { cursor: col-resize; }
    .jot-divider span { width: 14px; height: 64px; }
    .jot-divider span i { transform: rotate(90deg); }
}
#jotToolbar button { min-width: 32px; height: 32px; padding: 0 6px; border-radius: 8px; color: #334155; font-size: 12px; flex-shrink: 0; }
#jotToolbar button:hover, #jotToolbar button.on { background: #e2e8f0; }
.jot-sep { width: 1px; height: 20px; background: #e2e8f0; margin: 0 2px; flex-shrink: 0; }
.jot-editor { outline: none; line-height: 1.65; -webkit-user-select: text; user-select: text; }
.jot-editor:empty::before { content: attr(data-placeholder); color: #94a3b8; }
.jot-editor h2 { font-size: 1.25rem; font-weight: 800; margin: 0.8rem 0 0.3rem; color: #0f172a; }
.jot-editor h3 { font-size: 1.05rem; font-weight: 700; margin: 0.6rem 0 0.25rem; color: #1e293b; }
.jot-editor p, .jot-editor div { margin: 0.2rem 0; }
.jot-editor ul { list-style: disc; padding-left: 1.4rem; margin: 0.3rem 0; }
.jot-editor ol { list-style: decimal; padding-left: 1.4rem; margin: 0.3rem 0; }
.jot-editor blockquote { border-left: 3px solid #cbd5e1; padding-left: 0.7rem; color: #475569; }
#docViewerBox.jot-wide { max-width: 96rem; }

