/* ======================================================================
   IELTS — global "Back to top" button.
   Brand-gradient circular button, fixed bottom-right, shown after the user
   scrolls down. While it is visible the AI Engine chatbot is nudged up a
   little (animated) so the two stack neatly instead of overlapping.
   Injected site-wide by assets/js/scroll-top.js.
   ====================================================================== */
.ielts-stt {
    position: fixed;
    right: 22px;
    bottom: 24px;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #635bff 0%, #8b5cf6 100%);
    box-shadow: 0 10px 26px rgba(99, 91, 255, .42);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(.85);
    transition: opacity .3s ease, transform .35s cubic-bezier(.22, 1, .36, 1),
                visibility .3s ease, box-shadow .2s ease, filter .2s ease;
    /* Sit just below the AI Engine chatbot (z-index 2147483000) so an open
       chat window always covers the button. */
    z-index: 2147482000;
}

.ielts-stt.is-on {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.ielts-stt:hover {
    filter: brightness(1.07);
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 16px 34px rgba(99, 91, 255, .52);
}

.ielts-stt:active {
    transform: translateY(-1px) scale(.97);
}

.ielts-stt:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.ielts-stt svg {
    width: 22px;
    height: 22px;
    display: block;
}

/* Nudge ONLY the launcher bubble up while the button is showing.
   We move the launcher element itself — NOT .mwai-chatbot-container — because
   the container is the containing block for the fixed launcher: transforming
   the container re-anchors the fixed child and makes the chatbot jump
   off-screen (look hidden). Transforming the fixed launcher just shifts it. */
.mwai-chatbot-container .mwai-trigger,
.mwai-chatbot-container .mwai-open-button {
    transition: transform .4s cubic-bezier(.22, 1, .36, 1) !important;
}

body.ielts-stt-up .mwai-chatbot-container .mwai-trigger,
body.ielts-stt-up .mwai-chatbot-container .mwai-open-button {
    transform: translateY(-72px) !important;
}

@media (max-width: 600px) {
    .ielts-stt {
        right: 16px;
        bottom: 18px;
        width: 44px;
        height: 44px;
    }

    body.ielts-stt-up .mwai-chatbot-container .mwai-trigger,
    body.ielts-stt-up .mwai-chatbot-container .mwai-open-button {
        transform: translateY(-64px) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ielts-stt,
    .mwai-chatbot-container .mwai-trigger,
    .mwai-chatbot-container .mwai-open-button {
        transition: none !important;
    }
}
