/* ========================================
   CHAT WIDGET STYLES
   Đồng bộ với theme Bootstrap 5 hiện tại
   ======================================== */

/* Chat Widget Container */
.ta-chat-widget {
    max-width: 100%;
    margin: 0 auto;
    position: relative;
}

/* Chat Header */
.ta-chat-header {
    border-radius: 0.375rem 0.375rem 0 0;
    background: linear-gradient(135deg, var(--bs-teal, #20c997) 0%, var(--bs-success, #198754) 100%);
}

.ta-chat-header h5 {
    font-size: 1rem;
}

/* Chat Body */
.ta-chat-body {
    height: 450px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    background: #f8f9fa;
    position: relative;
}

/* Chat Message */
.ta-chat-message {
    margin-bottom: 1rem;
    animation: chatSlideIn 0.3s ease;
    display: flex;
    gap: 0.5rem;
}

.ta-chat-message-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ta-chat-message-content {
    flex: 1;
    min-width: 0;
}

.ta-chat-message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.ta-chat-message-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.ta-chat-message-time {
    font-size: 0.6875rem;
    color: #6c757d;
    margin-left: auto;
}

.ta-chat-message-bubble {
    background: white;
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    word-wrap: break-word;
    word-break: break-word;
}

.ta-chat-message-text {
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
    color: #212529;
}

/* Admin Message Styling */
.ta-chat-message.admin .ta-chat-message-name {
    color: #dc3545;
}

.ta-chat-message.admin .ta-chat-message-bubble {
    background: #fff3cd;
    border-color: #ffc107;
}

.ta-chat-message.admin .badge {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
}

/* Chat Footer */
.ta-chat-footer {
    border-radius: 0 0 0.375rem 0.375rem;
}

#chat-input {
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#chat-input:focus {
    border-color: #20c997;
    box-shadow: 0 0 0 0.2rem rgba(32, 201, 151, 0.25);
}

#chat-send-btn {
    min-width: 45px;
}

/* Scroll to Bottom Button */
.ta-chat-scroll-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ta-chat-scroll-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Empty State */
.ta-chat-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.ta-chat-empty i {
    font-size: 3rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* Loading State */
#chat-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

/* Animations */
@keyframes chatSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes chatPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Custom Scrollbar */
.ta-chat-body::-webkit-scrollbar {
    width: 6px;
}

.ta-chat-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ta-chat-body::-webkit-scrollbar-thumb {
    background: #20c997;
    border-radius: 3px;
}

.ta-chat-body::-webkit-scrollbar-thumb:hover {
    background: #198754;
}

/* Responsive */
@media (max-width: 576px) {
    .ta-chat-body {
        height: 350px;
    }
    
    .ta-chat-message-avatar {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }
    
    .ta-chat-message-name {
        font-size: 0.75rem;
    }
    
    .ta-chat-message-text {
        font-size: 0.8125rem;
    }
    
    .ta-chat-scroll-btn {
        bottom: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
    }
}

/* Online Badge Animation */
#chat-online-count .fa-circle {
    animation: chatPulse 2s ease-in-out infinite;
}

/* Utility Classes */
.fs-11 {
    font-size: 0.6875rem;
}

.fs-13 {
    font-size: 0.8125rem;
}
