/* Chat Styles */
.chat-container {
    display: flex;
    height: calc(100vh - 120px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chat-sidebar {
    width: 350px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.chat-search {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.chat-search input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

.chat-search input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.conversation-item:hover {
    background: #e2e8f0;
}

.conversation-item.unread {
    background: #dbeafe;
    border-left: 3px solid #3b82f6;
}

.conversation-item.unread .conversation-title {
    font-weight: 600;
}

.conversation-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.conversation-content {
    flex: 1;
    min-width: 0;
}

.conversation-title {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-preview {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.conversation-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conversation-time {
    font-size: 12px;
    color: #9ca3af;
}

.unread-badge {
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.no-conversations {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 14px;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
}

.conversation-info {
    display: flex;
    align-items: center;
}

.conversation-info .conversation-avatar {
    margin-right: 12px;
}

.conversation-details h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.conversation-details p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
}

.no-conversation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6b7280;
    text-align: center;
}

.no-conversation i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #d1d5db;
}

.no-conversation h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 500;
}

.no-conversation p {
    margin: 0;
    font-size: 14px;
}

.no-messages {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 14px;
}

.message {
    margin-bottom: 16px;
    display: flex;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.message-sender {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.8;
}

.message.sent .message-content {
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received .message-content {
    background: #e5e7eb;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.message-text {
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}

.chat-input-container {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.chat-input {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 8px 12px;
}

.chat-input textarea {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-size: 14px;
    line-height: 1.4;
    max-height: 120px;
    min-height: 20px;
    font-family: inherit;
}

.chat-input textarea::placeholder {
    color: #9ca3af;
}

.chat-input button {
    background: #3b82f6;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.chat-input button:hover {
    background: #2563eb;
}

.chat-input button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.modal-header button {
    background: none;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.modal-header button:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 80px);
        flex-direction: column;
    }
    
    .chat-sidebar {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .conversations-list {
        height: 140px;
    }
    
    .chat-main {
        height: calc(100% - 200px);
    }
    
    .message-content {
        max-width: 85%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .chat-container {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .chat-sidebar {
        background: #111827;
        border-color: #374151;
    }
    
    .chat-search input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .conversation-item {
        color: #f9fafb;
    }
    
    .conversation-item:hover {
        background: #9fa6b3;
    }
    
    .conversation-item.unread {
        background: #1e3a8a;
    }
    
    .conversation-title {
        color: #f9fafb;
    }
    
    .conversation-preview {
        color: #d1d5db;
    }
    
    .chat-header {
        background: #38445f;
        border-color: #374151;
    }
    
    .chat-messages {
        background: #5e6d8f;
    }
    
    .message.received .message-content {
        background: #374151;
        color: #f9fafb;
    }
    
    .chat-input-container {
        background: #bfc8d6;
        border-color: #374151;
    }
    
    .chat-input {
        background: #515c6e;
        border-color: #4b5563;
    }
    
    .chat-input textarea {
        color: #f9fafb;
    }
    
    .chat-input textarea::placeholder {
        color: #9ca3af;
    }
}
