﻿/* ============================================
   Olvos Chat Stylesheet
   Network-scoped member chat UI
   ============================================ */

/* ── Full-page chat wrapper ── */
.argus-chat-page {
    position: fixed;
    top: var(--argus-chat-top, 100px);
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10;
    background: #f5f5f5;
}

/* ── Chat Container ── */
.olvos-chat-container {
    display: flex;
    flex: 1;
    min-height: 0; /* required for flex children to shrink correctly */
    width: 100%;
    background: #f5f5f5;
    overflow: hidden;
    height: 100% !important;
}

/* ── Sidebar (Contact List) ── */
.olvos-chat-sidebar {
    background: #ffffff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    width: 25vw;
    max-width: 25vw;
    min-width: 240px;
    flex-shrink: 0;
}

.olvos-chat-sidebar-header {
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
    background: #ffffff;
}

.olvos-chat-sidebar-header h2 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
    color: #212121;
}

.olvos-chat-search {
    width: 100%;
    padding: 5px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.olvos-chat-search:focus {
    outline: none;
    border-color: var(--bs-primary);
}

.olvos-chat-contacts-list {
    flex: 1;
    overflow-y: auto;
    padding: 2px;
}

.olvos-chat-section-header {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9e9e9e;
    border-top: 1px solid #e0e0e0;
    margin-top: 4px;
}

.olvos-chat-contact-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f5f5f5;
}

.olvos-chat-contact-item:hover {
    background-color: #f5f5f5;
}

.olvos-chat-contact-item.active {
    background-color: rgba(var(--bs-primary-rgb), 0.08);
    border-left: 3px solid var(--bs-primary);
}

.olvos-chat-contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: #757575;
    margin-right: 8px;
    overflow: hidden;
}

.olvos-chat-contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.olvos-chat-contact-info {
    flex: 1;
    min-width: 0;
}

.olvos-chat-contact-name {
    font-size: 13px;
    font-weight: 500;
    color: #212121;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.olvos-chat-contact-preview {
    font-size: 12px;
    color: #757575;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.olvos-chat-preview-new {
    color: var(--bs-primary);
    font-style: italic;
}

.olvos-chat-item-starting {
    opacity: 0.7;
    pointer-events: none;
}

.olvos-chat-item-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-top-color: var(--bs-primary);
    border-radius: 50%;
    animation: olvos-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.olvos-chat-contact-badge {
    background: var(--bs-primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* ── Conversation Panel ── */
.olvos-chat-conversation {
    flex: 1;
    min-height: 0; /* required for flex shrink to work */
    display: flex;
    flex-direction: column;
    background: #ffffff;
    overflow: hidden;
    position: relative;
}

.olvos-chat-conversation-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #ffffff;
    display: flex;
    align-items: center;
}

.olvos-chat-conversation-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #757575;
    margin-right: 12px;
    overflow: hidden;
}

.olvos-chat-conversation-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.olvos-chat-conversation-header-info h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #212121;
}

.olvos-chat-conversation-header-status {
    font-size: 13px;
    color: #757575;
}

.olvos-chat-conversation-header-status.online {
    color: #4caf50;
}

/* ── Messages Area ── */
.olvos-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
}

