/**
 * Chat Application Styles
 */

/* Chat Container */
.chat-container {
    min-height: 500px;
}

/* Chat Room List */
.chat-room-item {
    transition: background-color 0.2s ease;
}

.chat-room-item:hover {
    background-color: var(--oh-gray-50, #f9fafb);
}

.chat-room-item.active {
    background-color: var(--oh-primary-50, #eff6ff);
    border-left: 3px solid var(--oh-primary-600, #2563eb);
}

/* Message Bubbles */
.message-bubble {
    max-width: 100%;
    word-wrap: break-word;
}

.message-bubble img {
    max-width: 100%;
    border-radius: 0.375rem;
}

/* Message Input */
#messageInput {
    min-height: 40px;
    max-height: 120px;
    overflow-y: auto;
}

/* File Preview */
#filePreview {
    max-height: 100px;
    overflow-y: auto;
}

/* Emoji Picker */
#emojiPicker {
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar Styling */
.chat-container ::-webkit-scrollbar {
    width: 6px;
}

.chat-container ::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container ::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.chat-container ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

/* Message Reactions */
.message-item .reaction-trigger {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.message-item:hover .reaction-trigger {
    opacity: 1;
}

/* Unread Badge */
.unread-badge {
    min-width: 20px;
    height: 20px;
    font-size: 11px;
}

/* System Messages */
.message-item .system-message {
    font-style: italic;
    color: var(--oh-gray-500, #6b7280);
}

/* Attachment Preview */
.attachment-preview {
    max-width: 200px;
}

.attachment-preview img {
    max-height: 150px;
    object-fit: cover;
}

/* Loading State */
.chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.chat-loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid var(--oh-primary-200, #bfdbfe);
    border-top-color: var(--oh-primary-600, #2563eb);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 100px);
    }
    
    .chat-container > .flex > div:first-child {
        width: 100%;
    }
    
    .chat-container > .flex > div:last-child {
        display: none;
    }
    
    .chat-container.chat-open > .flex > div:first-child {
        display: none;
    }
    
    .chat-container.chat-open > .flex > div:last-child {
        display: flex;
        width: 100%;
    }
}

