/* ================================================
   AI CHATBOT WIDGET
   ================================================ */

.chatbot-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--forest-deep);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-round);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 9999;
    /* Highest priority */
    transition: transform var(--transition-base), background var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-fab:hover {
    transform: scale(1.1);
    background: var(--slate-dark);
}

.chatbot-fab .notification-dot {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 12px;
    height: 12px;
    background: var(--burnt-sienna);
    border: 2px solid var(--forest-deep);
    border-radius: 50%;
}

.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-base);
    border: 1px solid var(--border-color);
}

.chatbot-window.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.chatbot-header {
    background: var(--forest-deep);
    color: var(--text-inverse);
    padding: var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.chatbot-avatar {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-title h3 {
    font-size: 1rem;
    margin: 0;
    color: var(--text-inverse);
}

.chatbot-status {
    font-size: 0.75rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--electric-teal);
    border-radius: 50%;
    display: inline-block;
}

.chatbot-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1.25rem;
    transition: color 0.2s;
}

.chatbot-close:hover {
    color: white;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.message {
    max-width: 85%;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    animation: fadeIn 0.3s ease;
}

.message.bot {
    align-self: flex-start;
    background: var(--bg-primary);
    border-top-left-radius: 2px;
    border: 1px solid var(--border-color);
    margin-left: 8px;
}

.message.user {
    align-self: flex-end;
    background: var(--forest-deep);
    color: white;
    border-top-right-radius: 2px;
}

.message-agent-icon {
    position: absolute;
    top: -10px;
    left: -10px;
    font-size: 1.2rem;
    background: var(--bg-primary);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.chatbot-controls {
    padding: var(--space-sm);
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.agent-selector {
    display: flex;
    gap: var(--space-xs);
    overflow-x: auto;
    padding-bottom: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.agent-pill {
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.agent-pill.active {
    background: var(--forest-deep);
    color: white;
    border-color: var(--forest-deep);
}

.chatbot-input-area {
    display: flex;
    gap: var(--space-sm);
}

.chatbot-input {
    flex: 1;
    padding: var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    resize: none;
    height: 45px;
}

.chatbot-send {
    background: var(--bronze);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-send:hover {
    background: var(--deep-gold);
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.quick-reply-btn {
    background: white;
    border: 1px solid var(--forest-deep);
    color: var(--forest-deep);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-reply-btn:hover {
    background: var(--forest-deep);
    color: white;
}

@media (max-width: 480px) {
    .chatbot-window {
        width: 100%;
        height: 100%;
        max-height: none;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}