/* ========================================
   Chatbot Widget
   ======================================== */

.chatbot__container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9990;
}

.chatbot__btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #0d5364 url("/assets/img/logo/nzc_icon_white.png") center/55%
        no-repeat;
    border: 3px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    position: relative;
    z-index: 9991;
}

.chatbot__btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4);
}

.chatbot__container.is-open .chatbot__btn {
    display: none;
}

/* ========================================
   Welcome bubble
   ======================================== */

.chatbot__bubble {
    position: absolute;
    bottom: 8px;
    right: 76px;
    background: #fff;
    color: #0d5364;
    padding: 12px 32px 12px 16px;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    width: 260px;
    cursor: pointer;
    font-size: 0.9em;
    line-height: 1.35;
    z-index: 9992;
    transition: opacity 0.2s, transform 0.2s;

    &::after {
        content: "";
        position: absolute;
        top: 50%;
        right: -8px;
        transform: translateY(-50%);
        border-width: 8px 0 8px 10px;
        border-style: solid;
        border-color: transparent transparent transparent #fff;
    }

    & p {
        margin: 0;
    }

    &:hover {
        transform: translateY(-2px);
    }
}

.chatbot__bubble-close {
    position: absolute;
    top: 4px;
    right: 6px;
    background: none;
    border: none;
    color: #0d5364;
    font-size: 0.85em;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;

    &:hover {
        opacity: 1;
    }
}

.chatbot__bubble.is-hidden-bubble,
.chatbot__container.is-open .chatbot__bubble {
    display: none;
}


.chatbot__panel {
    position: fixed;
    right: -440px;
    bottom: 10px;
    width: 420px;
    height: calc(100vh - 80px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: -4px 0 28px rgba(0, 0, 0, 0.18);
    z-index: 9989;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot__container.is-open .chatbot__panel {
    right: 10px;
}
.chatbot__container.is-open.is-full .chatbot__panel {
    right: 0px;
    bottom: 0px;
    width: 100%;
    height: 100vh;
}

.chatbot__header {
    background: #0d5364;
    color: #fff;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.chatbot__header img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.chatbot__header span {
    flex: 1;
    font-weight: 600;
    font-size: 0.9em;
}

.chatbot__close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2em;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
}
.chatbot__up {
    display: block;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2em;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
}
.chatbot__down {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2em;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
}

.chatbot__container.is-open.is-full .chatbot__down{
     display: block;
}

.chatbot__container.is-open.is-full .chatbot__up{
     display: none;
}

.chatbot__up:hover, .chatbot__down:hover, .chatbot__close:hover {
    opacity: 1;
}

.chatbot__iframe {
    flex: 1;
    border: none;
    width: 100%;
    color-scheme: light;
}

@media (max-width: 480px) {
    .chatbot__btn {
        width: 52px;
        height: 52px;
    }
    .chatbot__panel {
        width: 100vw;
        right: -100vw;
        border-radius: 0;
    }
    .chatbot__container.is-open .chatbot__panel {
        height: 100dvh;
        inset: 0;
    }
    .chatbot__bubble {
        right: 64px;
        max-width: 180px;
        font-size: 0.8em;
    }
}