.olvos-chat-message {
    display: flex;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.olvos-chat-message.sent {
    justify-content: flex-end;
}

.olvos-chat-message.received {
    justify-content: flex-start;
}

.olvos-chat-message-bubble {
    max-width: 60%;
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
}

.olvos-chat-message.sent .olvos-chat-message-bubble {
    background: var(--bs-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.olvos-chat-message.received .olvos-chat-message-bubble {
    background: #ffffff;
    color: #212121;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.olvos-chat-message-text {
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.olvos-chat-message-deleted {
    font-style: italic;
    opacity: 0.7;
}

.olvos-chat-message-status {
    margin-left: 4px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.35);
    vertical-align: middle;
}

.olvos-chat-message-status.read i {
    color: #ffffff;
}


.olvos-chat-message-delete-btn {
    position: absolute;
    top: -10px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    background: #ffffff;
    color: #d32f2f;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    z-index: 1;
}

.olvos-chat-message.sent:hover .olvos-chat-message-delete-btn {
    display: flex;
}

.olvos-chat-message-delete-btn:hover {
    background: #d32f2f;
    color: #ffffff;
}

/* ── Attachment rendering ── */
.olvos-chat-attachment-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: block;
    text-align: left;
}

.olvos-chat-attachment-image {
    max-width: 240px;
    max-height: 240px;
    border-radius: 8px;
    display: block;
    cursor: pointer;
    transition: opacity 0.15s;
}

.olvos-chat-attachment-btn:hover .olvos-chat-attachment-image {
    opacity: 0.88;
}

.olvos-chat-attachment-video-thumb {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    max-width: 260px;
}

.olvos-chat-attachment-video-thumb i {
    font-size: 28px;
    flex-shrink: 0;
}

/* ── Attachment viewer dialog ── */
.olvos-attach-viewer-title {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 420px;
}

.olvos-attach-viewer-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 8px 4px 4px;
}

.olvos-attach-viewer-image {
    max-width: min(80vw, 700px);
    max-height: 70vh;
    border-radius: 6px;
    display: block;
}

.olvos-attach-viewer-video {
    max-width: min(80vw, 700px);
    max-height: 70vh;
    border-radius: 6px;
    display: block;
    background: #000;
}

.olvos-attach-viewer-file {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 48px;
}

.olvos-attach-viewer-file-icon {
    font-size: 64px;
    color: var(--olvos-purple-600, #6c4fc7);
    opacity: 0.85;
}

.olvos-attach-viewer-file-name {
    font-size: 15px;
    font-weight: 600;
    word-break: break-all;
    text-align: center;
}

.olvos-attach-viewer-file-ext {
    font-size: 12px;
    color: #888;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.olvos-attach-viewer-actions {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 4px;
    border-top: 1px solid #f0f0f0;
}

.olvos-attach-viewer-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: var(--olvos-purple-600, #6c4fc7);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
}

.olvos-attach-viewer-download:hover {
    background: var(--olvos-purple-700, #5a3fb0);
    color: #fff;
    text-decoration: none;
}

.olvos-chat-attachment-file {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    max-width: 280px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    color: inherit;
    text-decoration: none;
    transition: background 0.15s;
}

.olvos-chat-attachment-file:hover {
    background: rgba(255,255,255,0.25);
    text-decoration: none;
    color: inherit;
}

.olvos-chat-message.received .olvos-chat-attachment-file {
    background: rgba(0,0,0,0.05);
    color: #212121;
}

.olvos-chat-message.received .olvos-chat-attachment-file:hover {
    background: rgba(0,0,0,0.09);
}

.olvos-chat-attachment-file-icon {
    font-size: 28px;
    flex-shrink: 0;
    opacity: 0.85;
}

.olvos-chat-attachment-file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.olvos-chat-attachment-file-name {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.olvos-chat-attachment-file-ext {
    font-size: 11px;
    opacity: 0.65;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.olvos-chat-attachment-file-dl {
    font-size: 16px;
    flex-shrink: 0;
    opacity: 0.6;
}

.olvos-chat-message-time {
    font-size: 11px;
    margin-top: 6px;
    opacity: 0.7;
}

.olvos-chat-message.sent .olvos-chat-message-time {
    text-align: right;
}

.olvos-chat-message.received .olvos-chat-message-time {
    text-align: left;
    color: #757575;
}

/* ── Typing Indicator ── */
.olvos-chat-typing-indicator {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: #757575;
    font-size: 13px;
    font-style: italic;
}

.olvos-chat-typing-dots {
    display: flex;
    margin-left: 8px;
}

.olvos-chat-typing-dot {
    width: 6px;
    height: 6px;
    margin: 0 2px;
    background: #757575;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.olvos-chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.olvos-chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-6px);
    }
}

/* ── Scroll-to-bottom FAB ── */
/* ─ Load More ─ */
.olvos-chat-load-more {
    display: flex;
    justify-content: center;
    padding: 10px 0 4px;
}

.olvos-chat-load-more-btn {
    background: none;
    border: 1px solid #c5cae9;
    border-radius: 20px;
    color: #5c6bc0;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 5px 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.15s, color 0.15s;
}

.olvos-chat-load-more-btn:hover:not(:disabled) {
    background: #e8eaf6;
    color: #3f51b5;
}

.olvos-chat-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.olvos-chat-spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #c5cae9;
    border-top-color: #5c6bc0;
    border-radius: 50%;
    animation: olvos-spin 0.7s linear infinite;
}

.olvos-chat-scroll-fab {
    position: absolute;
    bottom: 80px;
    right: 20px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #5c6bc0;
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.15s, transform 0.15s;
}

.olvos-chat-scroll-fab:hover {
    background: #3f51b5;
    transform: translateY(-2px);
}

/* ── Message Composer ── */
.olvos-chat-composer {
    padding: 10px 20px 2px 20px;
    border-top: 1px solid #e0e0e0;
    background: #ffffff;
}

.olvos-chat-composer-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.olvos-chat-composer-input-wrapper {
    flex: 1;
    position: relative;
}

.olvos-chat-composer-input {
    width: 100%;
    min-height: 44px;
    max-height: 120px; /* ~4 lines; JS enforces this dynamically */
    padding: 12px 48px 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    line-height: 20px;
    resize: none;
    overflow-y: hidden; /* JS switches to auto when content exceeds max-height */
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.olvos-chat-composer-input:focus {
    outline: none;
    border-color: var(--bs-primary);
}

.olvos-chat-composer-attach-btn,
.olvos-chat-composer-attach-btn .k-button,
.olvos-chat-composer-attach-btn button {
    position: absolute;
    right: 12px;
    bottom: 18px;
    width: 28px !important;
    height: 28px !important;
    min-width: unset !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #757575;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.olvos-chat-composer-attach-btn:hover,
.olvos-chat-composer-attach-btn .k-button:hover,
.olvos-chat-composer-attach-btn button:hover {
    color: var(--bs-primary);
    background: transparent !important;
}

.olvos-chat-composer-send-btn,
.olvos-chat-composer-send-btn .k-button,
.olvos-chat-composer-send-btn button {
    width: 44px !important;
    height: 44px !important;
    min-width: unset !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: var(--bs-primary) !important;
    box-shadow: none !important;
    color: white !important;
    cursor: pointer;
    bottom: 8px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.olvos-chat-composer-send-btn:hover,
.olvos-chat-composer-send-btn .k-button:hover,
.olvos-chat-composer-send-btn button:hover {
    background: #1565c0 !important;
}

.olvos-chat-composer-send-btn.k-disabled,
.olvos-chat-composer-send-btn .k-button:disabled,
.olvos-chat-composer-send-btn button:disabled {
    background: #e0e0e0 !important;
    color: #9e9e9e !important;
    cursor: not-allowed;
    opacity: 1 !important;
}

/* ── Attachments Preview ── */
.olvos-chat-attachments-preview {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.olvos-chat-attachment-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.olvos-chat-attachment-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.olvos-chat-attachment-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* ── Empty State ── */
.olvos-chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9e9e9e;
    text-align: center;
    padding: 40px;
}

.olvos-chat-empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.olvos-chat-empty-state h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #757575;
}

.olvos-chat-empty-state p {
    margin: 0;
    font-size: 14px;
    color: #9e9e9e;
}

/* ── Loading Spinner ── */
.olvos-chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.olvos-chat-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--bs-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Scrollbar Styling ── */
.olvos-chat-contacts-list::-webkit-scrollbar,
.olvos-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.olvos-chat-contacts-list::-webkit-scrollbar-track,
.olvos-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.olvos-chat-contacts-list::-webkit-scrollbar-thumb,
.olvos-chat-messages::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 3px;
}

.olvos-chat-contacts-list::-webkit-scrollbar-thumb:hover,
.olvos-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #bdbdbd;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .olvos-chat-sidebar {
        width: 100%;
        border-right: none;
    }

    .olvos-chat-conversation {
        display: none;
    }

    .olvos-chat-container.conversation-open .olvos-chat-sidebar {
        display: none;
    }

    .olvos-chat-container.conversation-open .olvos-chat-conversation {
        display: flex;
    }

    .olvos-chat-message-bubble {
        max-width: 80%;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Olvos Chat Widget  (compact topbar pop-over, Facebook-style)
   ──────────────────────────────────────────────────────────────────────────── */

/* ── Root / trigger ── */
.ocw-root {
    position: relative;
    display: flex;
    align-items: center;
}

.ocw-trigger {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.12);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition: background 0.18s;
}

.ocw-trigger:hover {
    background: rgba(255,255,255,0.22);
}

.ocw-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #e53935;
    color: #fff;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
}

/* ── Click-away overlay ── */
.ocw-overlay {
    position: fixed;
    inset: 0;
    z-index: 1048;
}

/* ── Floating panel ── */
.ocw-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    max-height: 520px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1049;
    animation: ocw-fadeIn 0.15s ease;
}

@keyframes ocw-fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Panel header ── */
.ocw-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    background: #1565c0;
    color: #fff;
    flex-shrink: 0;
}

