/* ============================================
   WLM Chat Interface - Custom Styles
   ============================================ */

/* Chat Container */
.chat-wrapper {
    background-color: #f8f9fa;
    height: calc(100vh - 70px);
}

/* Left Sidebar */
.chat-sidebar {
    background-color: white;
    border-right: 1px solid #e9ecef;
}

.chat-sidebar-header {
    padding: 1.5rem;
    border-bottom: 2px solid #f1f3f5;
}

.chat-sidebar-header .btn-primary {
    background: #0d6efd;
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: 6px;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.chat-sidebar-header .btn-primary:hover {
    background: #0d6efd;
    -webkit-transform: translateY(-1px);
            transform: translateY(-1px);
    -webkit-box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
            box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

/* Chat Sessions List */
#chatSessionsList {
    padding: 0.5rem;
}

#chatSessionsList .list-group-item {
    border: none;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
    background-color: transparent;
}

#chatSessionsList .list-group-item:hover {
    background-color: #f8f9ff;
}

#chatSessionsList .list-group-item.active-chat {
    background-color: #f8f9ff;
    border-left: 3px solid #0d6efd;
}

#chatSessionsList .list-group-item .fw-semibold {
    color: #212529;
    font-weight: 500;
}

#chatSessionsList .list-group-item .text-muted {
    font-size: 0.875rem;
    color: #6c757d;
}

#chatSessionsList .list-group-item i {
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

#chatSessionsList .list-group-item i:hover {
    -webkit-transform: scale(1.2);
            transform: scale(1.2);
}

/* Chat Header */
.chat-header {
    background: white;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #f1f3f5;
}

.chat-header h5 {
    margin: 0;
    font-weight: 600;
    color: #212529;
}

.chat-header small {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Messages Area */
#messagesArea {
    background-color: #f8f9fa;
    padding: 2rem;
    scroll-behavior: smooth;
}

/* Welcome Message */
#welcomeMessage {
    padding: 3rem 2rem;
}

#welcomeMessage i {
    color: #0d6efd;
    opacity: 0.6;
}

#welcomeMessage h4 {
    color: #212529;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

#welcomeMessage p {
    color: #6c757d;
}

#welcomeMessage .badge {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border: 1px solid #dee2e6;
}

/* Message Bubbles */
.message-bubble {
    -webkit-animation: fadeIn 0.3s ease;
            animation: fadeIn 0.3s ease;
    margin-bottom: 1.5rem;
}

@-webkit-keyframes fadeIn {
    from {
        opacity: 0;
        -webkit-transform: translateY(10px);
                transform: translateY(10px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
                transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        -webkit-transform: translateY(10px);
                transform: translateY(10px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
                transform: translateY(0);
    }
}

/* User Message */
.user-message .message-content {
    background: #0d6efd;
    color: white;
    border-radius: 12px 12px 4px 12px;
    padding: 1rem 1.25rem;
    -webkit-box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
            box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
}

.user-message .message-text {
    line-height: 1.6;
}

.user-message small {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Assistant Message */
.assistant-message .message-content {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px 12px 12px 4px;
    padding: 1rem 1.25rem;
    -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.assistant-message .message-text {
    color: #212529;
    line-height: 1.6;
}

.assistant-message small {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Loading Indicator */
#loadingIndicator {
    padding: 1.5rem;
    -webkit-animation: fadeIn 0.3s ease;
            animation: fadeIn 0.3s ease;
}

#loadingIndicator .spinner-border {
    width: 2rem;
    height: 2rem;
    color: #0d6efd;
}

#loadingIndicator .text-muted {
    margin-top: 0.75rem;
    color: #6c757d;
    font-weight: 500;
}

/* Input Area */
.chat-input-area {
    background: white;
    padding: 1.5rem 2rem;
    border-top: 2px solid #f1f3f5;
}

#messageInput {
    min-height: 48px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    resize: none;
}

#messageInput:focus {
    border-color: #0d6efd;
    -webkit-box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
            box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: none;
}

#messageInput::-webkit-input-placeholder {
    color: #adb5bd;
}

#messageInput::-moz-placeholder {
    color: #adb5bd;
}

#messageInput:-ms-input-placeholder {
    color: #adb5bd;
}

#messageInput::-ms-input-placeholder {
    color: #adb5bd;
}

#messageInput::placeholder {
    color: #adb5bd;
}

#btnSend {
    background: #0d6efd;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    height: 48px;
}

#btnSend:hover:not(:disabled) {
    background: #0d6efd;
    -webkit-transform: translateY(-1px);
            transform: translateY(-1px);
    -webkit-box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
            box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

#btnSend:disabled {
    background: #6c757d;
    opacity: 0.5;
}

/* Modal Styling */
.modal-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #f1f3f5;
    padding: 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: #212529;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 2px solid #f1f3f5;
    padding: 1rem 1.5rem;
}

#editTitleInput {
    height: 48px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

#editTitleInput:focus {
    border-color: #0d6efd;
    -webkit-box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
            box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Scrollbar Styling */
#messagesArea::-webkit-scrollbar,
#chatSessionsList::-webkit-scrollbar {
    width: 8px;
}

#messagesArea::-webkit-scrollbar-track,
#chatSessionsList::-webkit-scrollbar-track {
    background: #f1f3f5;
}

#messagesArea::-webkit-scrollbar-thumb,
#chatSessionsList::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
}

#messagesArea::-webkit-scrollbar-thumb:hover,
#chatSessionsList::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-header,
    .chat-input-area {
        padding: 1rem;
    }
    
    #messagesArea {
        padding: 1rem;
    }
    
    .message-bubble {
        margin-bottom: 1rem;
    }
}

/* Loading indicator */
.typing-indicator {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 6px;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #6c757d;
    border-radius: 50%;
    -webkit-animation: typing 1.4s infinite;
            animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    -webkit-animation-delay: 0.2s;
            animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    -webkit-animation-delay: 0.4s;
            animation-delay: 0.4s;
}

@-webkit-keyframes typing {
    0%, 60%, 100% { -webkit-transform: translateY(0); transform: translateY(0); opacity: 0.5; }
    30% { -webkit-transform: translateY(-10px); transform: translateY(-10px); opacity: 1; }
}

@keyframes typing {
    0%, 60%, 100% { -webkit-transform: translateY(0); transform: translateY(0); opacity: 0.5; }
    30% { -webkit-transform: translateY(-10px); transform: translateY(-10px); opacity: 1; }
}
/* Loading indicator */