/* ==========================================
   CHAT UI STYLES & ICONS
   ========================================== */

/* Chat Bubble Animation */
@keyframes chatBubbleFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

.chat-icon-floating {
    animation: chatBubbleFloat 2s ease-in-out infinite;
}

/* Chat Badge */
.chat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #FF6B6B, #FF8E72);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* Chat Message Bubble */
.chat-message {
    display: flex;
    margin-bottom: 16px;
}

.chat-message.sent {
    justify-content: flex-end;
}

.chat-message.received {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
}

.chat-message.sent .message-content {
    background: linear-gradient(135deg, #007BFF, #0056B3);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.received .message-content {
    background: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 4px;
}

.message-sender {
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 4px;
    opacity: 0.8;
}

.message-sender small {
    display: block;
    font-weight: normal;
    font-size: 10px;
    opacity: 0.6;
    margin-top: 2px;
}

.message-images {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.message-image {
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}

.message-image img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Chat Input Styles */
.chat-input {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Chat Button */
.chat-btn {
    background: linear-gradient(135deg, #007BFF, #0056B3);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.chat-btn:hover {
    background: linear-gradient(135deg, #0056B3, #003d7a);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.chat-btn:active {
    transform: translateY(0);
}

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.chat-messages-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
}

.chat-input-wrapper {
    padding: 16px;
    background: white;
    border-top: 1px solid #eee;
}

/* Chat Tab Badge */
.chat-tab-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FF6B6B, #FF8E72);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 8px;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
}

/* Notification States */
.chat-unread {
    background: #fff5f5;
    border-left: 3px solid #FF6B6B;
}

.chat-order-item.active {
    background: #e3f2fd !important;
    border-left: 3px solid #007BFF;
}

/* Chat Modal Styles */
.modal-content {
    background: white;
}

.modal-header {
    background: linear-gradient(135deg, #007BFF20, #007BFF10);
    border-bottom: 1px solid #eee;
}

.modal-body {
    padding: 0;
    background: #f8f9fa;
}

/* Chat Typing Indicator */
@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
    }
    30% {
        opacity: 1;
    }
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Chat Empty State */
.chat-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    text-align: center;
}

.chat-empty-state i {
    font-size: 48px;
    opacity: 0.3;
    display: block;
    margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .message-content {
        max-width: 85%;
    }

    .chat-container {
        height: auto;
        min-height: 400px;
    }

    .chat-messages-wrapper {
        height: 400px;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    .chat-message.received .message-content {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .chat-input {
        background: #2d2d2d;
        color: #e0e0e0;
        border-color: #444;
    }

    .chat-container {
        background: #1e1e1e;
    }

    .chat-tab-badge {
        background: linear-gradient(135deg, #FF5252, #FF7043);
    }
}

/* Status Indicators */
.status-online {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #28a745;
    border-radius: 50%;
    box-shadow: 0 0 0 2px white;
}

.status-offline {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #999;
    border-radius: 50%;
    box-shadow: 0 0 0 2px white;
}

.status-typing {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #ffc107;
    border-radius: 50%;
    box-shadow: 0 0 0 2px white;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}
