:root {
    --bkg-color-code: #ffff5b1a;
    --focus-shadow: 0 0 0 2px #159ce466;
    --bs-font-sans-serif: Montserrat, Helvetica, "sans-serif";
    --bs-scrollbar--color: #e4e4e4;
    --bs-scrollbar-hover-color: #a4a4a4;
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* show spinner while busy */
html.busy .spinner-holder {
    display: flex !important;
}

/* show wait cursor while busy */
html.busy,
html.busy * {
    cursor: wait !important;
    pointer-events: none;
}

/* main-only hides everything but the main content space above main cards */
html.main-only body > *:not(main),
html.main-only body > div.flex-root:not(main),
html.main-only body .container .action-links,
html.main-only body .container.gpfy-form h1 {
    display: none !important;
}

/* main-only makes main background transparent */
html.main-only body main {
    background: transparent !important;
}

/* style used when showing the Access Denied view */
header.no-access {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* space above main cards (unless embedded) */
html:not(.main-only) .margin-top-big {
    margin-top: 20px;
}

/* no focus rect on divs (like reply) or selects */
div,
select {
    outline: none !important;
}

/* limit height of textareas */
textarea[readonly] {
    max-height: 15rem;
}

/* reduce border radii */
.form-control {
    border-radius: .1rem !important;
}

    /* edit code/JSON content */
    .form-control.code {
        font-family: monospace;
        color: black;
        /*font-size: 90%;*/
    }

    /* empty code text areas become short */
    textarea.form-control.code:placeholder-shown {
        height: calc(3.75rem + 2px) !important;
        overflow: hidden;
    }

/* show multi-select lists */
select[multiple].form-control
{
    height: auto;
    max-height: 30rem;
    padding-left: 0.5rem;
}

    select[multiple].form-control option {
        text-overflow: ellipsis;
        width: 100%;
        overflow: hidden;
        background-color: inherit;
        padding: .25rem .5rem;
    }

        select[multiple].form-control option::before {
            display: inline-block;
            width: 1.2rem;
            content: "\2610"; /* unchecked box ☐ */
        }

        select[multiple].form-control option:checked::before {
            content: "\2611"; /* checked box ☑ */
        }


/* do show focus rects on form controls */
.gpfy-form .form .form-control:focus {
    box-shadow: var(--focus-shadow);
}

/* show focused buttons */
.btn.btn-primary:focus {
    color: #fff !important;
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
    box-shadow: var(--focus-shadow);
}

/* buttons that look like links */
.btn.btn-link {
    color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
}

.btn-group {
    align-items: baseline;
}

/* microphone buttons */
button.microphone {
    padding: 0 1rem !important;
}


/* links to urls (DocUrl) */
.url-link {
    font-size: 1.5rem !important;
    margin-left: 2rem;
}

    .url-link i {
        font-size: inherit !important;
    }

    .url-link:hover i {
        color: inherit !important;
    }

/* solid icons use container color */
.fa.fa-solid {
    color: inherit !important;
}

/* sharing code */
.gpfy-share .code {
    font-family: monospace;
    white-space: pre;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--bkg-color-code);
}

pre {
    font-family: monospace !important;
    color: black !important;
    background: #f8f9fa;
    margin: 0.5rem;
    padding: 0.5rem;
}

    pre > code {
        width: 100%;
        padding: 1rem !important;
    }

/* sharing button icons */
.gpfy-share .fa-solid {
    font-size: 120%;
}

/* formatting the body */
body {
    margin-bottom: 60px;
    font-size: 1.1rem !important;
}

/* wider tooltips */
.tooltip-inner {
    max-width: 300px !important;
    text-align: left !important;
    font-size: 90%;
}

/* dialog and backdrop */
dialog {
    height: fit-content !important;
}

    dialog::backdrop {
        position: fixed;
        top: 0px;
        right: 0px;
        bottom: 0px;
        left: 0px;
        background: rgba(0, 0, 0, 0.25);
    }

/* adjust checkbox heights in form-floating groups */
.form-floating.form-control {
    height: 3.904rem;
}

    /* allow clicking labels in checkbox form-floating groups */
    .form-floating.form-control > input.form-control[type=checkbox] + label {
        pointer-events: auto;
        width: 100%;
        height: 100%;
    }

/* position tooltips within floating-groups */
.form-floating > .tooltip-helper {
    position: absolute;
    top: 0;
    right: 0.3rem;
}

    /* format tooltip indicators */
    .form-floating > .tooltip-helper * {
        opacity: 0.5;
        color: var(--bs-text-primary);
    }

/* add some spacing between floating input groups */
div.form-floating {
    margin-bottom: 12px;
}

/* look like labels, not text */
.form-floating > label {
    opacity: 0.65;
}

/* to better align labels in textarea elements */
.form-floating > textarea + label {
    left: unset !important;
    top: 2px !important;
}

/* show read-only fields as grey */
.form-floating > input[readonly] {
    /*color: var(--bs-gray-500);*/
    background-color: var(--bs-gray-100);
}

/* validation messages are blocks */
.form-floating > .field-validation-error {
    display: block;
}

/* toggle password visibility */
input.form-control.hidden-pwd {
    display: inline-block;
}

div.toggle-pwd {
    display: inline-block;
    margin-left: -30px;
    cursor: pointer;
}

/* adjust position of auto-complete drop-down icon */
input[list]::-webkit-calendar-picker-indicator {
    transform: translate(.5rem, -.2rem);
    line-height: 1rem;
}

/* loading spinner */
.spinner-holder {
    position: fixed;
    top: 0px;
    right: 0px;
    bottom: 0px;
    left: 0px;
    background-color: rgba(0, 0, 0, 0.1);
    display: none !important;
}

.spinner-border {
    width: 5rem;
    height: 5rem
}

/* show invalid inputs */
.form input:invalid,
.form textarea:invalid {
    background: var(--bkg-color-code);
}

/* don't change textarea sizes */
textarea.form-control {
    height: auto !important;
    resize: none;
}

/* show drop-downs in auto-complete and select elements */
input.form-control,
select.form-control {
    appearance: auto !important;
}

/* show checkboxes in forms */
input[type=checkbox].form-control {
    -moz-appearance: checkbox;
    appearance: checkbox;
    width: 1.1rem;
    outline: none;
    box-shadow: none;
    margin-top: -0.3rem;
}

/* remove spinners from numeric inputs */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] { /* Firefox */
    -moz-appearance: textfield;
}

