/* ============================================================
   PA Jeneponto Chatbot  –  pacb-style.css  v1.2
   PTSP Online · Tampilan profesional dengan tema Navy + Gold + Yellow
   ============================================================ */

:root {
    --pacb-navy-900: #0b1d40;
    --pacb-navy-700: #15346b;
    --pacb-navy-500: #1f4a8e;
    --pacb-gold:     #d4a437;
    --pacb-gold-soft:#f1c75c;
    --pacb-yellow:   #ffcb2e;
    --pacb-ink:      #16223d;
    --pacb-muted:    #6b7891;
    --pacb-surface:  #ffffff;
    --pacb-soft:     #f4f6fb;
    --pacb-border:   #e6ebf3;
    --pacb-success:  #18b864;
    --pacb-font:     'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

/* ── Toggle wrap ── */
#pacb-wrap {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99999;
    font-family: var(--pacb-font);
}

#pacb-toggle {
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    position: relative;
    transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
#pacb-toggle:hover { transform: translateY(-4px); }
#pacb-toggle:focus-visible {
    outline: 3px solid var(--pacb-gold-soft);
    outline-offset: 4px;
    border-radius: 12px;
}

/* Pulse rings */
.pacb-pulse-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
}
.pacb-pulse-ring {
    position: absolute;
    width: 86px; height: 86px;
    border-radius: 50%;
    background: rgba(212,164,55,0.30);
    animation: pacb-pulse-out 2.4s ease-out infinite;
    pointer-events: none;
}
.pacb-pulse-ring-2 {
    position: absolute;
    width: 86px; height: 86px;
    border-radius: 50%;
    background: rgba(255,203,46,0.22);
    animation: pacb-pulse-out 2.4s ease-out infinite .8s;
    pointer-events: none;
}
@keyframes pacb-pulse-out {
    0%   { transform: scale(1);    opacity: .85; }
    100% { transform: scale(1.85); opacity: 0;   }
}

/* Officer circle (photo) */
.pacb-officer-circle {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--pacb-yellow);
    border: 3px solid var(--pacb-gold);
    box-shadow:
        0 10px 28px rgba(11,29,64,.35),
        0 0 0 4px rgba(255,255,255,.85) inset;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.pacb-officer-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 28%;
    display: block;
    transition: transform .35s ease;
}
#pacb-toggle:hover .pacb-officer-img { transform: scale(1.06); }

/* Live dot */
.pacb-live-badge {
    position: absolute;
    bottom: 4px; right: 4px;
    width: 16px; height: 16px;
    background: var(--pacb-success);
    border-radius: 50%;
    border: 2.5px solid #fff;
    box-shadow: 0 0 0 2px rgba(24,184,100,.25);
    animation: pacb-blink-live 1.8s ease-in-out infinite;
    z-index: 2;
}
@keyframes pacb-blink-live { 0%,100%{opacity:1} 50%{opacity:.35} }

/* PTSP pill */
.pacb-ptsp-pill {
    margin-top: 10px;
    background: linear-gradient(135deg, var(--pacb-navy-900) 0%, var(--pacb-navy-500) 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    padding: 6px 16px 5px;
    border-radius: 22px;
    text-align: center;
    line-height: 1.3;
    box-shadow: 0 6px 16px rgba(11,29,64,.35);
    white-space: nowrap;
    border: 1.5px solid rgba(212,164,55,.55);
    text-transform: uppercase;
}
.pacb-ptsp-pill span {
    display: block;
    font-size: 8.5px;
    font-weight: 500;
    color: var(--pacb-gold-soft);
    letter-spacing: .04em;
    text-transform: none;
    margin-top: 2px;
}

/* Notification badge */
.pacb-notif {
    position: absolute;
    top: 0; right: 0;
    min-width: 20px; height: 20px;
    padding: 0 5px;
    background: #f43f5e;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 3px 8px rgba(244,63,94,.45);
    animation: pacb-pop .45s cubic-bezier(.36,.07,.19,.97) both;
    z-index: 3;
}
@keyframes pacb-pop {
    0%   { transform: scale(0); }
    80%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ── Chat window ── */
#pacb-window {
    position: absolute;
    bottom: 158px;
    right: 0;
    width: 360px;
    background: var(--pacb-surface);
    border-radius: 20px;
    box-shadow:
        0 24px 60px rgba(11,29,64,.28),
        0 4px 14px rgba(11,29,64,.10);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(.94) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform .28s cubic-bezier(.34,1.56,.64,1), opacity .22s ease;
    transform-origin: bottom right;
    border: 1px solid var(--pacb-border);
}
#pacb-window.pacb-open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* ── Cover banner ── */
.pacb-cover {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: var(--pacb-yellow);
}
.pacb-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}
.pacb-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(11,29,64,0) 0%,
        rgba(11,29,64,0) 45%,
        rgba(11,29,64,.55) 100%);
    pointer-events: none;
}

