/* =========================================================
   EDUGATE PATHWAY
   GALLITE ASSISTANT CHATBOT
   ========================================================= */

/* =========================================================
   ROOT
   ========================================================= */

:root {
    --gallite-blue: #1464f4;
    --gallite-blue-dark: #0d4fc7;
    --gallite-blue-light: #eaf2ff;
    --gallite-blue-soft: #f4f8ff;

    --gallite-teal: #218a86;

    --gallite-white: #ffffff;
    --gallite-black: #111111;
    --gallite-text: #1a1a1a;
    --gallite-text-secondary: #5f6368;
    --gallite-text-muted: #858585;

    --gallite-border: #dfe7f3;
    --gallite-border-blue: #c9dcff;

    --gallite-shadow:
        0 24px 60px rgba(20, 100, 244, 0.14),
        0 8px 24px rgba(0, 0, 0, 0.10);

    --gallite-radius: 18px;
}


/* =========================================================
   CHAT TOGGLE
   ========================================================= */

#gallite-chat-toggle {
    position: fixed;

    right: 28px;
    bottom: 80px;

    width: 62px;
    height: 62px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background: var(--gallite-blue);
    color: var(--gallite-white);

    cursor: pointer;

    z-index: 9998;

    box-shadow:
        0 14px 30px rgba(20, 100, 244, 0.30),
        0 5px 15px rgba(0, 0, 0, 0.10);

    transition:
        transform 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

#gallite-chat-toggle:hover {
    background: var(--gallite-blue-dark);

    transform: translateY(-3px);

    box-shadow:
        0 18px 36px rgba(20, 100, 244, 0.36),
        0 7px 18px rgba(0, 0, 0, 0.12);
}

#gallite-chat-toggle:active {
    transform: scale(0.94);
}


/* =========================================================
   TOGGLE ICON
   ========================================================= */

#gallite-chat-toggle i,
#gallite-chat-toggle svg {
    width: 25px;
    height: 25px;

    font-size: 24px;

    color: var(--gallite-white);
}


/* =========================================================
   CHAT WINDOW
   ========================================================= */

#gallite-chat-window {
    position: fixed;

    /*
     * Positioned higher than the floating quick actions
     * so the chatbot does not overlap them.
     */
    right: 28px;
    bottom: 120px;

    width: 390px;

    /*
     * Controlled desktop height.
     * Prevents the chatbot from becoming excessively tall.
     */
    height: min(480px, calc(100vh - 180px));

    min-height: 380px;
    max-height: 480px;
    display: flex;
    flex-direction: column;

    overflow: hidden;

    background: var(--gallite-white);

    border: 1px solid var(--gallite-border);

    border-radius: var(--gallite-radius);

    box-shadow: var(--gallite-shadow);

    z-index: 9999;

    opacity: 0;
    visibility: hidden;

    transform:
        translateY(18px) scale(0.97);

    transform-origin: bottom right;

    pointer-events: none;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease;
}


/* =========================================================
   OPEN STATE
   ========================================================= */

#gallite-chat-window.is-open,
#gallite-chat-window.active,
#gallite-chat-window.open {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(0) scale(1);

    pointer-events: auto;
}


/* =========================================================
   CHAT HEADER
   ========================================================= */

.gallite-chat-header {
    flex: 0 0 auto;

    min-height: 72px;

    display: flex;
    align-items: center;

    padding: 14px 16px;

    background:
        linear-gradient(135deg,
            #1464f4 0%,
            #1d73f5 55%,
            #218a86 100%);

    color: var(--gallite-white);

    position: relative;
}


/* =========================================================
   HEADER IDENTITY
   ========================================================= */

.gallite-chat-header-left {
    display: flex;
    align-items: center;
    gap: 11px;

    min-width: 0;
}

.gallite-chat-avatar {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.18);

    border: 1px solid rgba(255, 255, 255, 0.30);

    color: var(--gallite-white);

    backdrop-filter: blur(8px);
}

.gallite-chat-avatar i,
.gallite-chat-avatar svg {
    font-size: 20px;
}


/* =========================================================
   BOT INFORMATION
   ========================================================= */

.gallite-bot-info {
    min-width: 0;
}

.gallite-bot-name {
    margin: 0;

    font-family: "Manrope", sans-serif;

    font-size: 15px;
    line-height: 1.2;

    font-weight: 800;

    color: var(--gallite-white);
}

.gallite-bot-status {
    margin-top: 4px;

    display: flex;
    align-items: center;
    gap: 5px;

    font-family: "Inter", sans-serif;

    font-size: 11px;
    line-height: 1.2;

    color: rgba(255, 255, 255, 0.88);
}

.gallite-bot-status::before {
    content: "";

    width: 7px;
    height: 7px;

    flex: 0 0 7px;

    border-radius: 50%;

    background: #c8f5ad;

    box-shadow:
        0 0 0 3px rgba(200, 245, 173, 0.14);
}


/* =========================================================
   CLOSE BUTTON
   ========================================================= */

