/* Facebook-style Chatbox Styles */
.chatbox-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.chatbox-bubble {
    width: 60px;
    height: 60px;
    background: #1877f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

.chatbox-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.chatbox-bubble i {
    color: white;
    font-size: 24px;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4458;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.chatbox-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 450px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chatbox-window.minimized {
    height: 50px;
}

.chatbox-header {
    background: #1877f2;
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.chatbox-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbox-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.chatbox-name {
    font-weight: 600;
    font-size: 14px;
}

.chatbox-status {
    font-size: 12px;
    opacity: 0.8;
}

.chatbox-controls {
    display: flex;
    gap: 10px;
}

.chatbox-control-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
}

.chatbox-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: #f0f2f5;
}

.message {
    margin-bottom: 8px;
    display: flex;
    align-items: flex-end;
    gap: 5px;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.sent .message-bubble {
    background: #1877f2;
    color: white;
}

.message.received .message-bubble {
    background: #e4e6eb;
    color: #050505;
}

.message-time {
    font-size: 11px;
    color: #65676b;
    margin-top: 2px;
}

.message.read-status {
    font-size: 11px;
    color: #65676b;
    margin-left: 5px;
}

.chatbox-input {
    padding: 10px;
    background: white;
    border-top: 1px solid #e4e6eb;
}

.chatbox-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbox-input-field {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 12px;
    border-radius: 20px;
    background: #f0f2f5;
    font-size: 14px;
}

.chatbox-send-btn {
    background: #1877f2;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.chatbox-send-btn:hover {
    background: #166fe5;
}

.chatbox-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.typing-indicator {
    display: none;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    font-size: 12px;
    color: #65676b;
}

.typing-dots {
    display: flex;
    gap: 2px;
}

.typing-dot {
    width: 4px;
    height: 4px;
    background: #65676b;
    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% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbox-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .chatbox-bubble {
        bottom: 20px;
        right: 20px;
    }
}