/* ── Header ── */
.pacb-header {
    background: linear-gradient(135deg, var(--pacb-navy-900) 0%, var(--pacb-navy-700) 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}
.pacb-header::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--pacb-gold) 0%, var(--pacb-yellow) 50%, var(--pacb-gold) 100%);
}
.pacb-header-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--pacb-yellow);
    border: 2px solid var(--pacb-gold);
    box-shadow: 0 4px 10px rgba(0,0,0,.25);
    flex-shrink: 0;
}
.pacb-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 28%;
    display: block;
}
.pacb-header-info { flex: 1; min-width: 0; }
.pacb-header-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 2px;
    letter-spacing: .01em;
}
.pacb-header-status {
    font-size: 11px;
    color: rgba(220,230,250,.85);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pacb-online-dot {
    width: 8px; height: 8px;
    background: var(--pacb-success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(24,184,100,.28);
    animation: pacb-blink 2s ease-in-out infinite;
}
@keyframes pacb-blink { 0%,100%{opacity:1} 50%{opacity:.3} }

.pacb-header-wa {
    color: #4eff91;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(78,255,145,.12);
    border: 1.5px solid rgba(78,255,145,.35);
    flex-shrink: 0;
    transition: background .2s ease, transform .2s ease;
    text-decoration: none;
}
.pacb-header-wa:hover {
    background: rgba(78,255,145,.22);
    transform: scale(1.06);
}

/* ── PTSP Banner (legacy, injected by JS) ── */
.pacb-ptsp-banner {
    background: linear-gradient(90deg, var(--pacb-gold) 0%, var(--pacb-yellow) 50%, var(--pacb-gold) 100%);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(11,29,64,.12);
}
.pacb-ptsp-icon { font-size: 16px; line-height: 1; }
.pacb-ptsp-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--pacb-navy-900);
    letter-spacing: .12em;
    text-transform: uppercase;
}
.pacb-ptsp-sub {
    font-size: 9.5px;
    color: rgba(11,29,64,.78);
    font-weight: 600;
    letter-spacing: .02em;
}

/* ── Messages ── */
.pacb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 230px;
    max-height: 310px;
    background: var(--pacb-soft);
    scroll-behavior: smooth;
}
.pacb-messages::-webkit-scrollbar { width: 5px; }
.pacb-messages::-webkit-scrollbar-thumb { background: #cdd6e3; border-radius: 4px; }
.pacb-messages::-webkit-scrollbar-thumb:hover { background: #a8b4c6; }

.pacb-msg {
    display: flex;
    flex-direction: column;
    max-width: 84%;
    animation: pacb-fadeup .28s ease both;
}
@keyframes pacb-fadeup {
    from { opacity:0; transform:translateY(8px); }
    to   { opacity:1; transform:translateY(0); }
}
.pacb-msg.bot  { align-self: flex-start; }
.pacb-msg.user { align-self: flex-end; }

.pacb-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.55;
    word-break: break-word;
}
.pacb-msg.bot .pacb-bubble {
    background: #fff;
    color: var(--pacb-ink);
    border: 1px solid var(--pacb-border);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 6px rgba(11,29,64,.06);
}
.pacb-msg.user .pacb-bubble {
    background: linear-gradient(135deg, var(--pacb-navy-500) 0%, var(--pacb-navy-900) 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 3px 10px rgba(11,29,64,.22);
}
.pacb-msg.bot .pacb-bubble a { color: var(--pacb-navy-500); font-weight: 600; }

.pacb-time {
    font-size: 10px;
    color: var(--pacb-muted);
    margin-top: 4px;
    padding: 0 4px;
}
.pacb-msg.user .pacb-time { text-align: right; }

/* WA Card */
.pacb-wa-card {
    background: #fff;
    border: 1.5px solid var(--pacb-border);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 4px 14px rgba(11,29,64,.08);
}
.pacb-wa-card p {
    font-size: 12.5px;
    color: var(--pacb-ink);
    margin: 0 0 10px;
    line-height: 1.5;
}
.pacb-wa-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25d366;
    color: #fff !important;
    font-size: 12.5px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 22px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(37,211,102,.35);
    transition: transform .2s ease, box-shadow .2s ease;
}
.pacb-wa-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37,211,102,.45);
    text-decoration: none;
}
.pacb-wa-btn svg { flex-shrink: 0; }

