/* Modern Chat Styles */
.chat-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    overflow: hidden;
    height: 600px;
    display: flex;
    flex-direction: column;
}

/* Chat Header */
.chat-header {
    background: rgba(102, 126, 234, 0.1);
    padding: 1.5rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    position: relative;
    backdrop-filter: blur(10px);
}

.chat-title {
    color: #495057;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    letter-spacing: 1px;
}

.chat-subtitle {
    color: #6c757d;
    font-size: 0.9rem;
    text-align: center;
    margin: 0.5rem 0 0 0;
    font-weight: 500;
}

.chat-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.chat-action-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #667eea;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.chat-action-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    color: #5a6fd8;
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: rgba(248, 249, 250, 0.8);
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* Message Bubbles */
.message-item {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.message-item.sent {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

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

.message-bubble {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 18px;
    padding: 0.75rem 1rem;
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.4;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
}

.message-item.sent .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.message-time {
    font-size: 0.75rem;
    color: #495057;
    margin-top: 0.25rem;
    text-align: right;
    font-weight: 500;
    opacity: 0.8;
}

.message-item.sent .message-time {
    text-align: left;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Chat Input Area */
.chat-input-area {
    background: rgba(102, 126, 234, 0.05);
    padding: 1rem;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(10px);
}

.chat-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.chat-textarea {
    flex: 1;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    padding: 0.75rem 1rem;
    color: #495057;
    font-size: 0.9rem;
    resize: none;
    min-height: 45px;
    max-height: 120px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.chat-textarea::placeholder {
    color: #6c757d;
}

.chat-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 1);
}

.chat-send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.chat-send-btn:active {
    transform: translateY(0);
}

.chat-send-btn i {
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        height: 500px;
        border-radius: 15px;
    }

    .chat-header {
        padding: 1rem;
    }

    .chat-title {
        font-size: 1.3rem;
    }

    .message-content {
        max-width: 85%;
    }

    .chat-input-area {
        padding: 0.75rem;
    }
}

/* Animation for new messages */
.message-item {
    animation: slideInUp 0.3s ease-out;
}

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

/* Online indicator */
.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #28a745;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: #6c757d;
    font-size: 0.8rem;
    font-style: italic;
}

.typing-dots {
    display: flex;
    gap: 0.2rem;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}