:root {
    --chatbot-primary: #F5C77A;
    --chatbot-primary-hover: #E6A843;
    --chatbot-bg: #ffffff;
    --chatbot-text: #212529;
    --chatbot-border: #dee2e6;
    --chatbot-shadow: rgba(0, 0, 0, 0.15);
    --chatbot-user-bg: #fef7e8;
    --chatbot-assistant-bg: #fafafa;
}

.chatbot-widget {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 1050;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.chatbot-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--chatbot-primary);
    color: #212529;
    border: none;
    box-shadow: 0 4px 12px var(--chatbot-shadow);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s ease;
    z-index: 1051;
}

.chatbot-toggle:hover {
    background-color: var(--chatbot-primary-hover);
    transform: scale(1.05);
    box-shadow: 0 6px 16px var(--chatbot-shadow);
}

.chatbot-toggle:active {
    transform: scale(0.95);
}

.chatbot-toggle i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.chatbot-toggle-text {
    font-size: 0.65rem;
    font-weight: 500;
    line-height: 1;
}

.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 1.5rem;
    width: 90vw;
    max-width: 400px;
    max-height: 70vh;
    background-color: var(--chatbot-bg);
    border-radius: 12px;
    box-shadow: 0 8px 24px var(--chatbot-shadow);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1050;
}

.chatbot-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--chatbot-border);
    background-color: var(--chatbot-primary);
    color: #212529;
    border-radius: 12px 12px 0 0;
}

.chatbot-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chatbot-title i {
    font-size: 1.25rem;
}

.chatbot-close {
    background: none;
    border: none;
    color: #212529;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.chatbot-close:hover {
    opacity: 1;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 200px;
    max-height: calc(70vh - 200px);
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.chatbot-welcome {
    text-align: center;
    padding: 1rem;
    color: var(--chatbot-text);
    font-size: 0.9rem;
}

.chatbot-message {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.user {
    align-self: flex-end;
    align-items: flex-end;
}

.chatbot-message.assistant {
    align-self: flex-start;
    align-items: flex-start;
}

.chatbot-message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.chatbot-message.user .chatbot-message-bubble {
    background-color: var(--chatbot-primary);
    color: #212529;
    border-bottom-right-radius: 4px;
}

.chatbot-message.assistant .chatbot-message-bubble {
    background-color: var(--chatbot-assistant-bg);
    color: var(--chatbot-text);
    border-bottom-left-radius: 4px;
}

.chatbot-message-time {
    font-size: 0.7rem;
    color: #6c757d;
    padding: 0 0.5rem;
}

.chatbot-quick-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--chatbot-border);
    border-bottom: 1px solid var(--chatbot-border);
    background-color: #f8f9fa;
}

.chatbot-quick-btn {
    flex: 1;
    font-size: 0.85rem;
    padding: 0.5rem;
    white-space: nowrap;
}

.chatbot-input-container {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--chatbot-border);
}

.chatbot-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    border: 1px solid var(--chatbot-border);
    border-radius: 20px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: var(--chatbot-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.1);
}

.chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--chatbot-primary);
    color: #212529;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover {
    background-color: var(--chatbot-primary-hover);
}

.chatbot-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chatbot-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--chatbot-border);
    text-align: center;
}

.chatbot-clear-btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    text-decoration: none;
}

.chatbot-clear-btn:hover {
    text-decoration: underline;
}

.chatbot-loading {
    display: flex;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    align-items: center;
}

.chatbot-loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #6c757d;
    animation: loadingDot 1.4s infinite ease-in-out;
}

.chatbot-loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.chatbot-loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loadingDot {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 576px) {
    .chatbot-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 56px;
        height: 56px;
    }

    .chatbot-toggle i {
        font-size: 1.25rem;
    }

    .chatbot-toggle-text {
        font-size: 0.6rem;
    }

    .chatbot-window {
        bottom: 75px;
        right: 1rem;
        left: 1rem;
        width: auto;
        max-width: none;
        max-height: 75vh;
    }

    .chatbot-messages {
        max-height: calc(75vh - 200px);
    }

    .chatbot-message {
        max-width: 90%;
    }

    .chatbot-quick-actions {
        flex-direction: column;
    }

    .chatbot-quick-btn {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .chatbot-window {
        max-width: 450px;
    }
}
