/* Veronika Osclass Chat Plugin Pro - Responsive Flat UI */
:root {
    --vcp-accent: #2563eb;
    --vcp-accent-hover: #1d4ed8;
    --vcp-bg: #ffffff;
    --vcp-surface: #f8fafc;
    --vcp-border: #e2e8f0;
    --vcp-text: #0f172a;
    --vcp-muted: #64748b;
    --vcp-online: #22c55e;
    --vcp-offline: #94a3b8;
    --vcp-danger: #ef4444;
    --vcp-radius: 12px;
    --vcp-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}

/* Seller Chat Button (Veronika style) */
.vcp-item-btn-wrap {
    margin: 10px 0;
    width: 100%;
    box-sizing: border-box;
}
.vcp-seller-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: var(--vcp-accent);
    color: #fff !important;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.18s ease, transform 0.12s ease;
    box-sizing: border-box;
}
.vcp-seller-btn:hover {
    background: var(--vcp-accent-hover);
    color: #fff !important;
}
.vcp-seller-btn:active {
    transform: scale(0.99);
}
.vcp-status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--vcp-offline);
    flex-shrink: 0;
}
.vcp-status-dot.is-online {
    background: var(--vcp-online);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.28);
}

/* Floating Launcher */
.vcp-launcher {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 99990;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 18px;
    background: var(--vcp-accent);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--vcp-shadow);
    transition: transform 0.16s ease, background 0.16s ease;
}
.vcp-launcher.vcp-pos-left {
    right: auto;
    left: 22px;
}
.vcp-launcher:hover {
    transform: translateY(-2px);
    background: var(--vcp-accent-hover);
}
.vcp-badge {
    display: none;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--vcp-danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}
.vcp-badge.has-unread {
    display: inline-block;
}

/* Chat Drawer / Modal */
.vcp-widget {
    position: fixed;
    bottom: 84px;
    right: 22px;
    z-index: 99995;
    width: 720px;
    max-width: calc(100vw - 28px);
    height: 540px;
    max-height: calc(100vh - 110px);
    background: var(--vcp-bg);
    border: 1px solid var(--vcp-border);
    border-radius: var(--vcp-radius);
    box-shadow: var(--vcp-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--vcp-text);
}
.vcp-widget.vcp-pos-left {
    right: auto;
    left: 22px;
}
.vcp-widget.is-open {
    display: flex;
}

.vcp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    background: var(--vcp-accent);
    color: #fff;
}
.vcp-header-title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.vcp-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.vcp-icon-btn {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.vcp-icon-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

.vcp-body {
    flex: 1;
    display: flex;
    min-height: 0;
    background: var(--vcp-bg);
}

/* Sidebar Conversations List */
.vcp-sidebar {
    width: 260px;
    border-right: 1px solid var(--vcp-border);
    display: flex;
    flex-direction: column;
    background: var(--vcp-surface);
    min-height: 0;
}
.vcp-sidebar-search {
    padding: 10px;
    border-bottom: 1px solid var(--vcp-border);
}
.vcp-sidebar-search input {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 10px;
    border: 1px solid var(--vcp-border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}
.vcp-chat-list {
    flex: 1;
    overflow-y: auto;
}
.vcp-chat-item {
    padding: 11px 12px;
    border-bottom: 1px solid var(--vcp-border);
    cursor: pointer;
    transition: background 0.14s ease;
    position: relative;
}
.vcp-chat-item:hover {
    background: #eef2ff;
}
.vcp-chat-item.is-active {
    background: #dbeafe;
}
.vcp-chat-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 3px;
}
.vcp-chat-peer {
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vcp-chat-unread {
    background: var(--vcp-accent);
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
}
.vcp-chat-listing {
    font-size: 11px;
    color: var(--vcp-accent);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vcp-chat-preview {
    font-size: 12px;
    color: var(--vcp-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* Conversation Pane */
.vcp-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}
.vcp-conv-head {
    padding: 10px 14px;
    border-bottom: 1px solid var(--vcp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #fff;
}
.vcp-conv-meta {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.vcp-back-btn {
    display: none;
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    padding: 5px 9px;
    cursor: pointer;
    font-weight: 700;
}
.vcp-conv-peer-name {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}
.vcp-conv-item-link {
    font-size: 11px;
    color: var(--vcp-muted);
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}
.vcp-conv-item-link:hover {
    color: var(--vcp-accent);
    text-decoration: underline;
}
.vcp-conv-actions {
    display: flex;
    gap: 6px;
}
.vcp-mini-btn {
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--vcp-border);
    background: #fff;
    color: #475569;
    border-radius: 6px;
    cursor: pointer;
}
.vcp-mini-btn:hover {
    background: #f8fafc;
    color: var(--vcp-danger);
    border-color: #fecaca;
}

.vcp-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.vcp-empty {
    margin: auto;
    text-align: center;
    color: var(--vcp-muted);
    font-size: 13px;
    padding: 20px;
}
.vcp-msg {
    max-width: 78%;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.42;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.vcp-msg.is-peer {
    align-self: flex-start;
    background: #fff;
    color: var(--vcp-text);
    border: 1px solid var(--vcp-border);
    border-bottom-left-radius: 3px;
}
.vcp-msg.is-me {
    align-self: flex-end;
    background: var(--vcp-accent);
    color: #fff;
    border-bottom-right-radius: 3px;
}
.vcp-msg-meta {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.78;
}

.vcp-typing {
    padding: 4px 14px;
    font-size: 11px;
    color: var(--vcp-muted);
    font-style: italic;
    background: #f1f5f9;
    display: none;
}
.vcp-typing.is-visible {
    display: block;
}

.vcp-quick-bar {
    display: flex;
    gap: 6px;
    padding: 7px 10px;
    overflow-x: auto;
    border-top: 1px solid var(--vcp-border);
    background: #fff;
}
.vcp-quick-chip {
    flex-shrink: 0;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
}
.vcp-quick-chip:hover {
    border-color: var(--vcp-accent);
    color: var(--vcp-accent);
    background: #eff6ff;
}

.vcp-composer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--vcp-border);
    background: #fff;
}
.vcp-composer input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
}
.vcp-composer input:focus {
    border-color: var(--vcp-accent);
}
.vcp-send-btn {
    padding: 10px 16px;
    background: var(--vcp-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.vcp-send-btn:hover {
    background: var(--vcp-accent-hover);
}
.vcp-send-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.vcp-alert {
    padding: 8px 12px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 12px;
    border-top: 1px solid #fecaca;
    display: none;
}
.vcp-alert.is-visible {
    display: block;
}

/* Mobile Responsive (Veronika Breakpoints <= 767px) */
@media (max-width: 767px) {
    .vcp-widget {
        inset: 0 !important;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
    }
    .vcp-sidebar {
        width: 100%;
        border-right: none;
    }
    .vcp-widget.has-active-chat .vcp-sidebar {
        display: none;
    }
    .vcp-widget:not(.has-active-chat) .vcp-main {
        display: none;
    }
    .vcp-back-btn {
        display: inline-block;
    }
    .vcp-launcher {
        bottom: 16px;
        right: 16px;
        padding: 11px 15px;
    }
}