/* Typing indicator */
.pacb-typing .pacb-bubble {
    padding: 11px 14px;
    display: flex;
    gap: 4px;
    align-items: center;
}
.pacb-dot {
    width: 7px; height: 7px;
    background: var(--pacb-muted);
    border-radius: 50%;
    animation: pacb-bounce 1.2s ease-in-out infinite;
}
.pacb-dot:nth-child(2) { animation-delay: .18s; }
.pacb-dot:nth-child(3) { animation-delay: .36s; }
@keyframes pacb-bounce {
    0%,80%,100% { transform: translateY(0); }
    40%          { transform: translateY(-6px); }
}

/* ── Quick replies ── */
.pacb-quick {
    padding: 8px 14px 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: var(--pacb-soft);
    border-top: 1px solid var(--pacb-border);
}
.pacb-qbtn {
    background: #fff;
    border: 1.5px solid var(--pacb-navy-500);
    color: var(--pacb-navy-700);
    font-size: 11.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 22px;
    cursor: pointer;
    transition: background .15s, color .15s, transform .15s;
    white-space: nowrap;
    font-family: inherit;
}
.pacb-qbtn:hover {
    background: var(--pacb-navy-700);
    color: #fff;
    transform: translateY(-1px);
}

/* ── Input area ── */
.pacb-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--pacb-border);
    background: #fff;
}
#pacb-input {
    flex: 1;
    border: 1.5px solid #d6dde9;
    border-radius: 22px;
    padding: 9px 16px;
    font-size: 13px;
    color: var(--pacb-ink);
    outline: none;
    transition: border-color .2s, background .2s, box-shadow .2s;
    background: var(--pacb-soft);
    font-family: inherit;
}
#pacb-input:focus {
    border-color: var(--pacb-navy-500);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(31,74,142,.12);
}
#pacb-input::placeholder { color: var(--pacb-muted); }

#pacb-send {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--pacb-navy-500) 0%, var(--pacb-navy-900) 100%);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform .18s ease, box-shadow .18s ease;
    box-shadow: 0 5px 14px rgba(11,29,64,.30);
}
#pacb-send:hover {
    transform: scale(1.08) rotate(-4deg);
    box-shadow: 0 8px 18px rgba(11,29,64,.40);
}
#pacb-send:focus-visible {
    outline: 3px solid var(--pacb-gold-soft);
    outline-offset: 2px;
}

/* ── Footer note ── */
.pacb-footer-note {
    text-align: center;
    font-size: 10.5px;
    color: var(--pacb-muted);
    padding: 7px 12px 11px;
    background: #fff;
    margin: 0;
    border-top: 1px solid var(--pacb-border);
}
.pacb-footer-note a {
    color: var(--pacb-navy-500);
    font-weight: 700;
    text-decoration: none;
}
.pacb-footer-note a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 420px) {
    #pacb-wrap { bottom: 16px; right: 16px; }
    #pacb-window { width: calc(100vw - 32px); right: 0; }
    .pacb-cover { height: 84px; }
}

@media (prefers-reduced-motion: reduce) {
    .pacb-pulse-ring, .pacb-pulse-ring-2, .pacb-live-badge,
    .pacb-online-dot, .pacb-dot, .pacb-qbtn, #pacb-send,
    .pacb-officer-img, #pacb-toggle { animation: none; transition: none; }
}
