/* ============================================================
   assets/css/ziro-bot.css — Widget chat Zi-Ro<<BOT>>
   ============================================================ */

.zb {
    position: fixed;
    right: 16px;
    bottom: 88px;
    z-index: 9998;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.zb *,
.zb *::before,
.zb *::after { box-sizing: border-box; }

/* ---------- Launcher ---------- */

.zb-launcher {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(255, 77, 77, 0.45);
    background: linear-gradient(135deg, rgba(28, 12, 16, 0.96), rgba(14, 14, 20, 0.96));
    color: #fff;
    padding: 11px 16px 11px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 18px rgba(255, 77, 77, 0.18);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.zb-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6), 0 0 26px rgba(255, 77, 77, 0.3);
}

.zb-launcher-orb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #ff9a9a, #ff4d4d 45%, #8b1f1f 100%);
    box-shadow: 0 0 12px rgba(255, 77, 77, 0.75);
    position: relative;
    flex: none;
    animation: zbPulse 2.8s ease-in-out infinite;
}

.zb-launcher-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 8px #34d399;
    flex: none;
}

.zb-tag {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.86em;
    color: #ff6b6b;
    letter-spacing: -0.3px;
}

@keyframes zbPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(0.92); opacity: 0.85; }
}

/* ---------- Panel ---------- */

.zb-panel {
    position: absolute;
    right: 0;
    bottom: 62px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(18, 16, 22, 0.98), rgba(10, 10, 14, 0.99));
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 77, 77, 0.08);
    overflow: hidden;
    opacity: 0;
    transform: translateY(14px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.zb.zb-open .zb-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.zb.zb-open .zb-launcher { display: none; }

/* ---------- Header ---------- */

.zb-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: linear-gradient(135deg, rgba(255, 77, 77, 0.14), rgba(255, 77, 77, 0.02));
    flex: none;
}

.zb-avatar {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    background: linear-gradient(135deg, #ff4d4d, #a11a1a);
    box-shadow: 0 4px 14px rgba(255, 77, 77, 0.35);
    flex: none;
}

.zb-head-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.zb-head-text strong {
    font-size: 14px;
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
}

.zb-head-text small {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    color: #9aa0ab;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.zb-live {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 7px #34d399;
    display: inline-block;
}

.zb-close {
    margin-left: auto;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.04);
    color: #c4c8d0;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    transition: 0.2s ease;
}

.zb-close:hover { background: rgba(255, 77, 77, 0.18); color: #fff; }

/* ---------- Body ---------- */

.zb-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 12px 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 77, 77, 0.35) transparent;
}

.zb-body::-webkit-scrollbar { width: 6px; }
.zb-body::-webkit-scrollbar-thumb {
    background: rgba(255, 77, 77, 0.35);
    border-radius: 6px;
}

.zb-msg { display: flex; }
.zb-msg.zb-user { justify-content: flex-end; }

.zb-bubble {
    max-width: 86%;
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    color: #e7e9ee;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom-left-radius: 5px;
    word-break: break-word;
    white-space: pre-wrap;
}