#gallite-chat-close {
    position: absolute;

    top: 50%;
    right: 13px;

    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    transform: translateY(-50%);

    border: 0;
    border-radius: 50%;

    background: transparent;

    color: var(--gallite-white);

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

#gallite-chat-close:hover {
    background: rgba(255, 255, 255, 0.14);

    transform:
        translateY(-50%) rotate(90deg);
}


/* =========================================================
   CHAT BODY
   ========================================================= */

#gallite-messages {
    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    padding: 18px 15px 14px;

    background: #fbfdff;

    scroll-behavior: smooth;
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

#gallite-messages::-webkit-scrollbar {
    width: 5px;
}

#gallite-messages::-webkit-scrollbar-track {
    background: transparent;
}

#gallite-messages::-webkit-scrollbar-thumb {
    background: #c9d9f4;

    border-radius: 999px;
}

#gallite-messages::-webkit-scrollbar-thumb:hover {
    background: #a9c2eb;
}


/* Firefox */

#gallite-messages {
    scrollbar-width: thin;
    scrollbar-color: #c9d9f4 transparent;
}


/* =========================================================
   MESSAGE ROW
   ========================================================= */

.gallite-message {
    display: flex;

    width: 100%;

    margin-bottom: 12px;
}

.gallite-message:last-child {
    margin-bottom: 0;
}


/* =========================================================
   BOT MESSAGE
   ========================================================= */

.gallite-message.bot {
    justify-content: flex-start;
}

.gallite-message.bot .gallite-message-content {
    max-width: 88%;

    padding: 12px 14px;

    border: 1px solid var(--gallite-border);

    border-radius:
        4px 16px 16px 16px;

    background: var(--gallite-white);

    color: var(--gallite-text);

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.035);
}


/* =========================================================
   USER MESSAGE
   ========================================================= */

.gallite-message.user {
    justify-content: flex-end;
}

.gallite-message.user .gallite-message-content {
    max-width: 84%;

    padding: 11px 14px;

    border-radius:
        16px 4px 16px 16px;

    background: var(--gallite-blue);

    color: var(--gallite-white);
}


/* =========================================================
   MESSAGE TEXT
   ========================================================= */

.gallite-message-content {
    font-family: "Inter", sans-serif;

    font-size: 13px;

    line-height: 1.6;

    word-break: break-word;
}

.gallite-message-content p {
    margin: 0 0 7px;
}

.gallite-message-content p:last-child {
    margin-bottom: 0;
}

.gallite-message-content strong {
    font-weight: 700;
}


/* =========================================================
   QUICK REPLIES
   ========================================================= */

.gallite-quick-replies {
    display: flex;

    flex-wrap: wrap;

    gap: 7px;

    padding: 11px 15px 12px;

    background: #fbfdff;

    border-top: 1px solid #edf2f8;
}

.gallite-quick-reply {
    min-height: 34px;

    padding: 7px 12px;

    border: 1px solid var(--gallite-border-blue);

    border-radius: 999px;

    background: var(--gallite-blue-soft);

    color: var(--gallite-blue);

    font-family: "Inter", sans-serif;

    font-size: 11.5px;
    font-weight: 600;

    line-height: 1.2;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.gallite-quick-reply:hover {
    background: var(--gallite-blue);

    border-color: var(--gallite-blue);

    color: var(--gallite-white);

    transform: translateY(-1px);
}

.gallite-quick-reply:active {
    transform: scale(0.97);
}


/* =========================================================
   INPUT AREA
   ========================================================= */

.gallite-chat-input-area {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    gap: 8px;

    padding: 10px 12px;

    background: var(--gallite-white);

    border-top: 1px solid var(--gallite-border);
}


/* =========================================================
   INPUT
   ========================================================= */

#gallite-user-input {
    flex: 1 1 auto;

    min-width: 0;

    height: 44px;

    padding: 0 13px;

    border: 1px solid #cbd9ed;

    border-radius: 12px;

    outline: none;

    background: var(--gallite-white);

    color: var(--gallite-text);

    font-family: "Inter", sans-serif;

    font-size: 12.5px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

#gallite-user-input::placeholder {
    color: #9aa7b7;
}

#gallite-user-input:focus {
    border-color: var(--gallite-blue);

    box-shadow:
        0 0 0 3px rgba(20, 100, 244, 0.10);
}


/* =========================================================
   SEND BUTTON
   ========================================================= */

#gallite-send-btn {
    width: 44px;
    height: 44px;

    flex: 0 0 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 12px;

    background: var(--gallite-blue);

    color: var(--gallite-white);

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

#gallite-send-btn:hover {
    background: var(--gallite-blue-dark);

    transform: translateY(-1px);
}

#gallite-send-btn:active {
    transform: scale(0.94);
}

#gallite-send-btn i,
#gallite-send-btn svg {
    font-size: 17px;
}


/* =========================================================
   TYPING INDICATOR
   ========================================================= */

.gallite-typing {
    display: flex;
    align-items: center;
    gap: 4px;

    width: fit-content;

    padding: 11px 14px;

    border: 1px solid var(--gallite-border);

    border-radius:
        4px 16px 16px 16px;

    background: var(--gallite-white);
}

