/* Chatbot floating widget */

.chatbot-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    font-family: 'Montserrat', sans-serif;
}

/* Teaser bubble */
.chatbot-teaser {
    position: absolute;
    bottom: 4.5rem;
    right: 0;
    background: var(--white);
    color: var(--black);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    font-size: var(--text-sm);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

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

.chatbot-teaser-close {
    background: none;
    border: none;
    color: var(--text-grey);
    cursor: pointer;
    margin-left: 0.5rem;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
}

/* Floating button */
.chatbot-bubble {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--dark-blue);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease, transform 0.2s ease;
    margin-left: auto;
}

.chatbot-bubble:hover {
    background: var(--light-blue);
    transform: scale(1.05);
}

.chatbot-bubble svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--white);
    transition: transform 0.2s ease;
}

.chatbot-bubble--open .chatbot-bubble-icon--chat {
    display: none;
}

.chatbot-bubble--open .chatbot-bubble-icon--close {
    display: block;
}

.chatbot-bubble-icon--close {
    display: none;
}

/* Chat window */
.chatbot-widget {
    position: absolute;
    bottom: 4.5rem;
    right: 0;
    width: 24rem;
    max-height: 36rem;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.chatbot-widget--open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header */
.chatbot-header {
    background: var(--dark-blue);
    color: var(--white);
    padding: 1rem 1.25rem;
    font-size: var(--text-base);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chatbot-header-logo {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
}

/* Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 16rem;
    max-height: 26rem;
}

.chatbot-message {
    padding: 0.625rem 0.875rem;
    border-radius: 10px;
    font-size: var(--text-sm);
    line-height: 1.5;
    max-width: 85%;
    word-wrap: break-word;
}

.chatbot-message--bot {
    background: var(--light-grey);
    color: var(--black);
    align-self: flex-start;
}

.chatbot-message--user {
    background: var(--dark-blue);
    color: var(--white);
    align-self: flex-end;
}

.chatbot-link {
    color: var(--dark-blue);
    font-weight: 600;
    text-decoration: underline;
}

.chatbot-message--user .chatbot-link {
    color: var(--light-blue);
}

/* Input area */
.chatbot-input-area {
    display: flex;
    border-top: 1px solid var(--light-grey);
    padding: 0.75rem;
    gap: 0.5rem;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: var(--text-sm);
    font-family: 'Montserrat', sans-serif;
    outline: none;
    transition: border-color 0.2s ease;
}

.chatbot-input:focus {
    border-color: var(--light-blue);
}

.chatbot-input::placeholder {
    color: var(--text-grey);
}

.chatbot-send {
    background: var(--dark-blue);
    border: none;
    border-radius: 8px;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send:hover {
    background: var(--light-blue);
}

.chatbot-send svg {
    width: 1rem;
    height: 1rem;
    fill: var(--white);
}

/* Typing indicator */
.chatbot-typing {
    display: flex;
    gap: 0.3rem;
    padding: 0.25rem 0;
}

.chatbot-typing span {
    width: 0.5rem;
    height: 0.5rem;
    background: var(--text-grey);
    border-radius: 50%;
    animation: chatbot-bounce 1.2s infinite ease-in-out;
}

.chatbot-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.chatbot-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes chatbot-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-0.4rem); }
}

/* Disabled state */
.chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-input:disabled {
    background: var(--light-grey);
}

/* Mobile responsive */
@media screen and (max-width: 480px) {
    .chatbot-widget {
        width: calc(100vw - 2rem);
        right: -0.5rem;
        max-height: 70vh;
    }

    .chatbot-container {
        bottom: 1rem;
        right: 1rem;
    }
}
