/* Admin Chat Styles */
.admin-chat-container {
    display: flex;
    height: calc(100vh - 160px);
    max-height: 600px;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e6e9ef;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Conversation List */
.conversation-list {
    width: 350px;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}

.conversation-list-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e6e9ef;
    background: white;
}

.conversation-list-header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #323338;
}

.conversation-list-content {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(230, 233, 239, 0.3);
}

.conversation-item:hover {
    background: #f7f8fa;
}

.conversation-item.active {
    background: #f7f8fa;
    border-right: 3px solid #000000;
}

.conversation-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #191c20;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.conversation-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 18px;
    font-weight: 600;
    color: #6b7280;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.conversation-name {
    font-size: 14px;
    font-weight: 600;
    color: #323338;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 13px;
    color: #676879;
    white-space: nowrap;
}

.conversation-preview {
    font-size: 14px;
    color: #676879;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.no-conversations {
    text-align: center;
    padding: 40px 20px;
    color: #676879;
}

.no-conversations-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.no-conversations h3 {
    margin: 0 0 6px 0;
    font-size: 14px;
    color: #323338;
}

.no-conversations p {
    margin: 0;
    font-size: 14px;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-area-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    text-align: center;
}

.chat-area-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.chat-area-empty h3 {
    margin: 0 0 8px 0;
    font-size: 15px;
    color: #374151;
}

.chat-area-empty p {
    margin: 0;
    font-size: 14px;
}

/* Chat Header */
.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e6e9ef;
    background: white;
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: #e6e9ef;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-user-info h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #323338;
}

.chat-status {
    margin: 0;
    font-size: 13px;
    color: #676879;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Messages - matching live chat style */
.chat-message {
    display: flex !important;
    gap: 12px;
    margin-bottom: 0;
    opacity: 0;
    animation: fadeInUp 0.3s ease forwards;
    align-items: flex-start;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.own {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #e5e7eb;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    margin-top: 2px;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    max-width: 70%;
    position: relative;
    min-width: 0;
}

.chat-message.own .message-content {
    align-self: flex-start;
}

.message-text {
    background: white;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    word-wrap: break-word;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.chat-message.own .message-text {
    background: #000000;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.message-image {
    margin-bottom: 8px;
}

.message-image img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 7px;
    font-size: 14px;
    color: #9ca3af;
}

.chat-message.own .message-meta {
    justify-content: flex-end;
}

.message-status {
    color: #10b981;
    font-weight: 500;
}

.message-read-indicator {
    font-size: 13px;
    color: #10b981;
    margin-left: 4px;
}

.message-unread-indicator {
    font-size: 14px;
    color: #ef4444;
    margin-left: 4px;
}

.message-time {
    font-size: 13px;
    color: #6b7280;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 7px;
}

/* Typing Indicator */
.chat-typing-indicator {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 0 20px 8px;
    background: #fafafa;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 14px;
    background: none !important;
    margin-bottom: 5px;
}

.typing-dots span {
    display: inline-block;
    width: 4px;
    height: 4px;
    margin: 0 1px;
    border-radius: 50%;
    background: #bbb;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

.typing-text {
    font-size: 14px !important;
    color: #888;
    background: none !important;
    margin-bottom: 5px;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat Input - Notion-style matching live chat */
.chat-input-container {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.chat-input-wrapper {
    flex: 1;
    position: relative;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    transition: all 0.15s ease;
}

.chat-attachment-btn {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    color: #6b7280;
    flex-shrink: 0;
}

#admin-chat-input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    padding: 6px 0;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    font-family: inherit;
    min-height: 20px;
    max-height: 100px;
    color: #111827;
}

#admin-chat-input::placeholder {
    color: #9ca3af;
}

.chat-send-btn {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    color: #d1d5db;
    flex-shrink: 0;
    opacity: 0.5;
}

.chat-send-btn.active {
    color: #6b7280;
    opacity: 1;
}

.chat-send-btn:disabled {
    color: #d1d5db;
    cursor: not-allowed;
    background: none;
}

/* Scrollbar Styles */
.conversation-list-content::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.conversation-list-content::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.conversation-list-content::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-chat-container {
        flex-direction: column;
        height: calc(100vh - 60px);
    }
    
    .conversation-list {
        width: 100%;
        max-height: 40%;
    }
    
    .chat-area {
        flex: 1;
    }
}

/* Dark Mode Styles */
html[data-theme="dark"] .conversation-item:hover,
body.dark-mode .conversation-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

html[data-theme="dark"] #admin-chat-input,
body.dark-mode #admin-chat-input {
    color: #ffffff !important;
}

html[data-theme="dark"] .chat-message.own .message-text,
body.dark-mode .chat-message.own .message-text {
    background: #090E1A !important;
    border: 1px solid var(--sidebar-border) !important;
} 