/* validation errors */
.field-validation-error {
    font-size: 90%;
    font-weight: bold !important;
    color: #e63757 !important;
}

/* wrapping */
.ws-preline {
    white-space: pre-line;
}

/* DataTables */
table.data-table tbody tr {
    display: none; /* hide body until DataTable is ready */
}
table.dataTable .dt-type-numeric.dt-left { /* left-align strings that look like numbers */
    text-align: left
}
div.dt-container *.dt-input:focus {
    color: var(--bs-gray-700);
    background-color: var(--bs-body-bg);
    border-color: var(--bs-gray-400);
    outline: 0;
    /*box-shadow: false, 0 0 0 0.25rem rgba(var(--bs-component-active-bg), 0.25);*/
}

/* make command icons in tables easier to click */
.table td a .fas,
.table td button .fas,
.table td a .far,
.table td button .far { 
    font-size: 150%;
}

/* tables */
.table {
    width: 100%;
    color: #5e6e82;
    border-collapse: collapse;
    margin-bottom: 0;
    --bs-table-hover-bg: var(--bs-gray-300); /* so table-hover works */
}

    /* prevent cells from overflowing */
    .table td {
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }

        /* prevent columns from getting too wide*/
        .table td.narrow {
            max-width: 20em;
        }

/* bootstrap drop-down menus */
ul.dropdown-menu {
    z-index: 10000;
    margin: -1px 0px 0 -4px !important; /* offset */
}

    ul.dropdown-menu li {
        margin: .15rem 1rem;
    }

        ul.dropdown-menu li label {
            width: 100%;
            padding: 0.5rem;
        }

/* histograms (created with Html.Histogram method) */
:root {
    --histogram-gap: calc(min(2px, 2%));
    --histogram-panel-gap: 5px;
    --histogram-min-height: 15rem;
    --histogram-min-width: 50%;
}