.ocw-panel-title {
    font-size: 15px;
    font-weight: 600;
}

.ocw-panel-header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ocw-new-chat-btn,
.ocw-expand-btn,
.ocw-close-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.15s;
}

.ocw-new-chat-btn:hover,
.ocw-expand-btn:hover,
.ocw-close-btn:hover {
    background: rgba(255,255,255,0.28);
    color: #fff;
}

/* ── Search ── */
.ocw-search-wrapper {
    position: relative;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.ocw-search-icon {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: #bbb;
    font-size: 13px;
    pointer-events: none;
}

.ocw-search {
    width: 100%;
    padding: 7px 10px 7px 32px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
    background: #f5f5f5;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.ocw-search:focus {
    border-color: #1565c0;
    background: #fff;
}

/* ── Discussion list ── */
.ocw-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.ocw-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    transition: background 0.12s;
}

.ocw-list-item:hover {
    background: #f0f4ff;
}

.ocw-list-item--unread {
    background: #e8f0fe;
}

.ocw-list-item--unread:hover {
    background: #d2e3fc;
}

/* Avatar in list */
.ocw-list-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #1565c0;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: visible;
}

.ocw-list-avatar img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.ocw-list-avatar span {
    font-size: 14px;
}

.ocw-presence-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #9e9e9e;
}

