.chatbot-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9998;
    font-family: "Poppins", "Inter", sans-serif;
}

.chatbot-widget.chatbot-left {
    left: 24px;
    right: auto;
}

.chatbot-widget.chatbot-right {
    right: 24px;
    left: auto;
}

.chatbot-fab {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, rgba(31, 77, 189, 0.95), rgba(20, 143, 128, 0.95));
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 12px 24px rgba(16, 30, 61, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    flex-direction: column;
    gap: 0;
    padding: 0;
    overflow: visible;
    z-index: 9999;
}

.chatbot-fab-tooltip {
    position: absolute;
    top: -48px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: #ffffff;
    color: #173a8b;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(16, 30, 61, 0.18);
    border: 1px solid #dbe6fb;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chatbot-fab-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-left: 1px solid #dbe6fb;
    border-bottom: 1px solid #dbe6fb;
    transform: translateX(-50%) rotate(-45deg);
}

.chatbot-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(16, 30, 61, 0.3);
}

.chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: 340px;
    max-height: 520px;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(209, 223, 245, 0.7);
    box-shadow: 0 18px 40px rgba(16, 30, 61, 0.25);
    backdrop-filter: blur(18px);
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.chatbot-widget.chatbot-left .chatbot-panel {
    left: 0;
    right: auto;
}

.chatbot-widget.chatbot-right .chatbot-panel {
    right: 0;
    left: auto;
}

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

.chatbot-header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(220, 230, 248, 0.8);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.chatbot-header-top {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-avatar {
    width: 34px;
    height: 34px;
    object-fit: contain;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e0e8fb;
    padding: 4px;
}

.chatbot-avatar-fallback {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef4ff;
    color: #1f4dbd;
    border-radius: 10px;
    border: 1px solid #dbe6fb;
    font-size: 0.9rem;
}

.chatbot-title {
    font-weight: 700;
    color: #14326b;
    font-size: 0.95rem;
}

.chatbot-subtitle {
    font-size: 0.75rem;
    color: #4b5c7a;
}

.chatbot-close {
    border: none;
    background: transparent;
    font-size: 1.2rem;
    color: #6b7a99;
}

.chatbot-header-actions {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.chatbot-lang {
    border: 1px solid #d4def4;
    background: #f5f8ff;
    color: #2b3f6b;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 999px;
}

.chatbot-clear {
    border: 1px solid #d4def4;
    background: #f5f8ff;
    color: #2b3f6b;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 999px;
}

.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px 0;
}

.chatbot-chip {
    border: 1px solid rgba(31, 77, 189, 0.25);
    background: rgba(31, 77, 189, 0.08);
    color: #173a8b;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 999px;
}

.chatbot-messages {
    padding: 12px 14px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.chatbot-message {
    display: flex;
    margin-bottom: 10px;
}

.chatbot-message.user {
    justify-content: flex-end;
}

.chatbot-message .bubble {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 0.82rem;
    line-height: 1.3;
}

.chatbot-message.bot .bubble {
    background: #eef4ff;
    color: #19335f;
    border: 1px solid #dbe6fb;
}

.chatbot-message.user .bubble {
    background: #1f4dbd;
    color: #fff;
}

.chatbot-input {
    display: flex;
    gap: 8px;
    padding: 12px 14px 14px;
    border-top: 1px solid rgba(220, 230, 248, 0.8);
}

.chatbot-input input {
    flex: 1;
    border: 1px solid #d7e2f8;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 0.82rem;
}

.chatbot-input button {
    border: none;
    background: #1f4dbd;
    color: #fff;
    border-radius: 12px;
    padding: 0 14px;
}

.chatbot-typing {
    font-size: 0.75rem;
    color: #6b7a99;
    padding: 0 14px 10px;
}

.chatbot-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid #2d6bda;
    color: #2d6bda;
    text-decoration: none;
    font-size: 0.75rem;
    margin-top: 6px;
}

@media (max-width: 576px) {
    .chatbot-panel {
        width: 90vw;
        right: -6px;
    }
}
.chatbot-fab-bot {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(6px) scale(0.6);
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #ffffff;
    color: #1f4dbd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(16, 30, 61, 0.18);
    z-index: 9998;
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.chatbot-fab-icon {
    position: absolute;
    inset: 6px;
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    padding: 6px;
    box-shadow: 0 4px 10px rgba(16, 30, 61, 0.16);
}

.chatbot-fab-icon-fallback {
    position: absolute;
    inset: 6px;
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    border-radius: 50%;
    background: #ffffff;
    color: #1f4dbd;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(16, 30, 61, 0.16);
}

.chatbot-fab:hover .chatbot-fab-bot {
    opacity: 1;
    transform: translateX(-50%) translateY(-26px) scale(1);
}

.chatbot-fab:hover .chatbot-fab-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
