﻿.dropup .dropdown-menu.dropdown-menu-right:before {
    left: auto;
    right: 9px; /* adjust this to match button padding */
}

.dropup .dropdown-menu.dropdown-menu-right:after {
    left: auto;
    right: 10px; /* small offset for the white arrow */
}

.dropdown-menu-right {
    right: 0;
    left: auto;
}

.source-grid-header {
    background-color: #006eb9;
    color: white;
    font-size: 14px;
    padding-left: 8px;
    padding-top: 8px;
    height: 40px;
}

/* Normal weight */
@font-face {
    font-family: 'MyCustomAvenirBlack';
    src: url("/fonts/Avenir-Black.woff2") format('woff2'), url("/fonts/Avenir-Black.woff") format('woff');
    font-weight: 300;
    font-style: normal;
}

/* Bold weight */
@font-face {
    font-family: 'MyCustomAvenirBlack';
    src: url("/fonts/Avenir-Black.woff2") format('woff2'), url("/fonts/Avenir-Black.woff") format('woff');
    font-weight: 700;
    font-style: normal;
}
/* Normal weight */
@font-face {
    font-family: 'MyCustomAvenirRoman';
    src: url("/fonts/Avenir-Roman.woff2") format('woff2'), url("/fonts/Avenir-Roman.woff") format('woff');
    font-weight: 300;
    font-style: normal;
}

/* Bold weight */
@font-face {
    font-family: 'MyCustomAvenirRoman';
    src: url("/fonts/Avenir-Roman.woff2") format('woff2'), url("/fonts/Avenir-Roman.woff") format('woff');
    font-weight: 700;
    font-style: normal;
}

.feedback-thank-msg {
    display: block; /* makes it act like div */
    border: 1px solid #ced4da; /* Bootstrap-like border */
    border-radius: 8px;
    padding: .375rem .75rem;
    background-color: #fff;
}

#releaseFooter {
    position: fixed !important;
    bottom: 2px;
    right: 10px;
    font-size: 12px;
    color: gray;
    background: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 2147483647 !important;
}

.release-date {
    position: fixed; /* fixed to viewport */
    bottom: 5px; /* distance from page bottom */
    right: 10px; /* distance from page right */
    font-size: 12px;
    color: gray;
    background: #fff; /* so it’s readable */
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    z-index: 2147483647 !important; /* stays above other content */
}


.popover {
    max-width: 600px;
    font-size: 13px;
    text-wrap:auto;
    /*white-space: nowrap !important; /* Prevent text from wrapping */
    /*max-width: none !important; /* Allow unlimited width */
    width: auto !important;
}

.popover-title {
    font-weight: bold;
    background-color: #ec008c; /* or a hex code like #ff69b4 */
    color: #fff; /* keep text white for contrast */
    display: flex; /* Make it a flex container */
    justify-content: space-between; /* Title left, button right */
    align-items: center; /* Vertically center */
    white-space: nowrap; /* Prevent wrapping */
}

:root {
    --user-bubble: #0b93f6;
    --ai-bubble: #e5e5ea;
    --bubble-radius: 18px;
}

body {
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    background: #ffffff;
    color: #333;
}

.main-chat-layout {
    display: flex;
    height: calc(100vh - 140px);
    padding: 20px 20px;
    gap: 15px;
    position: relative;
}

.chat-container {
    flex: 2;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #ddd;
    padding-right: 10px;
    overflow-y: auto;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.message {
    margin: 6px 0;
    padding: 12px 16px;
    border-radius: var(--bubble-radius);
    max-width: 75%;
    line-height: 1.4;
}

.user {
    align-self: flex-end;
    /*background-color: var(--user-bubble);*/
    background-color: #006eb9;
    color: white;
    border-bottom-right-radius: 2px;
}

.ai {
    align-self: flex-start;
    background-color: var(--ai-bubble);
    color: black;
    border-bottom-left-radius: 2px;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 10px;
}

textarea, input[type="text"], select {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    font-size: 14px;
    max-width: 700px;
    border-radius: 4px;
}

input[type="submit"], #btnFeedback, #btnNewChat, #btnLogTicket, #btnShare {
    padding: 10px 20px;
    cursor: pointer;
    color: white;
    border: none;
    border-radius: 4px;
}

input[type="submit"] {
    background-color: #10a37f;
}

    input[type="submit"]:hover {
        background-color: #0d8e6a;
    }

#btnFeedback, #btnNewChat, #btnLogTicket, #btnShare {
    background-color: #4673c2;
}