div.histogram { /* histogram */
    display: inline-flex;
    flex-wrap: wrap;
    min-height: var(--histogram-min-height);
    min-width: var(--histogram-min-width);
}

    div.histogram > div { /* bars and legend panels */
        display: flex;
        width: 100%;
        justify-content: space-around;
        align-items: flex-end;
        gap: var(--histogram-gap);
        white-space: nowrap;
    }

        div.histogram > div > div { /* bar and legend cells */
            width: 100%;
            text-align: center;
            align-content: center;
            overflow: hidden;
            text-overflow: ellipsis;
        }

    div.histogram div.bars > div { /* bars */
        box-shadow: 2px 2px 2px grey;
        background: rgb(176, 192, 255);
        font-size: 80%;
    }

    div.histogram div.legend { /* legend panel */
        padding-top: var(--histogram-panel-gap);
        height: fit-content;
    }

/* forms */
.form {
    width: 100%;
    height: auto;
    padding: .5rem;
    white-space: pre-line;
    font-size: 1.1rem;
}

    .form input {
        display: inline;
        width: 12rem;
        padding: 0 0.2rem;
    }

    .form textarea {
        display: block;
        width: 100%;
        margin: 0.2rem 0;
        padding: 0 0.2rem;
    }

    .form select {
        display: inline-block;
        width: auto;
        padding: 0 0.2rem;
    }

    .form > *:invalid {
        background: var(--bkg-color-code);
    }

/* customize line breaks on prompts */
.chat-prompt {
    white-space: pre-line;
}

/* remove extra space in form replies */
.card-body.reply {
    padding-top: 0;
}

/* limit size of images in chats*/
.card-body.reply img {
    max-width: 100%;
}

/* improve markdown in chats and threads */
div.chat-reply li > p {
    margin-bottom: 0 !important;
}

/* restore bootstrap 5 outline-primary buttons */
.btn-outline-primary {
    border: var(--bs-btn-border-width) solid var(--bs-btn-border-color) !important;
    color: var(--bs-btn-border-color);
}

    .btn-outline-primary:hover {
        color: var(--bs-primary-inverse);
    }

/* auth provider logos (only google for now...) */
.auth-provider-logo {
    display: inline-block;
    margin-right: 0.5rem;
    border-radius: 50%;
    padding: 0.1rem;
    background: rgba(255,255,255,0.8);
}

    .auth-provider-logo > img {
        width: 24px;
    }

/* avatar images scaled to the same size */
.img-avatar {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

/* current app version */
span .app-version {
    font-weight: bold;
    font-size: 80%;
}

#btn-back-to-top {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    display: none;
}

/* Area created by GPT-4 */
/* general styles */
body {
    /*font-family: 'Roboto', sans-serif;*/
    font-family: 'Montserrat', sans-serif;
    color: #333;
    background-color: #f5f5f5;
}

/* card styling */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-body {
    padding: 15px;
}

.gpfy-form .card.form-prompt {
    box-shadow: none;
}

/* header styles */
h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Chat elements */
.pick-persona {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

    .pick-persona .form-control {
        max-width: 50%;
    }

@media (max-width: 576px) {
    .pick-persona {
        flex-direction: column;
    }

        .pick-persona span {
            text-align: center;
            display: block;
            width: 100%;
        }

        .pick-persona .form-control {
            width: 100%;
            max-width: 100%;
        }
}

.symbol {
    margin-right: 0.5rem;
}

.chat-start {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

#history {
    /*max-height: 400px;*/
    overflow-y: auto;
    margin-bottom: 1rem;
}

.input-group-text {
    background-color: #f5f5f5;
}

/* editing personas */
.container.gpfy-edit-persona img#img-avatar {
    z-index: 4;
    position: absolute;
    transition: transform 2s .5s;
    transform-origin: left;
}

    .container.gpfy-edit-persona img#img-avatar:hover {
        transform: scale(4);
    }

/* buttons */
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-outline-primary {
    color: #007bff;
    border-color: #007bff;
}

.btn-send,
.btn-reset {
    margin-right: 0.5rem;
}

/* query result is a pre showing JSON*/
pre.query-result {
    min-height: 4rem;
    max-height: 30rem;
    overflow: auto;
    white-space: pre-wrap;
}

/* footer */
footer {
    background-color: #333;
    padding: 30px 0;
}

    footer a {
        color: #fff;
    }

    footer h2 {
        font-size: 1.5rem;
        font-weight: 700;
        margin-bottom: 1rem;
    }

    footer h4 {
        font-size: 1.2rem;
        font-weight: 500;
        margin-bottom: 0.5rem;
    }

    footer ul {
        list-style-type: none;
        padding-left: 0;
    }

        footer ul li {
            margin-bottom: 0.5rem;
        }

