/* ========================================================
   IdangPDF Studio & AI OCR — Crafted Modern SaaS Design System
   Clean, Sleek, Tactile & Professional (Anti-AI Cliché Look)
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border-subtle: #e2e8f0;
    --border-hover: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-soft: #eef2ff;
    
    --brand-dark: #090d16;
    --brand-dark-card: #131b2e;
}

/* Workspace refresh */
body { background: #f5f6f8; }
header.glass-panel { background:#fff;backdrop-filter:none; }
header > div { max-width:1440px !important; }
header nav { background:transparent !important;border:0 !important;gap:0 !important; }
header .nav-tab { font-size:11px;white-space:nowrap;padding:8px; }
header .nav-tab.active-tab { color:#4338ca;background:#eef2ff !important;box-shadow:none; }
main { max-width:1320px !important; }
.workspace-heading { max-width:1320px;width:100%;margin:32px auto 0;padding:0 32px;display:flex;justify-content:space-between;align-items:center;gap:20px; }
.eyebrow { font-size:10px;font-weight:800;letter-spacing:.16em;color:#747e90; }
.workspace-heading p { font-size:20px;font-weight:700;letter-spacing:-.5px;margin-top:6px; }
.privacy-badge { display:flex;align-items:center;gap:8px;background:#eaf4ee;color:#397453;padding:8px 12px;border-radius:6px;font-size:11px;font-weight:600; }
.privacy-badge svg { width:15px;height:15px; }
#view-dashboard > div:first-child > div:first-child { background:#172b36;border-radius:14px;padding:36px;min-height:300px; }
#view-dashboard h1 { font-size:36px;line-height:1.2;max-width:550px;font-weight:700;letter-spacing:-1.2px; }
#view-dashboard > div:first-child p { color:#bdccd4;font-size:13px;line-height:1.9; }
#view-dashboard > div:first-child > .dropzone-modern p { color:#64748b; }
#view-dashboard .bento-card { border-radius:12px;padding:24px;box-shadow:none;min-height:235px;text-align:left; }
#view-dashboard .bento-card:hover { transform:translateY(-2px);border-color:#a5b4bc;box-shadow:0 8px 24px #172b360a; }
#view-dashboard .bento-card::before { display:none; }
.dropzone-modern { border-radius:14px !important; }
.extra-tool { display:flex;flex-direction:column;align-items:flex-start;color:#172b36; }
.tool-icon { display:inline-flex;width:42px;height:42px;align-items:center;justify-content:center;border-radius:10px;background:#edf2fa;color:#476da6;margin-bottom:16px; }
.tool-icon svg { width:21px;height:21px; }
.tool-icon.protect,.tool-icon.unprotect { background:#edf5f1;color:#327457; }
.tool-icon.ppt { background:#fff1e9;color:#b75e33; }
.extra-tool h3 { font-size:14px;font-weight:700; }
.extra-tool p { font-size:12px;line-height:1.8;color:#64748b;margin-top:6px; }
.tool-link { margin-top:auto;padding-top:18px;width:100%;display:flex;align-items:center;justify-content:space-between;font-size:11px;font-weight:700;color:#476da6; }
.tool-link svg { width:15px;height:15px; }
.tool-page-heading h1 { font-size:30px;font-weight:700;letter-spacing:-.8px;margin:8px 0; }
.tool-page-heading p { color:#64748b;font-size:13px; }
.workflow-grid { display:grid;grid-template-columns:minmax(0,1.5fr) minmax(260px,1fr);gap:24px;max-width:1080px; }
.workflow-card { padding:30px;background:#fff;border:1px solid #e2e8f0;border-radius:14px; }
.segmented { display:flex;background:#f1f4f7;padding:4px;border-radius:8px;gap:4px;margin-bottom:24px; }
.segmented button { flex:1;padding:10px;font-size:13px;font-weight:600;color:#64748b;border-radius:6px; }
.segmented button.selected { background:white;color:#172b36;box-shadow:0 1px 4px #172b3612; }
.file-picker { position:relative;display:flex;align-items:center;flex-direction:column;gap:10px;border:1px dashed #bac9d1;border-radius:10px;padding:30px 18px;background:#f9fbfc;cursor:pointer;text-align:center; }
.file-picker > svg { width:30px;height:30px;color:#476da6; }
.file-picker strong { font-size:14px; }
.file-picker span { font-size:12px;color:#64748b;overflow-wrap:anywhere; }
.file-picker input { position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer; }
.file-picker:focus-within { outline:3px solid #7ca5ce;outline-offset:3px; }
.field-label { display:block;font-size:12px;font-weight:600;margin:20px 0 8px; }
.text-field { width:100%;padding:12px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;font-size:14px; }
.check-label { display:flex;align-items:center;gap:8px;font-size:12px;color:#64748b;margin:16px 0; }
.primary-action { display:block;width:100%;padding:14px;border-radius:8px;background:#172b36;color:#fff;font-size:13px;font-weight:700;margin-top:24px; }
.primary-action:hover { background:#264656; }
button:disabled { opacity:.55;cursor:wait; }
.operation-status { font-size:12px;line-height:1.8;color:#476378;margin-top:14px;overflow-wrap:anywhere; }
.workflow-aside { padding:30px 24px; }
.workflow-aside h2 { font-size:21px;font-weight:700;letter-spacing:-.4px;margin-bottom:14px; }
.workflow-aside p { color:#64748b;font-size:13px;line-height:1.9; }
.note { font-size:12px;line-height:1.9;color:#64748b;background:#f1f5f8;border-radius:8px;padding:16px;margin-top:20px; }
.convert-shortcuts { display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:12px; }
.convert-shortcuts span { color:#64748b;margin-right:auto; }
.convert-shortcuts button { background:#eef2ff;padding:10px 14px;border-radius:8px;color:#4338ca;font-weight:600; }
.mobile-nav { display:none; }
:focus-visible { outline:3px solid #7ca5ce;outline-offset:3px; }
[hidden] { display:none !important; }
@media(max-width:1240px) {
 header nav { display:none !important; }
 .mobile-nav { display:block;margin-left:auto;margin-right:12px; }
 .mobile-nav select { max-width:170px;font-size:12px;padding:8px;border:1px solid #e2e8f0;border-radius:8px;background:#fff; }
}
@media(max-width:640px) {
 .workspace-heading { padding:0 16px;margin-top:22px; }
 .workspace-heading p { font-size:17px; }
 .privacy-badge { display:none; }
 #view-dashboard h1 { font-size:29px; }
 #view-dashboard > div:first-child > div:first-child { padding:26px; }
 .workflow-grid { grid-template-columns:1fr;gap:8px; }
 .workflow-card { padding:20px; }
 .workflow-aside { padding:20px 4px; }
 .tool-page-heading h1 { font-size:26px; }
 header > div { gap:6px; }
 header button span { display:none; }
 .mobile-nav { margin-right:0; }
 .mobile-nav select { max-width:125px; }
 #view-convert .flex.border-b { flex-wrap:wrap;gap:14px; }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Custom Minimalist Scrollbar */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Glassmorphism & Surface Elevation */
.glass-panel {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.surface-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.surface-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.04), 0 8px 10px -6px rgba(15, 23, 42, 0.02);
}

/* Interactive Bento Tool Cards */
.bento-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    padding: 1.5rem;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1.25rem;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(226,232,240,0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.bento-card:hover {
    transform: translateY(-3px);
    border-color: #cbd5e1;
    box-shadow: 0 16px 32px -10px rgba(15, 23, 42, 0.08);
}

/* Tactile Buttons */
.btn-tactile {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border-radius: 0.75rem;
    transition: all 0.18s ease;
    user-select: none;
}
.btn-tactile:active {
    transform: scale(0.98);
}

/* Modern Dropzone */
.dropzone-modern {
    border: 2px dashed #cbd5e1;
    border-radius: 1.25rem;
    background: #ffffff;
    transition: all 0.25s ease;
    cursor: pointer;
}
.dropzone-modern:hover, .dropzone-modern.dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -6px rgba(79, 70, 229, 0.12);
}

/* Studio Canvas Viewport */
.pdf-viewport-container {
    position: relative;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    background: #ffffff;
    border-radius: 4px;
    margin: 0 auto;
}

.pdf-canvas {
    display: block;
    max-width: 100%;
}

.annotation-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    overflow: hidden;
}

/* Draggable Annotation Overlay Items */
.annotation-item {
    position: absolute;
    cursor: move;
    user-select: none;
    border: 1.5px dashed transparent;
    padding: 3px 6px;
    border-radius: 6px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.annotation-item:hover, .annotation-item.active {
    border-color: #4f46e5;
    background: rgba(79, 70, 229, 0.08);
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.4);
}

.annotation-delete-btn {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 22px;
    height: 22px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.annotation-item:hover .annotation-delete-btn,
.annotation-item.active .annotation-delete-btn {
    display: flex;
}

/* Stamp Presets */
.stamp-badge {
    display: inline-block;
    padding: 6px 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-radius: 6px;
    transform: rotate(-7deg);
    border: 2.5px solid;
    pointer-events: none;
}
.stamp-approved {
    color: #059669;
    border-color: #059669;
    background: rgba(16, 185, 129, 0.1);
}
.stamp-lunas {
    color: #2563eb;
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
}
.stamp-confidential {
    color: #dc2626;
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}
.stamp-draft {
    color: #d97706;
    border-color: #d97706;
    background: rgba(245, 158, 11, 0.1);
}

/* Redact Box */
.redact-box {
    background: #000000;
    width: 100%;
    height: 100%;
    border-radius: 2px;
}

/* OCR Bounding Boxes */
.ocr-box {
    position: absolute;
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(37, 99, 235, 0.6);
    pointer-events: none;
    transition: background 0.15s ease;
}
.ocr-box:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: #059669;
}

/* Monospace font */
.font-mono-ocr {
    font-family: 'JetBrains Mono', monospace;
}

/* Floating Toolbar */
.floating-dock {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 16px 36px -10px rgba(15, 23, 42, 0.1), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
    border-radius: 1rem;
}

/* Compression Level Radio Cards */
.compress-card {
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
}
.compress-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
}
.compress-card.active {
    border-color: #4f46e5;
    background: #f5f3ff;
    box-shadow: 0 0 0 1px #4f46e5;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}
.toast-msg {
    pointer-events: auto;
    animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