.source-panel {
    flex: 1;
    background: #f9f9f9;
    border: 1px solid #ccc;
    padding: 10px;
    overflow-y: auto;
    display: none;
    border-radius: 8px;
}

.feedback-panel {
    flex: 1;
    background: #f9f9f9;
    border-left: 1px solid #ccc;
    padding: 10px;
    overflow-y: auto;
    border-radius: 8px;
    margin-top: 10px;
}

.source-panel h4 {
    margin: 5px;
}

table {
    background-color: white;
}

#toggleSourcesBtn {
    display: none;
}

.history-wrapper {
    width: 250px;
    background-color: #f9f9f9;
    border-right: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    position: relative;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    font-size: 14px;
    font-weight: bold;
    background-color: #006eb9;
    color: white;
    height: 40px;
}

.history-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Collapsed state */
.history-wrapper.collapsed {
    display: none !important;
}

.expand-history-btn {
    display: none;
    position: absolute;
    top: 8px;
    left: 5px;
    background: #e3e3e3;
    border: 1px solid #ccc;
    padding: 5px 8px;
    font-size: 16px;
    cursor: pointer;
    z-index: 1000;
}

.history-wrapper.collapsed .history-header span,
.history-wrapper.collapsed .history-content {
    display: none;
}

.history-wrapper.expanded {
    display: flex; /* instead of block */
    flex-direction: column;
}

.toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: white;
    font-weight: bolder;
}

.history-wrapper.collapsed {
    overflow: hidden;
}

.history-panel {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 140px); /* adjust based on header/footer size */
    padding: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    border: 1px solid #ccc;
}

.response-time {
    font-size: 11px;
    background-color: white;
}

.row.align-items-center {
    display: flex;
    align-items: center; /* vertically centers logo + text */
}

.container-fluid {
    padding-left: 0;
    padding-right: 0;
}

html, body {
    height: 100%; /* take full viewport height */
    margin: 0;
    padding:0;
    overflow: hidden; /* already there */
}

.container-fluid.d-flex.flex-column {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.btn-rounded {
    border-radius: 20px;
    padding: 5px 15px;
}

.btn-pinkwhite {
    background-color: #ec008c;
    color: #fff;
}

.btn-rounded:hover {
    background-color: #ffa4da; /* Darker pink */
    color: #fff; /* Keep text white */
}

#feedbackPanel {
    margin-top: 20px;
    transition: all 0.3s ease-in-out;
    z-index: 1500;
}

    #feedbackPanel textarea {
        border-radius: 8px;
    }


.show-source-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0; /* keep it tight */
    padding: 0; /* remove padding */
}

    .show-source-wrapper input[type="checkbox"] {
        margin: 0; /* remove default spacing */
    }

    .show-source-wrapper label {
        margin: 0;
        font-size: 14px;
    }

.chat-history:empty {
    display: none !important;
}

.logo-section {
    display: flex;
    align-items: center; /* vertically center */
    gap: 15px; /* space between logo + text */
}

.header-bar {
    height: 15vh;
    max-height: 170px;
    background-size: cover;
    background-repeat: no-repeat;
    padding: 0 20px;
    position: relative;
}

