/* ════════════════════════════════════════════════════════════════
   chat.css — ChatStream iframe
   ════════════════════════════════════════════════════════════════ */

/* ── Root sizing ─────────────────────────────────────────────── */
html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* ── Outer container: fills iframe ──────────────────────────── */
.wc-chat-outer {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: #fff;
}


/* ════════════════════════════════════════════════════════════════
   SCROLLABLE MESSAGE AREA
   ════════════════════════════════════════════════════════════════ */
.wc-message-groups,
#wc-message-groups {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 24px;
    gap: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior: contain;
}

    .wc-message-groups::-webkit-scrollbar,
    #wc-message-groups::-webkit-scrollbar {
        display: none;
    }

.wc-message-group-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    justify-content: flex-end;
}


/* ════════════════════════════════════════════════════════════════
   SPLASH SCREEN  (heading only — chips in inputs section)
   ════════════════════════════════════════════════════════════════ */
#SupportBot-splash {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 8px;
    margin: 0;
}

.splash-title {
    font-family: Merriweather, Georgia, serif;
    font-size: 25px;
    font-weight: 400;
    line-height: 1.35;
    color: var(--bs-grey-alpha, #222121);
    margin: 0 0 12px;
    text-align: center;
}

.splash-subtitle {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.2px;
    color: var(--bs-grey-beta, #646468);
    margin: 0;
    text-align: center;
}

    .splash-subtitle a {
        color: inherit;
        text-decoration: underline;
        font-weight: 600;
    }


/* ════════════════════════════════════════════════════════════════
   INPUTS SECTION
   Contains: Prompt Slot (chips) + Chat Text Input
   ════════════════════════════════════════════════════════════════ */
.chat-inputs {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 16px 24px;
    gap: 24px;
    flex-shrink: 0;
    border-radius: 0 0 var(--bs-border-radius-lg) var(--bs-border-radius-lg);
    background: #fff;
}

/* ── Prompt Slot: vertical column of chips ─── */
.prompt-slot {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

/* ── Suggestion chip / Bubble  ───── */
.suggestion-chip {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 8px 16px;
    gap: 8px;
    width: 100%;
    background: #fff;
    border: 1px solid var(--bs-blue-beta, #005DE8);
    border-radius: 0 16px 16px 16px;
    font-family: var(--bs-font-sans-serif, 'Open Sans', sans-serif);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.7;
    letter-spacing: 0.1px;
    color: var(--bs-blue-beta, #005DE8);
    cursor: pointer;
    text-align: left;
    transition: background .15s;
}

    .suggestion-chip:hover {
        background: var(--bs-blue-delta, #e2effd);
    }

/* ── Chat Text Input ─── */
.chat-input-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 12px 12px 12px 16px;
    gap: 12px;
    width: 100%;
    height: auto;
    min-height: 56px;
    background: #fff;
    border: 1px solid var(--bs-grey-alpha, #222121);
    border-radius: var(--bs-border-radius, 8px);
    box-sizing: border-box;
    transition: border-color .15s;
}

    .chat-input-row:focus-within {
        border-color: var(--bs-blue-beta);
        box-shadow: 0 0 0 4px rgba(0, 93, 232, 0.25);
    }

/* ── Textarea ─────── */
.chat-textarea {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--bs-font-sans-serif, 'Open Sans', sans-serif);
    font-size: 16px;
    font-weight: 400;
    color: var(--bs-grey-alpha, #222121);
    resize: none;
    line-height: 1.7;
    letter-spacing: 0.1px;
    padding: 0;
    align-self: center;
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

    .chat-textarea::-webkit-scrollbar {
        display: none;
    }

    .chat-textarea::placeholder {
        color: var(--bs-grey-beta, #646468);
    }

/* ── Send button ─────── */
.chat-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    width: 66px;
    height: 32px;
    background: var(--bs-purple-beta, #240F6E);
    border: none;
    border-radius: 1000px;
    cursor: pointer;
    font-family: var(--bs-font-sans-serif, 'Open Sans', sans-serif);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .15s;
}

    .chat-send-btn:hover {
        background: var(--bs-purple-alpha, #110343);
    }


/* ════════════════════════════════════════════════════════════════
   MESSAGE BUBBLES
   ════════════════════════════════════════════════════════════════ */
.wc-message-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
}

/* Hide SVG callout arrows (render as black shapes without this) */
.wc-message-callout {
    display: none !important;
}

/* ── Bot row: left-aligned ───────────────────────────────────── */
.wc-message-from-bot {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

    .wc-message-from-bot .wc-message-content {
        order: 2;
        max-width: 100%;
        flex: 1;
        min-width: 0;
        border-radius: 0 16px 16px 16px !important;
        padding: 8px 16px !important;
        font-family: var(--bs-font-sans-serif, 'Open Sans', sans-serif) !important;
        font-size: 14px !important;
        font-weight: 400 !important;
        line-height: 1.7 !important;
        letter-spacing: 0.1px !important;
        color: var(--bs-grey-alpha, #222121) !important;
    }

    /* Cancel inherited backgrounds from wc-* library CSS */
    .wc-message-from-bot .ac-container {
        background-color: transparent !important;
        padding: 0 !important;
    }

    .wc-message-from-bot .wc-card,
    .wc-message-from-bot .wc-adaptive-card {
        background: transparent !important;
        box-shadow: none !important;
        margin: 0 !important;
        border-radius: 0 !important;
        max-width: 100% !important;
    }

    .wc-message-from-bot #aiResponseText {
        font-family: var(--bs-font-sans-serif, 'Open Sans', sans-serif) !important;
        font-size: 14px !important;
        line-height: 1.7 !important;
        color: var(--bs-grey-alpha, #222121) !important;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    /* Links inside bot messages */
    .wc-message-from-bot a {
        color: var(--bs-blue-beta, #1a56db);
        text-decoration: underline;
    }

        .wc-message-from-bot a[href]::after {
            content: ' \e89e';
            font-family: 'Material Symbols Rounded';
            font-size: 0.85em;
            vertical-align: middle;
        }

/* ── User row: right-aligned blue bubble ─────────────────────── */
.wc-message-from-me {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}

    .wc-message-from-me .wc-message-content {
        background: var(--bs-blue-delta, #E2EFFD) !important;
        border-radius: 16px 0 16px 16px !important;
        padding: 8px 16px !important;
        max-width: 80%;
        font-size: 14px;
        line-height: 1.7;
        letter-spacing: 0.1px;
        color: var(--bs-grey-alpha, #222121);
        word-break: break-word;
        overflow-wrap: break-word;
    }

/* Hide label rows injected by chat-widget */
.wc-message-from.wc-message-from-bot,
.wc-message-from.wc-message-from-me {
    display: none !important;
}


/* ════════════════════════════════════════════════════════════════
   FEEDBACK ROW  (copy / thumbs up / thumbs down)
   ════════════════════════════════════════════════════════════════ */
#ResponseFooter {
    display: flex !important;
    align-items: center;
    gap: 4px;
    margin: 4px 0 !important;
    opacity: 0; 
    transition: opacity .2s;
}

.wc-message-wrapper {
    position: relative;
}

    .wc-message-wrapper:hover #ResponseFooter {
        opacity: 1; 
    }

.response-footer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    padding: 5px;
    transition: background .15s;
}

    .response-footer-btn:hover {
        background: var(--bs-grey-iota, #F4F5F7);
    }

    .response-footer-btn img {
        object-fit: contain;
        opacity: .65;
        transition: opacity .15s;
        background-color: transparent;
    }

    .response-footer-btn:hover img {
        opacity: 1;
    }

/* ════════════════════════════════════════════════════════════════
   TYPING INDICATOR
   ════════════════════════════════════════════════════════════════ */
.wc-typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 0;
    min-height: 24px;
}

    .wc-typing span {
        display: inline-block;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--bs-purple-beta, #240f6e);
        animation: wcBounce 1.2s infinite ease-in-out;
        flex-shrink: 0;
    }

        .wc-typing span:nth-child(2) {
            animation-delay: .2s;
        }

        .wc-typing span:nth-child(3) {
            animation-delay: .4s;
        }

@keyframes wcBounce {
    0%,80%,100% {
        transform: scale(.6);
        opacity: .35;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}


/* ════════════════════════════════════════════════════════════════
   TABLES
   ════════════════════════════════════════════════════════════════ */
.table {
    border-collapse: collapse;
    font-family: var(--bs-font-sans-serif, 'Open Sans', sans-serif);
    border-color: #909090;
    margin: 15px 0;
    width: 100%;
}

    .table thead {
        background-color: var(--bs-purple-beta, #240F6E);
        color: #ffffff;
    }

    .table th, .table td {
        padding: 10px;
        text-align: center;
    }

    .table td {
        border: 1px solid #ddd;
    }

    .table th {
        border-top: none;
    }

    .table tbody tr:nth-child(even) {
        background-color: #f9f9f9;
    }

    .table tbody tr:hover {
        background-color: #f1f1f1;
    }

    .table thead th {
        border-bottom: 2px solid #ddd;
    }

    .table thead tr th strong {
        color: #ffffff;
    }

.table-responsive-container {
    width: 100%;
    max-width: 100%;
    margin: 1rem 0;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

    .table-responsive table th,
    .table-responsive table td {
        white-space: wrap;
    }


/* ════════════════════════════════════════════════════════════════
   CODE BLOCKS
   ════════════════════════════════════════════════════════════════ */
.code-block-container {
    position: relative;
    background-color: #0d0d0d;
    margin: 10px 0;
    padding-bottom: 10px;
    border-radius: 8px;
    overflow: auto;
    width: 100%;
    box-sizing: border-box;
}

.code-block-header {
    background-color: #333;
    color: #ffffff;
    font-size: 0.85rem;
    padding: 8px;
    border-radius: 4px 4px 0 0;
    margin-bottom: 4px;
}

pre {
    margin: 0;
    max-width: 100%;
    box-sizing: border-box;
}

    pre code.hljs {
        background-color: #0d0d0d;
    }

.code-block-container pre {
    margin: 0;
    padding-right: 30px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.code-copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    cursor: pointer;
    color: #fff;
    font-size: 18px !important;
    transition: color .2s;
}

    .code-copy-button:hover {
        color: var(--bs-blue-beta, #005DE8);
    }


/* ════════════════════════════════════════════════════════════════
   MISC
   ════════════════════════════════════════════════════════════════ */

.fullscreen-chat {
    position: fixed !important;
    inset: 0;
    z-index: 9999;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
    background: white;
    display: flex;
    flex-direction: column;
}

.chat-tray {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100%;
    background: #fff;
    border-right: 1px solid var(--bs-grey-delta, #ddd);
    box-shadow: 2px 0 5px rgba(0,0,0,.1);
    transform: translateX(-100%);
    transition: transform .3s ease-in-out;
    z-index: 10000;
    padding: 1rem;
    overflow-y: auto;
}

    .chat-tray.visible {
        transform: translateX(0);
    }

/* Equation scroll */
.equation-scroll {
    overflow-x: auto;
    max-width: 100%;
}

.visually-hidden {
    display: none;
}

.ac-container h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 1em 0 .5em;
    color: #1e1e1e;
}

.ac-container p {
    margin: .5em 0 1em;
}

.ac-container ul {
    padding-left: 1.5em;
    margin: .5em 0 1em;
}

.ac-container li {
    margin-bottom: .5em;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 480px) {
    .splash-title {
        font-size: 1.3rem;
    }
}