.gallite-typing span {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--gallite-blue);

    animation:
        galliteTyping 1.2s infinite ease-in-out;
}

.gallite-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.gallite-typing span:nth-child(3) {
    animation-delay: 0.30s;
}

@keyframes galliteTyping {

    0%,
    60%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-3px);
    }
}


/* =========================================================
   ERROR MESSAGE
   ========================================================= */

.gallite-message.error .gallite-message-content {
    border-color: #ffd7d7;

    background: #fff7f7;

    color: #b42318;
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1100px) {

    #gallite-chat-window {
        right: 24px;
        bottom: 140px;

        width: 370px;

        height: min(460px, calc(100vh - 180px));

        min-height: 360px;
        max-height: 460px;
    }

    #gallite-chat-toggle {
        right: 24px;
        bottom: 80px;

        width: 60px;
        height: 60px;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    #gallite-chat-window {
        right: 16px;
        bottom: 135px;

        width: calc(100vw - 32px);

        height: min(440px, calc(100vh - 180px));

        min-height: 350px;
        max-height: 440px;

        border-radius: 17px;
    }

    #gallite-chat-toggle {
        right: 16px;
        bottom: 75px;

        width: 58px;
        height: 58px;
    }

    .gallite-chat-header {
        min-height: 64px;

        padding: 10px 13px;
    }

    .gallite-chat-avatar {
        width: 38px;
        height: 38px;

        flex-basis: 38px;
    }

    .gallite-bot-name {
        font-size: 14px;
    }

    .gallite-bot-status {
        font-size: 10.5px;
    }

    #gallite-messages {
        padding: 13px 12px 10px;
    }

    .gallite-quick-replies {
        gap: 5px;

        padding:
            8px 11px 9px;
    }

    .gallite-quick-reply {
        min-height: 31px;

        padding:
            6px 9px;

        font-size: 10.5px;
    }

    .gallite-chat-input-area {
        padding: 8px 10px;
    }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    #gallite-chat-window {
        right: 10px;
        bottom: 125px;

        width: calc(100vw - 20px);

        height: min(420px, calc(100vh - 165px));

        min-height: 340px;
        max-height: 420px;

        border-radius: 16px;
    }

    #gallite-chat-toggle {
        right: 12px;
        bottom: 68px;

        width: 56px;
        height: 56px;
    }

    .gallite-chat-header {
        min-height: 60px;

        padding:
            9px 11px;
    }

    .gallite-chat-avatar {
        width: 36px;
        height: 36px;

        flex-basis: 36px;
    }

    .gallite-bot-name {
        font-size: 13.5px;
    }

    .gallite-bot-status {
        font-size: 10px;
    }

    #gallite-messages {
        padding:
            12px 10px 9px;
    }

    .gallite-message {
        margin-bottom: 9px;
    }

    .gallite-message-content {
        font-size: 12px;
        line-height: 1.5;
    }

    .gallite-message.bot .gallite-message-content {
        max-width: 94%;

        padding:
            9px 11px;
    }

    .gallite-message.user .gallite-message-content {
        max-width: 90%;

        padding:
            9px 11px;
    }

    .gallite-quick-replies {
        max-height: 90px;

        gap: 5px;

        padding:
            7px 10px 8px;

        overflow-y: auto;
    }

    .gallite-quick-reply {
        min-height: 29px;

        padding:
            5px 8px;

        font-size: 10px;
    }

    #gallite-user-input {
        height: 40px;

        font-size: 11.5px;
    }

    #gallite-send-btn {
        width: 40px;
        height: 40px;

        flex-basis: 40px;
    }
}


/* =========================================================
   VERY SMALL DEVICES
   ========================================================= */

@media (max-width: 360px) {

    #gallite-chat-window {
        right: 7px;
        bottom: 120px;

        width: calc(100vw - 14px);

        height: min(390px, calc(100vh - 150px));

        min-height: 320px;
        max-height: 390px;

        border-radius: 15px;
    }

    #gallite-chat-toggle {
        right: 9px;
        bottom: 60px;

        width: 52px;
        height: 52px;
    }

    .gallite-chat-header {
        min-height: 56px;

        padding:
            8px 10px;
    }

    .gallite-chat-avatar {
        width: 34px;
        height: 34px;

        flex-basis: 34px;
    }

    .gallite-chat-avatar i {
        font-size: 16px;
    }

    .gallite-bot-name {
        font-size: 13px;
    }

    .gallite-bot-status {
        font-size: 9.5px;
    }

    #gallite-messages {
        padding:
            10px 9px 8px;
    }

    .gallite-message-content {
        font-size: 11.5px;
    }

    .gallite-quick-replies {
        max-height: 78px;

        padding:
            6px 8px;
    }

    .gallite-quick-reply {
        min-height: 27px;

        padding:
            5px 7px;

        font-size: 9.5px;
    }

    .gallite-chat-input-area {
        padding:
            7px 8px;
    }

    #gallite-user-input {
        height: 38px;
    }

    #gallite-send-btn {
        width: 38px;
        height: 38px;

        flex-basis: 38px;
    }
}