.header-row {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo + Title */
.header-logo {
    max-height: 90px; /* smaller so text lines up */
    flex-shrink: 0; /* prevent shrinking oddly */
}

.header-title {
    display: flex;
    flex-direction: column;
    justify-content: center; /* center text vertically with logo */
    color: white;
    line-height: 1.2;
}

    .header-title .title-main {
        font-family: MyCustomAvenirBlack;
        font-weight: 700;
        font-size: 42px;
    }

    .header-title .title-sub {
        font-family: MyCustomAvenirRoman;
        font-weight: 300;
        font-size: 26px;
    }

/* Desktop menu */
.desktop-menu {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
}

.welcome-text {
    font-size: 14px;
    color: black;
}

/* Mobile hamburger hidden by default on desktop */
.mobile-menu-btn {
    display: none;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    background: #fff;
    position: absolute;
    top: 100%; /* directly below header */
    right: 20px; /* align under hamburger button */
    width: auto; /* shrink to content instead of 100% */
    min-width: 160px; /* keep a decent min width */
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 1000;
}

    .mobile-menu.active {
        display: flex;
    }

    .mobile-menu .menu-item {
        padding: 10px 16px;
        font-size: 14px;
        color: #333;
        text-decoration: none;
        background: #fff;
        border-bottom: 1px solid #eee;
    }

        .mobile-menu .menu-item:last-child {
            border-bottom: none;
        }

        .mobile-menu .menu-item:hover {
            background: #f5f5f5;
        }

@media (max-width: 768px) {
    #toggleSourcesBtn {
        display: block;
        margin: 6px 0;
        padding: 8px 12px;
        background: #006eb9;
        color: #fff;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        font-size: 14px;
    }

    /* Sources hidden by default on mobile */
    #sourcePanel {
        display: none!important;
        max-height: 30vh; /* don’t hog screen */
        overflow-y: auto;
        border: 1px solid #ccc;
        border-radius: 6px;
        margin-top: 6px;
        background: #fff;
    }

        /* When active, show */
        #sourcePanel.active {
            display: block!important;
        }

    #chatArea:empty {
        min-height: 0 !important;
        height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    #chatArea {
        flex: 0 0 auto; /* don’t take all space */
        max-height: 100%;
        overflow-y: auto;
    }

        #chatArea:not(:empty) {
            min-height: 100px; /* or any default size */
        }

    .main-chat-layout {
        flex-direction: column;
    }

    .chat-container, .source-panel, .source-wrapper {
        flex: none;
        width: 100%;
    }


    html, body {
        overflow-y: auto !important; /* re-enable vertical scroll */
    }

    .source-wrapper {
        max-width: 100% !important;
        position: relative;
        max-height: 30vh;
        -webkit-overflow-scrolling: touch; /* smooth scroll iOS */
    }

    .source-panel {
        max-height: inherit; /* adjust to how much space you want */
        overflow-y: auto !important; /* ensure vertical scrollbar */
        -webkit-overflow-scrolling: touch; /* smooth scroll iOS */
    }

        .source-panel table {
            display: block; /* let table respect scroll */
            overflow-x: auto; /* in case of wide columns */
            width: 100%;
        }


    .history-wrapper {
        display: none;
        flex: 0 0 auto;
        max-height: 250px;
        height: auto; /* shrink to content */
        overflow-y: auto;
        border-bottom: 1px solid #ddd;
        background: #fff;
        z-index: 5;
    }

    .popover {
        white-space: normal !important;
        max-width: 90% !important; /* keep it inside screen */
        width: auto !important;
        word-break: break-word;
    }

    .expand-history-btn {
        display: block; /* no !important */
    }

    .hide-btn {
        display: none !important;
    }

    .main-chat-layout {
        flex-direction: column;
    }
    /* Show expand button */
    .expand-history-btn {
        display: block !important;
    }
    /* Hide history by default */
    .history-wrapper {
        display: none;
        flex: 0 0 auto; /* allow it to shrink/grow */
        max-height: 250px; /* limit height on mobile */
        overflow-y: auto;
        border-bottom: 1px solid #ddd;
        background: #fff;
        z-index: 5;
    }
    /* Sources also stack below chat */
    .source-panel {
        display: none; /* hidden until toggled */
        width: 100%;
        max-height: 40vh;
        margin-top: 10px;
    }

    .chat-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        height: 70vh;
    }

    .message {
        max-width: 90%;
    }
    /* wider bubbles */
    .messages {
        padding: 8px;
    }

    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
        /* Make selects full-width */
        .form-row select,
        .form-row textarea,
        .form-row input[type="text"] {
            width: 100% !important;
            max-width: 100% !important;
        }
    /* Buttons full-width and stacked */
    #btnSend,
    #btnNewChat,
    #btnLogTicket,
    #btnShare,
    #btnFeedback {
        display: inline-block;
        width: auto; /* let buttons shrink */
        margin: 4px; /* spacing */
        border-radius: 4px;
    }
    /* Checkbox + label inline */
    .form-row input[type="checkbox"] {
        margin-right: 6px;
    }

    .divShowSource {
        display: inline-block;
        margin-bottom: 8px;
    }
    /* Help icon aligned right on mobile */
    #infoIcon {
        align-self: flex-end;
        margin-top: 6px;
    }

    .desktop-menu {
        display: none !important;
    }

    .mobile-menu-btn {
        display: block !important;
    }

    .header-title .title-main {
        font-size: 26px;
    }

    .header-title .title-sub {
        font-size: 16px;
    }

    .header-logo {
        max-height: 60px; /* smaller so text lines up */
        flex-shrink: 0; /* prevent shrinking oddly */
    }

    .main-chat-layout {
        height: calc(100vh - 200px);
    }
}
