/* =========================================================
   Stamps Live Chat — Widget + Dashboard Styles
   ========================================================= */

/* --- Hide old Directorist chat button --- */
.directorist-chat-btn,
.directorist-single-listing-action.directorist-chat-btn {
    display: none !important;
}

/* --- Chat Trigger Button (on listing pages) --- */
.slc-chat-trigger-wrap {
    margin: 0;
    padding: 14px 20px;
    background: #ff385c;
    border-radius: 0 0 8px 8px;
    text-align: left;
}
.slc-chat-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #ff385c;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.slc-chat-trigger-btn:hover {
    background: #333;
    color: #fff;
}

/* --- Floating Chat Widget (bottom-right) --- */
.slc-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 450px;
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    z-index: 99999;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.slc-chat-widget.slc-hidden {
    display: none;
    transform: translateY(20px);
    opacity: 0;
}
.slc-chat-widget.slc-visible {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}


/* --- Chat Header --- */
.slc-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #ff385c;
    color: #fff;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}
.slc-chat-header-title {
    font-weight: 600;
    font-size: 14px;
}
.slc-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

/* --- Messages Area --- */
.slc-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.slc-msg {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}
.slc-msg-mine {
    align-self: flex-end;
}
.slc-msg-theirs {
    align-self: flex-start;
}
.slc-msg-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}
.slc-msg-mine .slc-msg-bubble {
    background: #ff385c;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.slc-msg-theirs .slc-msg-bubble {
    background: #f1f1f1;
    color: #333;
    border-bottom-left-radius: 4px;
}
.slc-msg-time {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
    padding: 0 4px;
}
.slc-msg-mine .slc-msg-time {
    text-align: right;
}


/* --- Chat Input Area --- */
.slc-chat-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}
.slc-chat-input-wrap textarea {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 80px;
    font-family: inherit;
}
.slc-chat-input-wrap textarea:focus {
    border-color: #ff385c;
}
.slc-send-btn {
    background: #ff385c;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.slc-send-btn:hover {
    background: #e0314f;
}

/* --- Loading / Empty States --- */
.slc-loading, .slc-empty, .slc-error {
    text-align: center;
    color: #999;
    padding: 20px;
    font-size: 14px;
}

/* =========================================================
   DASHBOARD — Chat Messages Tab
   ========================================================= */
.slc-dashboard-wrap {
    display: flex;
    min-height: 500px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}


/* --- Dashboard Sidebar --- */
.slc-dash-sidebar {
    width: 300px;
    border-right: 1px solid #e9ecef;
    overflow-y: auto;
    flex-shrink: 0;
}
.slc-dash-title {
    padding: 16px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
}
.slc-conv-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.15s;
}
.slc-conv-item:hover {
    background: #f8f9fa;
}
.slc-conv-item.slc-active {
    background: #fff0f2;
    border-left: 3px solid #ff385c;
}
.slc-conv-info {
    flex: 1;
    min-width: 0;
}
.slc-conv-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}
.slc-conv-listing {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.slc-conv-preview {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.slc-conv-time {
    font-size: 11px;
    color: #aaa;
    white-space: nowrap;
    margin-left: 8px;
}
.slc-unread-badge {
    background: #ff385c;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    padding: 1px 7px;
    min-width: 18px;
    text-align: center;
}


/* --- Dashboard Main Chat Area --- */
.slc-dash-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.slc-dash-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #ccc;
}
.slc-dash-placeholder p {
    margin-top: 12px;
    font-size: 14px;
}
.slc-dash-chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    font-size: 15px;
}
#slc-dash-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 380px;
}
.slc-dash-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e9ecef;
}
.slc-dash-input-wrap textarea {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 80px;
    font-family: inherit;
}
.slc-dash-input-wrap textarea:focus {
    border-color: #ff385c;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .slc-chat-widget {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 10px;
        height: 400px;
    }
    .slc-dashboard-wrap {
        flex-direction: column;
    }
    .slc-dash-sidebar {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    #slc-dash-messages {
        max-height: 250px;
    }
}


/* --- Floating Action Button (visible on listing pages) --- */
.slc-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    background: #f51957;
    color: #fff;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(245, 25, 87, 0.4);
    z-index: 99998;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 15px;
    font-weight: 600;
}
.slc-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(245, 25, 87, 0.5);
}
.slc-fab.slc-hidden {
    display: none;
}
.slc-fab-label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
