/* Compass Chatbot Widget - Site-wide */

.chatbot-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-blue, #1a5fb4);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(26, 95, 180, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 1000;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(26, 95, 180, 0.5);
}

.chatbot-widget {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 500px;
    max-height: calc(100vh - 150px);
    background: var(--bg-white, #ffffff);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 999;
    overflow: hidden;
}

.chatbot-widget.open {
    display: flex;
}

.chatbot-header {
    background: var(--primary-blue, #1a5fb4);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.chatbot-header .info h4 {
    margin: 0;
    font-size: 1rem;
    color: white;
}

.chatbot-header .info p {
    margin: 0;
    font-size: 0.75rem;
    opacity: 0.9;
}

.chatbot-header .close-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    max-width: 90%;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-light, #f8f9fa);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.chat-message.user .avatar {
    background: var(--primary-blue, #1a5fb4);
    color: white;
}

.chat-message .content {
    background: var(--bg-light, #f8f9fa);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-message.user .content {
    background: var(--primary-blue, #1a5fb4);
    color: white;
}

.chat-message .content p {
    margin: 0 0 0.5rem;
}

.chat-message .content p:last-child {
    margin-bottom: 0;
}

.chat-message .content ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.chat-message .content blockquote {
    background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
    border-left: 3px solid #ffc107;
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    margin: 0.75rem 0;
    font-size: 0.85rem;
}

.chat-message .content blockquote p {
    margin: 0;
    color: #5d4e37;
}

.chat-message .content blockquote strong {
    color: #856404;
}

.chatbot-input {
    padding: 1rem;
    border-top: 1px solid var(--border-light, #e0e0e0);
    display: flex;
    gap: 0.5rem;
}

.chatbot-input input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light, #e0e0e0);
    border-radius: 24px;
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
}

.chatbot-input input:focus {
    border-color: var(--primary-blue, #1a5fb4);
}

.chatbot-input button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-blue, #1a5fb4);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-light, #f8f9fa);
    border-radius: 12px;
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Mobile */
@media (max-width: 768px) {
    .chatbot-widget {
        bottom: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .chatbot-toggle {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
    }
}
