/* BizzPlaza Chat v2.0.1 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Trigger knop ── */
#bzp-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #1a1a8c;
    color: #fff;
    padding: 14px 28px;
    border-radius: 30px;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(26,26,140,.35);
    transition: transform .2s, box-shadow .2s;
    user-select: none;
    margin: 24px auto;
    width: fit-content;
}
#bzp-trigger:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(26,26,140,.45); }
#bzp-trigger-badge {
    background: #e74c3c; color: #fff; border-radius: 50%;
    width: 22px; height: 22px; display: flex; align-items: center;
    justify-content: center; font-size: 12px; font-weight: 700;
}

/* ── Overlay + Panel ── */
#bzp-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 9998;
    background: rgba(0,0,0,.45);
    align-items: center; justify-content: center;
}
#bzp-overlay.open { display: flex; }

#bzp-panel {
    position: relative;
    width: min(960px, 96vw);
    height: min(680px, 92vh);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 60px rgba(0,0,0,.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #1a1a2e;
    transition: width .3s, height .3s;
}
#bzp-overlay.maximized #bzp-panel {
    width: 100vw; height: 100vh; border-radius: 0;
}

/* ── Header ── */
.bzp-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 18px; background: #1a1a8c; color: #fff; flex-shrink: 0;
}
.bzp-header-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.bzp-header-ctrl  { display: flex; gap: 6px; align-items: center; }
.bzp-ctrl-btn {
    background: rgba(255,255,255,.15); border: none; color: #fff;
    width: 30px; height: 30px; border-radius: 6px; cursor: pointer; font-size: 15px;
    display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.bzp-ctrl-btn:hover { background: rgba(255,255,255,.28); }

/* ── Gateway ── */
#bzp-gateway {
    flex: 1; display: flex; align-items: center;
    justify-content: center; padding: 32px; background: #f8f9ff;
}
.bzp-gw-inner { width: 100%; max-width: 380px; }
.bzp-gw-inner h3 { font-size: 20px; font-weight: 700; color: #1a1a8c; margin-bottom: 24px; text-align: center; }
.bzp-gw-box {
    margin-bottom: 16px; padding: 20px;
    background: #fff; border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
}
.bzp-gw-box p { margin-bottom: 12px; color: #555; font-size: 13px; }
.bzp-gw-login { text-align: center; margin-top: 16px; font-size: 13px; }
.bzp-gw-login a { color: #1a1a8c; text-decoration: none; font-weight: 600; }

/* ── Inputs ── */
.bzp-input {
    width: 100%; padding: 11px 14px;
    border: 2px solid #e0e0ef; border-radius: 8px;
    font-size: 14px; outline: none; font-family: inherit;
    transition: border-color .2s; margin-bottom: 10px;
}
.bzp-input:focus { border-color: #1a1a8c; }
.bzp-name-status { font-size: 12px; margin-bottom: 10px; min-height: 18px; }
.bzp-name-ok     { color: #27ae60; }
.bzp-name-taken  { color: #e74c3c; }
.bzp-checking    { color: #999; }

/* ── Tabs bar ── */
.bzp-tabs-bar {
    display: flex; align-items: center;
    background: #f0f0fa; border-bottom: 1px solid #e0e0ef;
    flex-shrink: 0; padding: 0 12px; min-height: 44px;
}
.bzp-tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.bzp-tabs::-webkit-scrollbar { display: none; }
.bzp-tab {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 14px; cursor: pointer; font-size: 13px;
    color: #666; border-bottom: 2px solid transparent;
    white-space: nowrap; transition: all .15s; user-select: none; flex-shrink: 0;
}
.bzp-tab:hover { color: #1a1a8c; }
.bzp-tab.active { color: #1a1a8c; border-bottom-color: #1a1a8c; font-weight: 600; }
.bzp-tab-badge {
    background: #e74c3c; color: #fff; border-radius: 10px;
    padding: 1px 6px; font-size: 11px; font-weight: 700;
}
.bzp-tab-close {
    background: none; border: none; color: #bbb; cursor: pointer;
    font-size: 16px; line-height: 1; padding: 0 0 0 4px; transition: color .15s;
}
.bzp-tab-close:hover { color: #e74c3c; }
.bzp-user-bar {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; color: #666; padding-left: 12px; flex-shrink: 0;
}
.bzp-logout-btn {
    display: flex; align-items: center; gap: 5px;
    background: #fee; color: #c0392b; border: 1px solid #fcc;
    padding: 5px 10px; border-radius: 6px; cursor: pointer;
    font-size: 12px; font-weight: 600; transition: background .15s;
}
.bzp-logout-btn:hover { background: #fdd; }

/* ── Chat body ── */
.bzp-body { display: flex; flex: 1; overflow: hidden; }
.bzp-msgs-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid #e8e8f0; }
.bzp-msgs {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth;
}

/* ── Messages ── */
.bzp-msg { display: flex; gap: 10px; align-items: flex-start; }
.bzp-msg.self { flex-direction: row-reverse; align-self: flex-end; max-width: 80%; }
.bzp-msg-inner { display: flex; flex-direction: column; gap: 3px; max-width: 100%; }
.bzp-msg-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bzp-msg.self .bzp-msg-meta { flex-direction: row-reverse; }
.bzp-sender { font-size: 12px; font-weight: 600; cursor: pointer; }
.bzp-sender:hover { text-decoration: underline; }
.bzp-sender.member { color: #1a1a8c; }
.bzp-sender.guest  { color: #999; }
.bzp-msg-time { font-size: 11px; color: #ccc; }
.bzp-bubble {
    background: #f0f0fa; padding: 10px 14px;
    border-radius: 4px 12px 12px 12px;
    line-height: 1.5; word-break: break-word; max-width: 100%;
}
.bzp-msg.self .bzp-bubble  { background: #1a1a8c; color: #fff; border-radius: 12px 4px 12px 12px; }
.bzp-msg.guest-msg .bzp-bubble { background: #f5f5f5; }
.bzp-msg-img   { max-width: 240px; max-height: 240px; border-radius: 8px; cursor: pointer; display: block; }
.bzp-msg-audio { max-width: 280px; }
.bzp-msg-file  { color: #1a1a8c; text-decoration: none; font-size: 13px; }
.bzp-mod-btn {
    background: none; border: none; cursor: pointer; font-size: 12px;
    padding: 2px 5px; color: #ccc; border-radius: 4px;
    opacity: 0; transition: opacity .15s;
}
.bzp-msg:hover .bzp-mod-btn { opacity: 1; }
.bzp-mod-btn:hover { background: #fee; color: #e74c3c; }
.bzp-sys-msg {
    text-align: center; font-size: 12px; color: #bbb;
    padding: 4px 8px; font-style: italic;
}
.bzp-sys-msg.err { color: #e74c3c; background: #fff5f5; padding: 6px 12px; border-radius: 8px; font-style: normal; }
.bzp-dm-req {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: #fffbe6; border: 1px solid #f0c040;
    border-radius: 10px; padding: 10px 14px; font-size: 13px;
}

/* ── Input bar ── */
.bzp-input-bar {
    display: flex; align-items: flex-end; gap: 8px;
    padding: 12px 16px; border-top: 1px solid #e8e8f0;
    background: #fff; flex-shrink: 0;
}
.bzp-toolbar { display: flex; gap: 4px; }
.bzp-tool-btn {
    background: none; border: none; cursor: pointer; font-size: 20px;
    padding: 6px; border-radius: 8px; color: #888; transition: background .15s;
}
.bzp-tool-btn:hover { background: #f0f0fa; }
.bzp-tool-btn.recording { color: #e74c3c; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.bzp-textarea {
    flex: 1; padding: 10px 14px; border: 2px solid #e0e0ef; border-radius: 20px;
    font-size: 14px; outline: none; resize: none; font-family: inherit;
    line-height: 1.4; max-height: 100px; overflow-y: auto;
    transition: border-color .2s;
}
.bzp-textarea:focus { border-color: #1a1a8c; }
.bzp-send-btn {
    background: #1a1a8c; color: #fff; border: none;
    width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
    font-size: 18px; display: flex; align-items: center; justify-content: center;
    transition: background .2s, transform .15s; flex-shrink: 0;
}
.bzp-send-btn:hover { background: #2d2daa; transform: scale(1.06); }

/* ── Sidebar ── */
.bzp-sidebar {
    width: 230px; flex-shrink: 0;
    display: flex; flex-direction: column;
    background: #fafafa; overflow: hidden;
}
.bzp-sidebar-hdr {
    padding: 12px 16px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px;
    color: #aaa; border-bottom: 1px solid #ebebf0; flex-shrink: 0;
}
.bzp-members { flex: 1; overflow-y: auto; padding: 6px 0; }
.bzp-member {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 16px; cursor: pointer; transition: background .15s;
}
.bzp-member:hover { background: #f0f0fa; }
.bzp-m-info { flex: 1; overflow: hidden; min-width: 0; }
.bzp-m-name {
    font-size: 13px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; display: block;
}
.bzp-m-badge {
    font-size: 10px; background: #e8e8ff; color: #1a1a8c;
    padding: 1px 6px; border-radius: 4px; display: inline-block; margin-top: 2px;
}
.bzp-online-dot { width: 8px; height: 8px; background: #27ae60; border-radius: 50%; flex-shrink: 0; }

/* ── Avatars ── */
.bzp-av {
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; flex-shrink: 0; overflow: hidden;
    font-weight: 700; font-size: 11px; background: #1a1a8c; color: #fff;
}
.bzp-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.bzp-av.mystery { background: #ddd; color: #999; }
.bzp-av.guest-av { background: #bbb; color: #fff; }

/* ── Profile popup ── */
.bzp-prof-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.42);
    display: flex; align-items: center; justify-content: center;
    z-index: 50;
}
.bzp-popup {
    background: #fff; border-radius: 14px;
    padding: 24px; width: 300px; position: relative;
    box-shadow: 0 8px 30px rgba(0,0,0,.18);
}
.bzp-pop-close {
    position: absolute; top: 12px; right: 14px;
    background: none; border: none; cursor: pointer;
    color: #bbb; font-size: 20px; line-height: 1;
    font-weight: 700; transition: color .15s;
}
.bzp-pop-close:hover { color: #333; }
.bzp-prof-hdr { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.bzp-prof-hdr h4 { margin: 0 0 4px; font-size: 16px; color: #1a1a2e; }
.bzp-prof-type { font-size: 12px; color: #aaa; }
.bzp-prof-actions { display: flex; flex-direction: column; gap: 8px; }
.bzp-ip {
    font-size: 12px; font-family: monospace;
    background: #f5f5f5; padding: 5px 10px; border-radius: 6px;
}
.bzp-mod-sep { border: none; border-top: 1px solid #eee; margin: 4px 0; }
.bzp-guest-note { font-size: 12px; color: #aaa; font-style: italic; text-align: center; }

/* ── Buttons ── */
.bzp-btn {
    padding: 10px 16px; border: none; border-radius: 8px; cursor: pointer;
    font-size: 13px; font-weight: 600; font-family: inherit;
    transition: all .15s; text-align: center; text-decoration: none;
    display: block; width: 100%;
}
.bzp-btn.primary   { background: #1a1a8c; color: #fff; }
.bzp-btn.primary:hover { background: #2d2daa; }
.bzp-btn.primary:disabled { background: #aab; cursor: not-allowed; }
.bzp-btn.secondary { background: #f0f0fa; color: #1a1a8c; }
.bzp-btn.secondary:hover { background: #e0e0ef; }
.bzp-btn.ghost     { background: none; color: #666; border: 1px solid #ddd; }
.bzp-btn.ghost:hover { background: #f5f5f5; }
.bzp-btn.warn      { background: #fff3cd; color: #856404; }
.bzp-btn.warn:hover { background: #ffeaa7; }
.bzp-btn.danger    { background: #fee; color: #e74c3c; }
.bzp-btn.danger:hover { background: #fdd; }
.bzp-btn.sm        { padding: 6px 12px; font-size: 12px; width: auto; display: inline-block; }

/* ── Loading ── */
#bzp-loading {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 14px; color: #aaa;
}
.bzp-spinner {
    width: 34px; height: 34px; border: 3px solid #e0e0ef;
    border-top-color: #1a1a8c; border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Responsive ── */
@media (max-width: 640px) {
    #bzp-panel { width: 100vw; height: 100vh; border-radius: 0; }
    #bzp-overlay.open { align-items: flex-end; }
    .bzp-sidebar { width: 180px; }
    .bzp-popup { width: calc(100vw - 32px); }
    .bzp-msg.self { max-width: 90%; }
}
@media (max-width: 480px) {
    .bzp-sidebar { display: none; }
    .bzp-sidebar.mobile-open { display: flex; position: absolute; right: 0; top: 44px; bottom: 56px; z-index: 10; box-shadow: -4px 0 20px rgba(0,0,0,.1); }
}
