/* =========================================================
   MEGALODON HELPER
   ---------------------------------------------------------
   All Helper styles are isolated under helper-* classes.
   Do not use these styles for other Megalodon components.
   ========================================================= */


/* ---------- Launch Button ---------- */

.helper-launch-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9998;

    display: flex;
    align-items: center;
    gap: 9px;

    padding: 12px 18px;

    background: #090909;
    color: #ffffff;

    border: 1px solid #22e6dc;
    border-radius: 24px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 0 10px rgba(34, 230, 220, 0.35),
        0 4px 14px rgba(0, 0, 0, 0.25);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.helper-launch-button:hover {
    transform: translateY(-2px);

    box-shadow:
        0 0 14px rgba(34, 230, 220, 0.55),
        0 6px 18px rgba(0, 0, 0, 0.3);
}

.helper-launch-icon {
    color: #22e6dc;
    font-size: 18px;
}


/* ---------- Chat Window ---------- */

.helper-window {
    position: fixed;
    right: 24px;
    bottom: 84px;

    width: 410px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 120px);

    z-index: 9999;

    display: none;
    flex-direction: column;

    background: #ffffff;

    border: 1px solid #22e6dc;
    border-radius: 12px;

    overflow: hidden;

    box-shadow:
        0 0 18px rgba(34, 230, 220, 0.25),
        0 10px 35px rgba(0, 0, 0, 0.35);

    font-family: inherit;
}

.helper-window.helper-open {
    display: flex;
}


/* ---------- Header ---------- */

.helper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 14px 16px;

    background: #080808;
    color: #ffffff;

    border-bottom: 2px solid transparent;
    border-image:
        linear-gradient(
            90deg,
            #22e6dc,
            #ff2a9d
        ) 1;
}

.helper-header-title {
    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 15px;
    font-weight: 700;
}

.helper-header-icon {
    color: #22e6dc;
    font-size: 19px;
}

.helper-close-button {
    appearance: none;

    background: transparent;
    color: #ffffff;

    border: 0;

    font-family: inherit;
    font-size: 22px;
    line-height: 1;

    cursor: pointer;

    padding: 2px 4px;
}

.helper-close-button:hover {
    color: #ff2a9d;
}


/* ---------- Messages ---------- */

.helper-messages {
    flex: 1;

    padding: 16px;

    overflow-y: auto;

    background: #f5f7fb;
}

.helper-message {
    max-width: 85%;

    margin-bottom: 12px;
    padding: 10px 13px;

    border-radius: 12px;

    font-size: 15px;
    line-height: 1.45;
}

.helper-message-bot {
    margin-right: auto;

    background: #ffffff;
    color: #252b35;

    border: 1px solid #d9dee8;
    border-left: 3px solid #22e6dc;
}

.helper-message-user {
    margin-left: auto;

    background: #252e3b;
    color: #ffffff;

    border-right: 3px solid #ff2a9d;
}


/* ---------- Suggested Questions ---------- */

.helper-suggestions {
    display: flex;
    flex-direction: column;
    gap: 7px;

    margin: 4px 0 14px;
}