.ocw-presence-dot--online  { background: #43a047; }
.ocw-presence-dot--away    { background: #fdd835; }
.ocw-presence-dot--busy    { background: #e53935; }
.ocw-presence-dot--offline { background: #9e9e9e; }

.ocw-list-info {
    flex: 1;
    min-width: 0;
}

.ocw-list-name {
    font-size: 14px;
    font-weight: 600;
    color: #212121;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ocw-list-preview {
    font-size: 12px;
    color: #757575;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.ocw-list-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #1565c0;
    color: #fff;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    flex-shrink: 0;
}

/* ── Empty / spinner ── */
.ocw-empty {
    padding: 28px 16px;
    text-align: center;
    color: #9e9e9e;
    font-size: 13px;
}

.ocw-spinner-row {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.ocw-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e0e0e0;
    border-top-color: #1565c0;
    border-radius: 50%;
    animation: ocw-spin 0.8s linear infinite;
}

@keyframes ocw-spin {
    to { transform: rotate(360deg); }
}

/* ── Conversation header ── */
.ocw-conv-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    background: #1565c0;
    color: #fff;
    flex-shrink: 0;
}

.ocw-back-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    transition: background 0.15s;
}

.ocw-back-btn:hover {
    background: rgba(255,255,255,0.28);
}

.ocw-conv-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.ocw-conv-avatar img {
    width: 34px;
    height: 34px;
    object-fit: cover;
}

.ocw-conv-info {
    flex: 1;
    min-width: 0;
}

.ocw-conv-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ocw-conv-status {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
}

.ocw-conv-status.online  { color: #a5d6a7; }
.ocw-conv-status.typing  { color: #fff176; font-style: italic; }

/* ── Messages ── */
.ocw-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scroll-behavior: smooth;
}

/* ── Bubbles ── */
.ocw-bubble {
    max-width: 78%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ocw-bubble--out {
    align-self: flex-end;
    align-items: flex-end;
}

.ocw-bubble--in {
    align-self: flex-start;
    align-items: flex-start;
}

.ocw-bubble-text {
    padding: 7px 11px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
}

.ocw-bubble--out .ocw-bubble-text {
    background: #1565c0;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ocw-bubble--in .ocw-bubble-text {
    background: #f0f0f0;
    color: #212121;
    border-bottom-left-radius: 4px;
}

.ocw-bubble-time {
    font-size: 10px;
    color: #9e9e9e;
    padding: 0 4px;
}

/* Typing dots bubble */
.ocw-bubble--typing .ocw-bubble-text {
    padding: 10px 14px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.ocw-bubble--typing .ocw-bubble-text span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9e9e9e;
    animation: ocw-bounce 1.2s infinite;
}

.ocw-bubble--typing .ocw-bubble-text span:nth-child(2) { animation-delay: 0.2s; }
.ocw-bubble--typing .ocw-bubble-text span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ocw-bounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40%            { transform: scale(1.2); opacity: 1;   }
}

/* ── Composer ── */
.ocw-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.ocw-composer-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    resize: none;
    outline: none;
    max-height: 80px;
    overflow-y: auto;
    background: #f5f5f5;
    transition: border-color 0.15s;
    line-height: 1.4;
    font-family: inherit;
}

.ocw-composer-input:focus {
    border-color: #1565c0;
    background: #fff;
}

.ocw-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #1565c0;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.15s;
}

.ocw-send-btn:hover:not(:disabled) {
    background: var(--bs-primary);
}

.ocw-send-btn:disabled {
    background: #e0e0e0;
    color: #bdbdbd;
    cursor: default;
}

/* ── Scrollbars ── */
.ocw-list::-webkit-scrollbar,
.ocw-messages::-webkit-scrollbar {
    width: 5px;
}

.ocw-list::-webkit-scrollbar-thumb,
.ocw-messages::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 3px;
}

/* ── Responsive: on small screens use most of the width ── */
@media (max-width: 480px) {
    .ocw-panel {
        width: calc(100vw - 24px);
        right: -60px;
    }
}

/* ── Retail after-sale generation badge ── */
.olvos-generation-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
}

.olvos-generation-badge.generating {
    background: #e8f4fd;
    color: #0078d4;
}

.olvos-generation-badge.done {
    background: #e6f4ea;
    color: #1a7f3c;
}

.olvos-generation-badge.error {
    background: #fce8e6;
    color: #c5221f;
}

.olvos-spinner-sm {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: olvos-spin 0.8s linear infinite;
}