.gradient-text {
    background: linear-gradient(to right, #12CE5D 0%, #FFD80C 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.smaller-menu {
    font-size: 0.8rem; /* adjust as needed */
    line-height: 1.2; /* adjust as needed */
    padding: 0.5rem 0; /* adjust as needed */
}

.landing-header {
    padding: 0.5rem 0 !important; /* adjust vertical padding as needed */
}

.menu-link.nav-link {
    padding: 0.75rem 0.75rem !important; /* adjust padding as needed to reduce height */
}

.container {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.landing-header,
.landing-header .container,
.landing-header .d-flex.align-items-center.justify-content-between {
    padding-top: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.landing-header {
    height: 100% !important;
}

.messages-container {
    display: flex;
    flex-direction: column;
    max-height: 500px; /* adjust based on your layout */
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
}

.contact-list-container {
    display: flex;
    flex-direction: column;
    max-height: 500px; /* adjust based on your layout */
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
}

.chat-block {
    max-width: 70%;
}

.chat-prompt {
    padding: 10px;
    border-radius: 5px;
    word-wrap: break-word;
    background-color: #e0f7fa; /* default color for incoming messages */
    color: #000;
}

.bg-light-info {
    background-color: #c8e6c9; /* color for outgoing messages */
}

.bg-light-primary {
    background-color: #e0f7fa; /* color for incoming messages */
}

.message-time {
    font-size: 12px;
    text-align: right;
    margin-top: 5px;
}
/*Used on the whatsapp web view*/
.unreplied-message {
    background-color: #f0f8ff; /* Very light blue shade */
    color: black; /* Keep the text color black for readability */
}
.contact-row.selected {
    background-color: #e9ecef;
}

.unreplied-message {
    background-color: #cce5ff;
}
.btn-outline-primary:hover {
    background-color: #0d6efd;
    color: white;
}

.contact-row.unreplied-message {
    background-color: #cce5ff;
}

.contact-row.unreplied-message {
    background-color: #cce5ff;
}

.contact-row.selected {
    background-color: #e9ecef;
    border-left: 3px solid #0d6efd;
}

.btn-outline-primary:hover {
    background-color: #0d6efd;
    color: white;
}

.messages-container {
    height: 70vh;
    overflow-y: auto;
}

.contact-list-container {
    height: 70vh;
    overflow-y: auto;
}

.badge {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #212529;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

    .badge .btn-close {
        font-size: 0.75rem;
        padding: 0.25rem;
    }

.card-body {
    padding: 1.5rem;
}

.form-label {
    color: #495057;
    margin-bottom: 0.5rem;
}

.input-group {
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.btn-group {
    gap: 0.5rem;
}

    .btn-group .btn {
        border-radius: 0.375rem !important;
    }

#saveChatStatusButton {
    margin-top: 2rem;
}

.badge {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem;
    white-space: normal;
    text-align: left;
    word-break: break-word;
}

.input-group-lg > .form-control {
    min-height: calc(1.5em + 1rem + 2px);
}

.btn-group .btn {
    flex: 1;
    white-space: nowrap;
}

#tagsContainer, #preferencesContainer {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
}

.card-body {
    overflow-y: auto;
    /*max-height: calc(100vh - 100px);*/
}
.container.gpfy-edit-form {
    max-width: 100%; /* Expand the container to use full width */
    padding: 0 10px; /* Reduce the horizontal padding */
}

.row {
    margin-right: -10px; /* Reduce the right margin of the row */
    margin-left: -10px; /* Reduce the left margin of the row */
}

    .row > .col-md-3,
    .row > .col-md-6,
    .row > .col-md-3 {
        padding-right: 10px; /* Reduce the right padding of the columns */
        padding-left: 10px; /* Reduce the left padding of the columns */
    }

/* 
    this doesn't seem useful... 
.card {
    height: 100%; Ensure the cards fill the available height
}
*/

.contact-list-container,
.messages-container {
    overflow-y: auto; /* Add vertical scrolling to the containers */
    max-height: 70vh; /* Set a maximum height for the containers */
}