.chatbot {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    font-family: var(--font-primary);
}

.chatbot--hidden {
    display: none;
}

.chatbot__toggle {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background-color: var(--c-primary-400);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, background-color 0.3s ease;
    position: relative;
    z-index: 9999;
}

.chatbot__toggle:hover {
    transform: translateY(-2px);
    background-color: var(--c-primary-500);
}

.chatbot__icon {
    width: 1.75rem;
    height: 1.75rem;
}

.chatbot__icon--close {
    display: none;
}

.chatbot.is-open .chatbot__icon {
    display: none;
}

.chatbot.is-open .chatbot__icon--close {
    display: block;
}

.chatbot__window {
    position: fixed;
    bottom: 7rem;
    right: 2rem;
    width: 360px;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 9998;
}

.chatbot.is-open .chatbot__window {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.chatbot__header {
    padding: 1.5rem;
    background: var(--c-primary-400);
    color: white;
    border-radius: 1rem 1rem 0 0;
}

.chatbot__header h3 {
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
}

.chatbot__header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.chatbot__messages {
    padding: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chatbot__message {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    max-width: 80%;
    line-height: 1.4;
}

.chatbot__message--bot {
    background: var(--c-primary-000);
    color: var(--c-primary-600);
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
}

.chatbot__message--user {
    background: var(--c-primary-400);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
}

.chatbot__message--typing {
    background: var(--c-primary-000);
    color: var(--c-primary-600);
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 3.5rem;
    padding: 0.75rem 1rem;
}

.chatbot__message--typing span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--c-primary-400);
    border-radius: 50%;
    margin: 0 2px;
    opacity: 0.6;
    animation: typing-dot 1.4s infinite ease-in-out both;
}

.chatbot__message--typing span:nth-child(1) {
    animation-delay: 0s;
}

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

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

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

.chatbot__options {
    padding: 0 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.chatbot__option {
    background: var(--c-primary-000);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    color: var(--c-primary-400);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.chatbot__option:hover {
    background: var(--c-primary-100);
    transform: translateY(-1px);
}

.chatbot__input-container {
    padding: 1rem 1.5rem;
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid var(--c-primary-000);
    background: white;
}

.chatbot__input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--c-primary-100);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.chatbot__input:focus {
    outline: none;
    border-color: var(--c-primary-400);
}

.chatbot__send {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    background: var(--c-primary-400);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.chatbot__send:hover {
    background: var(--c-primary-500);
}

.chatbot__send svg {
    width: 1.25rem;
    height: 1.25rem;
}

.chatbot__contact {
    padding: 1.5rem;
    background: var(--c-primary-000);
    border-radius: 0 0 1rem 1rem;
}

.chatbot__contact--hidden {
    display: none;
}

.chatbot__contact h4 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
    color: var(--c-primary-400);
}

.chatbot__contact p {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--c-gray-400);
}

.chatbot__contact-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 0.5rem;
    color: var(--c-primary-400);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chatbot__contact-option svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.chatbot__contact-option span {
    flex: 1;
}

.chatbot__copy {
    width: 2rem;
    height: 2rem;
    border: none;
    background: var(--c-primary-000);
    color: var(--c-primary-400);
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0.5rem;
    flex-shrink: 0;
}

.chatbot__copy:hover {
    background: var(--c-primary-100);
    transform: translateY(-1px);
}

.chatbot__copy.copied {
    background: var(--c-primary-400);
    color: white;
}

.chatbot__copy svg {
    width: 1rem;
    height: 1rem;
}

@media screen and (max-width: 480px) {
    .chatbot__window {
        width: calc(100vw - 4rem);
        right: 0;
        bottom: 6rem;
        margin: 0 1rem;
    }

    .chatbot__toggle {
        width: 3.5rem;
        height: 3.5rem;
    }

    .chatbot__icon {
        width: 1.5rem;
        height: 1.5rem;
    }
}
