/* ============================================================
FILE    : css/global.css
KEGUNAAN: Komponen UI global — heatmap, history, signal, 3D viz
          (BENTUK A rim tersambung + judul tengah), kolaborasi,
          notifikasi (+ napas + tombol TEST Bentuk B), voice,
          editor misc, badge, cache stats (+ napas), fieldset,
          napas + inner laporan. Dimuat SETELAH style.css.
============================================================ */
/* ============================================================
CHAT STYLES
Sudah dipindah: styling chat AI/Agen/Forum sekarang sepenuhnya
dikelola masing-masing modul (interactive/chat-ai.js, chat-agent.js,
forum.js — tiap file menyuntik <style id="chat-complete-style">
sendiri dengan kelas ber-akhiran "-modern"). Blok lama di sini
memakai nama kelas TANPA "-modern" yang sudah tidak pernah dipakai
kode manapun — CSS mati, dihapus.
============================================================ */
/* ============================================================
HEATMAP
============================================================ */
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin: 12px 0;
}
.heatmap-cell {
    background: var(--primary-tint-10);
    border: 1px solid var(--primary-tint-30);
    border-radius: var(--radius-xs);
    padding: 8px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}
.heatmap-cell:hover {
    transform: scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}
.agent-name { font-weight: bold; color: var(--primary); font-size: 11px; }
.latency { font-size: 14px; font-weight: bold; display: block; }
.fail-badge {
    background: var(--color-dark-red);
    color: white;
    border-radius: 20px;
    padding: 2px 5px;
    font-size: 9px;
    margin-left: 4px;
}
/* ============================================================
HISTORY PANEL
============================================================ */
#historyPanel {
    background: rgba(12, 18, 32, 0.85);
    backdrop-filter: blur(12px);
}
.history-item {
    background: var(--primary-tint-05);
    border: 1px solid var(--primary-tint-20);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition);
}
.history-item:hover {
    background: var(--primary-tint-10);
    border-color: var(--primary);
    transform: translateX(4px);
}
.history-item-title {
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 6px;
}
.history-item-meta {
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.history-item-score { color: var(--primary); font-weight: bold; }
.history-item-date { font-family: monospace; }
/* ============================================================
SIGNAL & FILTER
============================================================ */
.signal-item {
    background: var(--primary-tint-05);
    border-radius: 14px;
    padding: 10px;
    margin-bottom: 10px;
    border-left: 3px solid var(--primary);
}
.signal-title { font-weight: bold; color: var(--primary); font-size: 12px; }
.signal-desc { font-size: 11px; color: #C0D0E5; margin-top: 4px; }
.filter-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.filter-card {
    background: var(--primary-tint-10);
    border-radius: var(--radius-sm);
    padding: 12px;
    flex: 1;
    min-width: 80px;
    text-align: center;
}
.filter-number {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--primary);
}
/* ============================================================
3D VISUALIZATION (BENTUK A — rim chamfer tersambung penuh,
glow hanya saat hover; judul di TENGAH, toggle tetap kanan)
============================================================ */
.viz-3d-container {
    position: relative;
    isolation: isolate;
    margin-top: 16px;
    clip-path: var(--kx-clip);
    border: 0;
    border-radius: 0;
    background: rgba(26, 255, 156, .3);
    padding: 1px; /* konten mundur 1px supaya rim kiri-kanan kelihatan */
    overflow: hidden;
    transition: background .25s ease, filter .3s ease;
}
.viz-3d-container::before {
    content: '';
    position: absolute;
    inset: 1px;
    clip-path: var(--kx-clip);
    background: #05080c;
    z-index: -1;
}
.viz-3d-container:hover {
    background: rgba(26, 255, 156, .55);
    filter: drop-shadow(0 0 7px var(--primary-glow));
}
.viz-3d-container.collapsed {
    height: 52px;
    min-height: 52px;
}
.viz-3d-container.collapsed #threeCanvas { display: none; }
.viz-3d-container.collapsed .viz-footer { display: none; }
.viz-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 56px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(26, 255, 156, .2);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}
.viz-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-tint-15);
    border: 1px solid var(--primary-tint-30);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 14px;
    color: var(--primary);
    cursor: pointer;
}
.viz-toggle:hover { background: var(--primary-tint-30); }
.viz-footer {
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(26, 255, 156, .15);
    font-size: 10px;
    color: var(--text-dim);
    text-align: center;
}
#threeCanvas {
    width: 100%;
    height: 380px !important;
    display: block;
}
/* ============================================================
COLLABORATION
============================================================ */
.collab-section {
    margin-top: 16px;
    border-top: 1px solid var(--primary-tint-20);
    padding-top: 12px;
}
.collab-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}
.collab-buttons { display: flex; gap: 8px; }
.collab-buttons .execute-btn.secondary {
    width: auto;
    padding: 6px 12px;
    font-size: 11px;
}
.chat-messages {
    height: 100px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    padding: 8px;
    margin-bottom: 6px;
    font-size: 10px;
}
.chat-input { display: flex; gap: 8px; }
.chat-input input { flex: 1; margin-bottom: 0; }
.chat-input button { width: auto; padding: 8px 12px; }
/* ============================================================
NOTIFICATION (napas 12px kiri-kanan, sejajar panel lain)
============================================================ */
.notif-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--primary-tint-20);
    box-sizing: border-box !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
}
.notif-section span { font-size: 11px; color: var(--text-dim); }
.notif-section label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 11px;
}
.notif-section input { width: 16px; height: 16px; margin: 0; }
.notif-section .execute-btn.secondary {
    width: auto;
}
/* ============================================================
VOICE INPUT
============================================================ */
#voiceInputBtn, #stopVoiceBtn {
    font-weight: bold !important;
    transition: var(--transition);
}
#voiceInputBtn:hover, #stopVoiceBtn:hover {
    transform: scale(1.02);
}
/* ============================================================
EDITOR MISC
============================================================ */
.editor-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.editor-preview {
    background: rgba(0,0,0,0.3);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
}
.editor-preview img,
.editor-preview video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
}
.editor-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}
.editor-controls button {
    background: var(--primary-tint-15);
    border: 1px solid var(--primary-tint-30);
    border-radius: 30px;
    padding: 6px 14px;
    color: var(--primary);
    cursor: pointer;
    font-size: 12px;
    transition: 0.2s;
}
.editor-controls button:hover {
    background: var(--primary-tint-30);
    transform: scale(1.02);
}
.editor-slider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}
.editor-slider input {
    flex: 1;
    background: rgba(255,255,255,0.2);
    height: 4px;
    border-radius: 2px;
}
/* ============================================================
FILTER BADGE, CAMERA, BADGES
============================================================ */
.filter-badge {
    background: var(--primary-tint-10);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
}
.filter-badge.active {
    background: var(--primary);
    color: var(--bg-dark);
}
.camera-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    border: none !important;
    color: var(--bg-dark) !important;
    font-weight: bold !important;
}
.video-cam-btn {
    background: linear-gradient(135deg, var(--color-yellow), var(--color-orange)) !important;
    border: none !important;
    color: var(--bg-dark) !important;
    font-weight: bold !important;
}
.browsing-badge {
    background: linear-gradient(135deg, var(--color-purple), #8E44AD);
    border: none;
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    margin-left: 8px;
}
.new-badge {
    background: var(--primary);
    color: var(--bg-dark);
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 9px;
    margin-left: 6px;
    font-weight: bold;
}
/* ============================================================
WORKFLOW BADGE
Sudah dipindah ke js/workflow.js (disuntik lewat
renderWorkflowModeSelector(), konsisten dengan pola "self
contained" — index.html & global.css tidak lagi menyimpan
apa pun yang berkaitan dengan workflow).
============================================================ */
/* ============================================================
CACHE STATS (napas 12px kiri-kanan, sejajar panel lain)
============================================================ */
.cache-stats {
    font-size: 10px;
    color: var(--primary);
    margin-top: 8px;
    padding: 3px 8px;
    background: var(--primary-tint-10);
    border-radius: 10px;
    display: inline-block;
}
#cacheStats {
    box-sizing: border-box !important;
    width: auto !important;
    margin: 8px 12px 0 !important;
}
/* ============================================================
FIELDSET & LEGEND
============================================================ */
fieldset {
    border: none !important;
    padding: 24px 0 10px 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
}
legend {
    padding: 0 12px 0 0 !important;
    margin: 0 0 10px 0 !important;
    width: auto !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--primary) !important;
    float: none !important;
    display: inline-block !important;
}
/* ============================================================
NAPAS PANEL LAPORAN — sejajar 12px dengan panel lain
============================================================ */
#reportPanelContainer {
    box-sizing: border-box !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
}
/* ============================================================
LAPORAN INTELIJEN — inner transparan (bingkai chamfer kini dari
.chart-container di charts.css, jadi di sini tidak boleh ada
border ganda)
============================================================ */
#reportContainer {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    text-align: left;
}
/* ============================================================
TOMBOL TEST (notifikasi) = BENTUK B — chamfer asimetris + rim
nyambung + shine sweep, satu keluarga dengan tombol eksekusi,
tab kategori, dan Select All/Deselect
============================================================ */
.notif-section .execute-btn.secondary {
    position: relative;
    isolation: isolate;
    clip-path: var(--kx-clip-asym);
    border: 0 !important;
    border-radius: 0 !important;
    background: rgba(26,255,156,.35) !important;
    padding: 8px 22px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 1.2px;
    color: var(--primary) !important;
    text-shadow: 0 0 8px var(--primary-glow);
    overflow: hidden;
    transition: background .25s ease, filter .25s ease, transform .15s ease;
}
.notif-section .execute-btn.secondary::before {
    content: '';
    position: absolute;
    inset: 1px;
    clip-path: var(--kx-clip-asym);
    background: #06100b;
    z-index: -1;
}
.notif-section .execute-btn.secondary::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 60%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.25), transparent);
    transform: translateX(-160%);
    transition: transform .6s ease;
    pointer-events: none;
}
.notif-section .execute-btn.secondary:hover {
    background: rgba(26,255,156,.6) !important;
    filter: drop-shadow(0 0 10px var(--primary-glow));
    transform: translateY(-1px);
}
.notif-section .execute-btn.secondary:hover::after { transform: translateX(260%); }
.notif-section .execute-btn.secondary:active { transform: scale(.97); }