/* ===============================================
   LIVE CHAT STYLES
   =============================================== */

.chat-card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 220px);
    min-height: 400px;
    padding: 0 !important;
    overflow: hidden;
}

@media (max-width: 768px) {
    .chat-card {
        height: calc(100vh - 140px); /* Adjust for mobile nav */
    }
}

/* Chat Tabs */
.chat-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-body);
}

.chat-tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.chat-tab.active {
    color: var(--color-gold);
    border-bottom: 2px solid var(--color-gold);
    background: var(--bg-card);
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: var(--bg-body);
}

.chat-loader, .chat-empty {
    text-align: center;
    color: var(--text-muted);
    margin: auto;
    font-size: 14px;
}

/* Message Bubbles */
.message-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.message-wrapper.own {
    align-self: flex-end;
    align-items: flex-end;
}

.message-info {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.message-bubble {
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: 12px;
    border-top-left-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: relative;
}

.message-wrapper.own .message-bubble {
    background: var(--color-gold);
    color: #08164A;
    border-top-left-radius: 12px;
    border-top-right-radius: 2px;
}

.message-text {
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.message-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.message-action-btn:hover {
    color: var(--color-gold);
}

/* Reply Preview inside message */
.message-reply-preview {
    border-left: 3px solid var(--color-gold);
    padding: 5px 10px;
    margin-bottom: 8px;
    background: rgba(0,0,0,0.03);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.message-reply-preview strong {
    color: var(--color-gold);
    display: block;
    margin-bottom: 2px;
}

/* Media inside message */
.message-media {
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}

.message-media img, .message-media video {
    width: 100%;
    max-width: 250px;
    height: auto;
    display: block;
}

.media-error {
    color: var(--color-danger, #ef4444);
    font-size: 12px;
    font-style: italic;
}

/* Edit Mode */
.edit-mode {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}

/* Composer Area */
.reply-preview {
    padding: 10px 15px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reply-preview__content {
    flex: 1;
    overflow: hidden;
}

.reply-preview__text {
    font-size: 12px;
    color: var(--color-gold);
}

.reply-preview__message {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-preview__cancel {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 5px;
}

.chat-composer {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.chat-composer .form-input {
    flex: 1;
}