/*!
 * Udyam Mitra — interactive option rows, notes and pager.
 * Layers on top of assets/css/chatbot.css; reuses the same tokens.
 */

.chat_bot_ui .um_options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 2px 0 6px 35px;
    animation: um_options_in .28s ease both;
}

@keyframes um_options_in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.chat_bot_ui .um_option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    padding: 9px 11px;
    background: var(--white, #fff);
    border: 1px solid rgba(var(--primaryRGB, 11, 78, 61), .22);
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12.5px;
    line-height: 1.45;
    font-weight: 500;
    color: var(--text, #1d2b27);
    text-align: left;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.chat_bot_ui .um_option:hover,
.chat_bot_ui .um_option:focus-visible {
    background: rgba(var(--primaryRGB, 11, 78, 61), .07);
    border-color: rgba(var(--primaryRGB, 11, 78, 61), .5);
    outline: none;
}

.chat_bot_ui .um_option:active {
    transform: scale(.985);
}

.chat_bot_ui .um_option_no {
    flex: 0 0 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(var(--primaryRGB, 11, 78, 61), .1);
    color: var(--theme-2, #0b5d3b);
    font-size: 10.5px;
    font-weight: 700;
}

.chat_bot_ui .um_option_label {
    flex: 1 1 auto;
    word-break: break-word;
}

/* A row that leaves the chat for a portal page. */
.chat_bot_ui .um_option.is_link {
    border-style: dashed;
}

.chat_bot_ui .um_option.is_link .um_option_label::after {
    content: ' ↗';
    color: var(--theme-2, #0b5d3b);
    font-weight: 700;
}

.chat_bot_ui .um_option.um_more {
    justify-content: center;
    background: rgba(var(--primaryRGB, 11, 78, 61), .06);
    border-style: dashed;
    font-weight: 600;
    color: var(--theme-2, #0b5d3b);
}

/* Paging rows read as direction: '↑' goes back up the list, '↓' further down.
   Scoped to .um_page so one-off action rows (such as Try again) stay plain. */
.chat_bot_ui .um_option.um_page::before {
    content: '↓';
    margin-right: 6px;
    font-weight: 700;
}

.chat_bot_ui .um_option.um_page.um_prev::before {
    content: '↑';
}

.chat_bot_ui .um_note {
    margin: 0 0 6px 35px;
    padding: 6px 10px;
    border-left: 3px solid var(--theme, #f4c542);
    background: rgba(244, 197, 66, .12);
    border-radius: 0 8px 8px 0;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--text, #1d2b27);
}

.chat_bot_ui .msg_bubble a {
    color: inherit;
    text-decoration: underline;
    word-break: break-all;
}

.chat_bot_ui .chat_suggestions.is-hidden {
    display: none;
}

/* ---------------------------------------------------------------------------
   Quick replies — the bar above the input.

   The base styles stack .sugg_scroll vertically inside a 130px scroller, which
   suited the old list of long suggested questions. For short quick-reply chips
   that costs ~148px of conversation height, so these override it into a single
   horizontal strip that scrolls sideways. Selectors match the compiled
   specificity in assets/scss/main.css and this file is linked after it.
   ------------------------------------------------------------------------ */

.chat_bot_ui .chat_window .chat_suggestions {
    padding: 8px 12px;
}

.chat_bot_ui .chat_window .chat_suggestions .sugg_label {
    margin-bottom: 5px;
}

.chat_bot_ui .chat_window .chat_suggestions .sugg_scroll {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    margin-right: 0;
    padding-right: 0;
    padding-bottom: 3px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.chat_bot_ui .chat_window .chat_suggestions .sugg_scroll::-webkit-scrollbar {
    width: auto;
    height: 3px;
}

.chat_bot_ui .chat_window .chat_suggestions .sugg_btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 6px 12px;
}

/* ---------------------------------------------------------------------------
   Header actions — 'start a new chat' sits beside the close button and reuses
   its .btn_close_chat styling, so it stays in step with the header design.
   ------------------------------------------------------------------------ */

.chat_bot_ui .chat_window .chat_header .header_actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    position: relative;   /* above the header's decorative ::after circle */
    z-index: 1;
}

.chat_bot_ui .chat_window .chat_header .btn_new_chat svg {
    width: 15px;
    height: 15px;
    stroke-width: 1.9;
    stroke-linejoin: round;
}

/* ---------------------------------------------------------------------------
   Window height.

   min-height beats max-height in CSS, so the base `min-height: 500px` wins over
   `max-height: calc(100vh - 200px)` on a short viewport and pushes the window off
   screen. Clamp it, and prefer dvh so mobile browser chrome is accounted for.
   ------------------------------------------------------------------------ */

.chat_bot_ui .chat_window {
    min-height: min(500px, calc(100vh - 140px));
    min-height: min(500px, calc(100dvh - 140px));
}

/* 480px matches the breakpoint the base chatbot styles switch to full-width at. */
@media (max-width: 480px) {
    .chat_bot_ui .chat_window {
        min-height: min(500px, 88vh);
        min-height: min(500px, 88dvh);
    }

    /* The floating button otherwise sits on top of the full-width window's
       footer. The header already carries a close button. */
    .chat_bot_ui .chat_toggle_btn.active {
        display: none;
    }
}

@media (max-width: 480px) {
    .chat_bot_ui .um_options,
    .chat_bot_ui .um_note {
        margin-left: 0;
    }
}
