
/* Chat Animations and Enhancements */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Message Animations */
.chat-message {
    animation: fadeIn 0.3s ease;
}

.chat-message.sent .chat-message-content {
    animation: slideIn 0.3s ease;
}

.chat-message.received .chat-message-content {
    animation: fadeIn 0.3s ease;
}

/* User Item Animation */
.chat-user-item {
    animation: fadeIn 0.3s ease;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    margin-bottom: 10px;
    animation: fadeIn 0.3s ease;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Online Status Indicator */
.online-dot {
    width: 12px;
    height: 12px;
    background: #4cd137;
    border-radius: 50%;
    display: inline-block;
    margin-left: 5px;
    animation: pulse 2s infinite;
}

.offline-dot {
    width: 12px;
    height: 12px;
    background: #95a5a6;
    border-radius: 50%;
    display: inline-block;
    margin-left: 5px;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(76, 209, 55, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(76, 209, 55, 0);
    }
}

/* Hover Effects */
.chat-message.sent .chat-message-content:hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

.chat-message.received .chat-message-content:hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Input Focus Effect */
#chat-message-input:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Send Button Animation */
.chat-send-btn:active {
    transform: scale(0.95);
}

/* Badge Animation */
.chat-badge {
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Sidebar Transition */
.chat-sidebar {
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Message Read Receipt */
.message-read {
    display: inline-block;
    margin-left: 5px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
}

/* Smooth Scroll */
.chat-messages {
    scroll-behavior: smooth;
}

/* Glassmorphism Effect */
.chat-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(102, 126, 234, 0.5), 
        transparent
    );
}

/* Custom Scrollbar */
.chat-users-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-users-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.chat-users-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.chat-users-list::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .chat-message-content {
        max-width: 85%;
    }
    
    .chat-user-avatar,
    .chat-room-avatar {
        width: 40px;
        height: 40px;
    }
    
    .chat-message-avatar {
        width: 35px;
        height: 35px;
    }
}

/* Dark Mode Enhancements */
.dark .chat-sidebar {
    background: rgba(15, 15, 25, 0.98) !important;
}

.dark .chat-sidebar-header {
    background: rgba(102, 126, 234, 0.1) !important;
}

.dark .chat-room-header,
.dark .chat-input-area {
    background: rgba(15, 15, 25, 0.95) !important;
}

/* Transition Effects */
* {
    transition: background-color 0.3s ease, 
                border-color 0.3s ease,
                color 0.3s ease,
                box-shadow 0.3s ease;
}
