/* Real-time Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-button {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 16px 24px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    animation: chatPulse 2s infinite;
}

.chat-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.4);
}

@keyframes chatPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.chat-icon {
    font-size: 1.2rem;
}

.chat-text {
    font-size: 0.9rem;
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    animation: chatSlideUp 0.3s ease-out;
    overflow: hidden;
}

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

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.chat-close:hover {
    background: rgba(255,255,255,0.2);
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: #f8fafc;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    max-width: 80%;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.bot-message {
    background: white;
    color: #333;
    align-self: flex-start;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
}

.bot-message::before {
    content: '🤖';
    position: absolute;
    left: -30px;
    top: 0.75rem;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.user-message {
    background: #10b981;
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.chat-input-container {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.5rem;
}

.chat-input-container input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
}

.chat-input-container input:focus {
    border-color: #10b981;
}

.chat-input-container button {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.chat-input-container button:hover {
    background: #059669;
}

/* Chat Status Indicators */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 12px;
    margin-bottom: 1rem;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

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

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.agent-status {
    font-size: 0.8rem;
    color: #059669;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.status-online {
    width: 8px;
    height: 8px;
    background: #059669;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-window {
        width: 300px;
        height: 450px;
        bottom: 70px;
        right: -10px;
    }
    
    .chat-widget {
        bottom: 15px;
        right: 15px;
    }
    
    .chat-button {
        padding: 12px 20px;
    }
    
    .chat-text {
        display: none;
    }
}

/* Quick Action Buttons */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quick-action-btn {
    background: #f0f9ff;
    color: #1e40af;
    border: 1px solid #3b82f6;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}

.quick-action-btn:hover {
    background: #3b82f6;
    color: white;
}

/* Chat Attachment Button */
.chat-attachment {
    position: relative;
    cursor: pointer;
    color: #6b7280;
    padding: 0.75rem;
    border-radius: 6px;
    transition: color 0.3s;
}

.chat-attachment:hover {
    color: #10b981;
}

.chat-attachment input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}