.zb-msg.zb-user .zb-bubble {
    background: linear-gradient(135deg, #ff4d4d, #b32020);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 5px;
}

.zb-msg.zb-err .zb-bubble {
    background: rgba(255, 77, 77, 0.12);
    border-color: rgba(255, 77, 77, 0.35);
    color: #ffb4b4;
}

/* refs */

.zb-refs {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 7px;
    max-width: 86%;
}

.zb-refs-title {
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: #7d838f;
    font-weight: 700;
}

.zb-ref {
    display: block;
    font-size: 11.5px;
    line-height: 1.35;
    padding: 6px 9px;
    border-radius: 9px;
    color: #d8dbe2;
    text-decoration: none;
    background: rgba(255, 77, 77, 0.08);
    border: 1px solid rgba(255, 77, 77, 0.22);
    transition: 0.18s ease;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.zb-ref:hover {
    background: rgba(255, 77, 77, 0.18);
    border-color: rgba(255, 77, 77, 0.45);
    color: #fff;
}

/* typing */

.zb-typing .zb-bubble {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
}

.zb-typing i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff6b6b;
    display: block;
    animation: zbBlink 1.15s infinite ease-in-out;
}

.zb-typing i:nth-child(2) { animation-delay: 0.16s; }
.zb-typing i:nth-child(3) { animation-delay: 0.32s; }

@keyframes zbBlink {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40%           { opacity: 1; transform: translateY(-3px); }
}

/* ---------- Chips ---------- */

.zb-chips {
    display: flex;
    gap: 6px;
    padding: 8px 12px 0;
    overflow-x: auto;
    scrollbar-width: none;
    flex: none;
}

.zb-chips::-webkit-scrollbar { display: none; }

.zb-chip {
    flex: none;
    font-size: 11.5px;
    font-weight: 600;
    color: #cfd3da;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 6px 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.18s ease;
}

.zb-chip:hover {
    background: rgba(255, 77, 77, 0.16);
    border-color: rgba(255, 77, 77, 0.42);
    color: #fff;
}

/* ---------- Form ---------- */

.zb-form {
    display: flex;
    align-items: flex-end;
    gap: 7px;
    padding: 10px 12px 6px;
    flex: none;
}

.zb-input-wrap {
    position: relative;
    flex: 1 1 auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 13px;
    padding: 8px 10px 16px;
    transition: border-color 0.2s ease;
}

.zb-input-wrap:focus-within {
    border-color: rgba(255, 77, 77, 0.55);
    box-shadow: 0 0 0 3px rgba(255, 77, 77, 0.1);
}

.zb-input-wrap textarea {
    width: 100%;
    border: 0;
    outline: 0;
    resize: none;
    background: transparent;
    color: #eceef2;
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.45;
    max-height: 92px;
    overflow-y: auto;
    display: block;
}

.zb-input-wrap textarea::placeholder { color: #6f7580; }

.zb-counter {
    position: absolute;
    right: 10px;
    bottom: 3px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 9.5px;
    color: #666c77;
    pointer-events: none;
}

.zb-counter.zb-warn { color: #ff8a8a; }

.zb-send {
    width: 38px;
    height: 38px;
    flex: none;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff4d4d, #b32020);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: 0.18s ease;
    box-shadow: 0 6px 16px rgba(255, 77, 77, 0.28);
}

.zb-send:hover { transform: translateY(-1px); }
.zb-send:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.zb-foot {
    padding: 0 14px 9px;
    font-size: 10px;
    color: #6f7580;
    letter-spacing: 0.3px;
    flex: none;
}

.zb-foot.zb-empty { color: #ff9a9a; }

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
    .zb {
        right: 12px;
        bottom: 82px;
    }

    .zb-launcher {
        padding: 10px 14px 10px 10px;
        font-size: 12px;
    }

    .zb-launcher-label { display: none; }

    .zb-panel {
        width: calc(100vw - 24px);
        height: calc(100vh - 150px);
        max-height: 560px;
        bottom: 58px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zb-launcher-orb,
    .zb-typing i { animation: none; }
    .zb-panel { transition: none; }
}

/* ============================================================
   TOMBOL PEMICU DI NAVBAR (data-zb-open)
   Desktop  : navbar jadi pintu masuk, launcher floating disembunyikan.
   Mobile   : tombol navbar disembunyikan, launcher floating tetap dipakai
              karena ruang navbar sangat sempit.
   ============================================================ */

.zir-bot-nav-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    height: 30px !important;
    min-width: 30px !important;
    padding: 0 11px !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
    border: 1px solid rgba(45, 143, 255, 0.55) !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, rgba(34, 184, 255, 0.18), rgba(124, 92, 255, 0.26)) !important;
    color: #cfefff !important;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: 0.2px !important;
    cursor: pointer !important;
    box-shadow: 0 0 12px rgba(34, 184, 255, 0.18) !important;
    transition: color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease !important;
    -webkit-tap-highlight-color: transparent;
}

.zir-bot-nav-btn:hover,
.zir-bot-nav-btn:focus-visible {
    color: #ffffff !important;
    border-color: rgba(104, 229, 255, 0.95) !important;
    box-shadow: 0 0 14px rgba(34, 184, 255, 0.45) !important;
    outline: none !important;
}

.zir-bot-nav-btn:active { transform: scale(.96) !important; }

.zir-bot-nav-btn.is-open {
    color: #ffffff !important;
    border-color: rgba(104, 229, 255, 1) !important;
    box-shadow: 0 0 16px rgba(34, 184, 255, 0.6) !important;
}

.zir-bot-nav-btn svg {
    width: 15px !important;
    height: 15px !important;
    display: block !important;
    flex: 0 0 auto !important;
}

.zir-bot-nav-txt {
    display: inline-block;
    white-space: nowrap;
    line-height: 1;
}

.zir-bot-nav-txt .zb-tag { color: #68e5ff; font-weight: 800; }

/* layar sedang: ikon saja, tanpa teks */
@media (max-width: 1100px) {
    .zir-bot-nav-txt { display: none; }
    .zir-bot-nav-btn { width: 30px !important; min-width: 30px !important; padding: 0 !important; }
}

/* mobile: tombol navbar disembunyikan */
@media (max-width: 768px) {
    .zir-bot-nav-btn { display: none !important; }
}

/* pintu masuk = item navbar bawah; launcher mengambang disembunyikan */
.zb.zb-has-nav .zb-launcher { display: none !important; }

/* posisikan panel di atas bottom navbar (68px) */
.zb.zb-has-nav { bottom: 24px; }

/* tombol kirim video di header bot */
.zb-head .zb-close { margin-left: 6px; }
.zb-video {
    margin-left: auto;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.04);
    color: #c4c8d0;
    cursor: pointer;
    flex: none;
    transition: 0.2s ease;
}
.zb-video:hover { background: rgba(0, 255, 204, 0.14); color: #00ffcc; border-color: rgba(0, 255, 204, 0.45); }

/* ---------- Wordmark partikel Zi-Ro<<BOT>> (gaya header situs) ---------- */
.zb-head-text { flex: 1 1 auto; }

.zb-brand.zb-avp {
    position: relative;
    display: block;
    width: 100%;
    height: 26px;
    overflow: hidden;
    isolation: isolate;
    contain: layout paint;
}
.zb-avp .zb-avp-word {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 1;
    height: 26px;
    line-height: 26px;
    text-align: center;
    white-space: nowrap;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 22px;
    font-style: italic;
    font-weight: 900;
    letter-spacing: -0.2px;
    transform: scaleX(1.06);
    background: linear-gradient(105deg, #ff70f0 0%, #c0b6ff 22%, #fff 48%, #b8f5ff 67%, #5094ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 6px rgba(83, 125, 255, 0.55));
}
.zb-avp .zb-avp-canvas {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.zb-avp.is-js .zb-avp-word { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
    .zb-avp .zb-avp-word { filter: none; }
}

/* ============================================================
   ISOLASI HEADER PANEL  (fix: tombol × jatuh ke tengah)
   ------------------------------------------------------------
   index.css / read.css / category.css memasang rule TAG global:
     header{ flex-direction:column !important;
             align-items:center !important;
             position:sticky !important;
             z-index:99990 !important; ... }
   Rule itu ikut mengenai <header class="zb-head"> di panel bot,
   sehingga tombol × terdorong ke tengah dan wordmark mengecil.
   Blok ini mengunci ulang layout header panel dengan specificity
   lebih tinggi (0,2,0 vs 0,0,1) + !important.
   ============================================================ */
.zb-panel .zb-head {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    padding: 12px 14px !important;
    width: auto !important;
    min-height: 72px !important;
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    text-align: left !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
    box-shadow: inset 0 -1px 0 rgba(255, 77, 77, .18) !important;
    background:
        radial-gradient(130% 200% at 0% 0%, rgba(255, 77, 77, .18), rgba(255, 77, 77, 0) 62%),
        linear-gradient(135deg, rgba(255, 77, 77, .10), rgba(255, 77, 77, .02)) !important;
}

/* kolom teks mengisi sisa lebar, isinya rata kiri */
.zb-panel .zb-head .zb-head-text {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    align-items: flex-start !important;
    gap: 3px !important;
}

/* wordmark partikel: lebih besar, rata kiri sejajar bubble chat */
.zb-panel .zb-head .zb-brand.zb-avp {
    width: 100% !important;
    height: 36px !important;
    text-align: left !important;
}

.zb-panel .zb-head .zb-avp .zb-avp-word {
    height: 36px !important;
    line-height: 36px !important;
    font-size: 30px !important;
    text-align: left !important;
    transform: scaleX(1.04) !important;
    transform-origin: left center !important;
}

.zb-panel .zb-head .zb-head-text small {
    font-size: 11px !important;
    letter-spacing: .7px !important;
}

/* kontrol kanan tetap satu baris dengan wordmark, tidak turun ke tengah */
.zb-panel .zb-head .zb-video {
    margin-left: auto !important;
    margin-right: 0 !important;
    width: 32px !important;
    height: 32px !important;
    flex: 0 0 auto !important;
}

.zb-panel .zb-head .zb-close {
    margin-left: 4px !important;
    width: 32px !important;
    height: 32px !important;
    flex: 0 0 auto !important;
}