.helper-suggestion-button {
    width: 100%;

    padding: 9px 11px;

    background: #ffffff;
    color: #252b35;

    border: 1px solid #22e6dc;
    border-radius: 7px;

    font-family: inherit;
    font-size: 13px;
    text-align: left;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.helper-suggestion-button:hover {
    background: #eefdfc;
    border-color: #ff2a9d;
}


/* ---------- Input Area ---------- */

.helper-input-area {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 11px;

    background: #ffffff;

    border-top: 1px solid #d9dee8;
}

.helper-input {
    flex: 1;
    min-width: 0;

    padding: 10px 12px;

    background: #ffffff;
    color: #252b35;

    border: 1px solid #cbd1dc;
    border-radius: 7px;

    outline: none;

    font-family: inherit;
    font-size: 14px;
}

.helper-input:focus {
    border-color: #22e6dc;

    box-shadow:
        0 0 0 2px rgba(34, 230, 220, 0.12);
}

.helper-send-button {
    padding: 10px 14px;

    background:
        linear-gradient(
            90deg,
            #22e6dc,
            #ff2a9d
        );

    color: #000000;

    border: 0;
    border-radius: 7px;

    font-family: inherit;
    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
}

.helper-send-button:hover {
    filter: brightness(1.05);
}

/* ---------- Typing Indicator ---------- */

.helper-typing {
    display: flex;
    align-items: center;
    gap: 5px;

    width: fit-content;
    min-width: 48px;
}

.helper-typing-dot {
    width: 7px;
    height: 7px;

    background: #22e6dc;

    border-radius: 50%;

    animation:
        helper-typing-bounce
        1.1s
        infinite ease-in-out;
}

.helper-typing-dot:nth-child(2) {
    animation-delay: 0.30s;
}

.helper-typing-dot:nth-child(3) {
    animation-delay: 0.40s;
}

@keyframes helper-typing-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.45;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* ---------- Answer Links ---------- */

.helper-link-container {
    margin: -5px 0 14px 0;
}

.helper-link-button {
    display: inline-block;

    padding: 8px 13px;

    background: #090909;
    color: #22e6dc;

    border: 1px solid #22e6dc;
    border-radius: 16px;

    font-family: inherit;
    font-size: 13px;
    font-weight: 700;

    text-decoration: none;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.helper-link-button:hover {
    color: #ff2a9d;
    border-color: #ff2a9d;
    transform: translateY(-1px);
}

/* ---------- Mobile ---------- */

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    /* ---------- Launcher ---------- */

    .helper-launch-button {
        right: 12px;
        bottom: 12px;

        padding: 11px 15px;

        max-width: calc(100vw - 24px);

        font-size: 13px;
    }


    /* ---------- Chat Window ---------- */

    .helper-window {
	    position: fixed;

	    left: 12px;
	    right: 12px;
	    bottom: 12px;

	    width: auto;
	    max-width: none;

	    height: min(500px, 65dvh);
	    max-height: 65dvh;

	    border-radius: 14px;
	}


    /* ---------- Header ---------- */

    .helper-header {
        flex-shrink: 0;

        padding: 13px 14px;
    }

    .helper-header-title {
        font-size: 14px;
    }

    .helper-close-button {
        min-width: 36px;
        min-height: 36px;

        font-size: 24px;

        display: flex;
        align-items: center;
        justify-content: center;
    }


    /* ---------- Messages ---------- */

    .helper-messages {
        flex: 1;
        min-height: 0;

        padding: 13px;

        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .helper-message {
        max-width: 90%;

        padding: 10px 12px;

        font-size: 14px;
        line-height: 1.45;
    }


    /* ---------- Suggestions ---------- */

    .helper-suggestions {
        gap: 8px;
    }

    .helper-suggestion-button {
        min-height: 44px;

        padding: 10px 12px;

        font-size: 14px;
    }


    /* ---------- Input ---------- */

    .helper-input-area {
        flex-shrink: 0;

        padding: 9px;
        gap: 7px;
    }

    .helper-input {
        min-height: 44px;

        padding: 10px 11px;

        font-size: 16px;
    }

    .helper-send-button {
        min-height: 44px;

        padding: 10px 14px;

        font-size: 14px;
    }
}


/* Extra-small phones */

@media (max-width: 380px) {

    .helper-window {
        left: 8px;
        right: 8px;
        bottom: 12px;

        width: auto;

        height: min(520px, 72dvh);
        max-height: 72dvh;

        border-radius: 14px;
    }

    .helper-message {
        max-width: 94%;
    }

    .helper-input-area {
        padding: 7px;
    }

    .helper-send-button {
        padding-left: 11px;
        padding-right: 11px;
    }
}