/* AI Chatbot Widget Styles */

#aichatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

#aichatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

#aichatbot-button:hover {
    background: #1d4ed8;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#aichatbot-button.active {
    background: #ef4444;
}

#aichatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#aichatbot-window.open {
    display: flex;
}

#aichatbot-header {
    background: #2563eb;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#aichatbot-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

#aichatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#aichatbot-close:hover {
    opacity: 0.8;
}

#aichatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f9fafb;
}

#aichatbot-messages::-webkit-scrollbar {
    width: 6px;
}

#aichatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#aichatbot-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

#aichatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.aichatbot-message {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.aichatbot-message.user {
    align-items: flex-end;
}

.aichatbot-message.bot,
.aichatbot-message.agent {
    align-items: flex-start;
}

.aichatbot-message-bubble {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.5;
}

.aichatbot-message.user .aichatbot-message-bubble {
    background: #2563eb;
    color: white;
    border-bottom-right-radius: 4px;
}

.aichatbot-message.bot .aichatbot-message-bubble {
    background: white;
    color: #333;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.aichatbot-message.agent .aichatbot-message-bubble {
    background: #10b981;
    color: white;
    border-bottom-left-radius: 4px;
}

.aichatbot-message-time {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
    padding: 0 0.5rem;
}

#aichatbot-input-area {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e5e7eb;
}

#aichatbot-escalate-btn {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
}

#aichatbot-escalate-btn:hover {
    background: #dc2626;
}

#aichatbot-escalate-btn:disabled {
    display: none;
}

#aichatbot-input-form {
    display: flex;
    gap: 0.5rem;
}

#aichatbot-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
}

#aichatbot-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#aichatbot-send {
    padding: 0.75rem 1.5rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
}

#aichatbot-send:hover {
    background: #1d4ed8;
}

#aichatbot-send:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.aichatbot-typing {
    display: flex;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
}

.aichatbot-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typing 1.4s infinite;
}

.aichatbot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.aichatbot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

@media (max-width: 480px) {
    #aichatbot-window {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}
