/* ==============================
   CHATBOT WIDGET
============================== */

/* .chatbot-widget {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 9998;
    font-family: inherit;
} */

.chatbot-widget {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 9998;
    font-family: inherit;
}

/* Geser tombol chatbot ke atas */
.chatbot-widget {
    bottom: 105px;
}
/* Floating Button */

.chatbot-trigger {
    width: 62px;
    height: 62px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #0756a5, #0085d5);
    color: white;
    font-size: 25px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 75, 150, .3);
    position: relative;
    transition: .3s;
}

.chatbot-trigger:hover {
    transform: scale(1.08);
}

.chatbot-notification {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #22c55e;
    border: 2px solid white;
    border-radius: 50%;
    top: 5px;
    right: 5px;
}

/* Chat Window */

.chatbot-window {
    position: absolute;
    bottom: 78px;
    right: 0;
    width: 380px;
    height: 550px;
    max-height: calc(100dvh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .18);
    display: flex;
    flex-direction: column;
    overflow: hidden;

    opacity: 0;
    visibility: hidden;
    transform: translateY(15px) scale(.97);
    transition: .25s ease;
}

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

/* Header */

.chatbot-header {
    background: linear-gradient(135deg, #064b91, #087cc3);
    color: white;
    padding: 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chatbot-header h6 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: white;
}

.chatbot-header-info span {
    font-size: 11px;
    color: rgba(255,255,255,.85);
}

.chatbot-online {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    margin-right: 4px;
}

.chatbot-header-actions {
    display: flex;
    gap: 8px;
}

.chatbot-header-actions button {
    border: none;
    background: transparent;
    color: white;
    font-size: 17px;
    cursor: pointer;
}

/* Chat Body */

.chatbot-body {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    background: #f5f8fc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chatbot-message {
    max-width: 85%;
    padding: 11px 14px;
    border-radius: 13px;
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.chatbot-message.bot {
    align-self: flex-start;
    background: white;
    color: #333;
    border: 1px solid #e5eaf0;
    border-bottom-left-radius: 3px;
}

.chatbot-message.visitor {
    align-self: flex-end;
    background: #0868b5;
    color: white;
    border-bottom-right-radius: 3px;
}

/* Quick Questions */

.chatbot-quick {
    padding: 10px 14px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.chatbot-quick small {
    width: 100%;
    color: #777;
    font-size: 11px;
}

.chatbot-quick button {
    border: 1px solid #c8dcef;
    background: #f3f8fd;
    color: #0756a5;
    border-radius: 20px;
    padding: 6px 10px;
    font-size: 10px;
    cursor: pointer;
}

/* Footer */

.chatbot-footer {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: white;
    border-top: 1px solid #eee;
}

.chatbot-footer input {
    flex: 1;
    min-width: 0;
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 10px 15px;
    font-size: 13px;
    outline: none;
}

.chatbot-footer input:focus {
    border-color: #087cc3;
}

.chatbot-footer button {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: #087cc3;
    color: white;
    cursor: pointer;
}

.chatbot-footer button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.chatbot-footer-caption {
    text-align: center;
    background: white;
    padding: 0 0 9px;
    color: #999;
    font-size: 10px;
}

/* Loading */

.chatbot-loading {
    display: none;
    align-self: flex-start;
    background: white;
    padding: 12px;
    border-radius: 12px;
}

.chatbot-loading.active {
    display: flex;
    gap: 5px;
}

.chatbot-loading span {
    width: 6px;
    height: 6px;
    background: #087cc3;
    border-radius: 50%;
    animation: chatbotBounce .8s infinite alternate;
}

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

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

@keyframes chatbotBounce {
    to {
        transform: translateY(-5px);
        opacity: .4;
    }
}

/* WhatsApp */

.chatbot-wa {
    display: inline-block;
    margin-top: 9px;
    padding: 7px 12px;
    border-radius: 20px;
    background: #16a34a;
    color: white !important;
    text-decoration: none !important;
    font-size: 11px;
}

/* Responsive */

@media(max-width: 576px) {

    .chatbot-widget {
        right: 15px;
        bottom: 15px;
    }

    .chatbot-window {
        position: fixed;
        bottom: 88px;
        right: 12px;
        left: 12px;
        width: auto;
        height: min(550px, calc(100dvh - 115px));
        max-height: none;
    }

    .chatbot-trigger {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }

}
