/* Updated chat styles with status indicator */
#chat-button {
    position: fixed;
    bottom: 70px;
    right: 20px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    z-index: 20;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: auto;
    min-width: 120px;
}

#chat-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#chat-panel {
    position: fixed;
    bottom: 120px;
    right: 20px;
    width: 300px;
    height: 400px;
    background: var(--menu-bg);
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 19;
}

#chat-header {
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chat-header h3 {
    margin: 0;
    color: white;
    font-size: 1.2rem;
}

#chat-status {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

#chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    max-width: 80%;
    word-break: break-word;
    animation: messageAppear 0.3s ease-out;
}

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

.chat-message.mine {
    background: #3498db;
    color: white;
    align-self: flex-end;
}

.chat-message.others {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    align-self: flex-start;
}

.message-username {
    font-size: 0.8em;
    margin-bottom: 4px;
    opacity: 0.8;
}

.message-time {
    font-size: 0.7em;
    opacity: 0.6;
    margin-top: 4px;
    text-align: right;
}

#chat-input {
    display: flex;
    padding: 15px;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#message-input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    color: white;
    font-size: 0.9rem;
}

#message-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
}

#send-button {
    background: #3498db;
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#send-button:hover {
    background: #2980b9;
}

#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

#chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}