﻿body {
    background-image: url("../../Content/images/SharedChatBackground.svg");
    background-size: cover;
    color: white;
}

.wrapper {
    padding: 0 10px;
}

.custom-chat {
    color: rgba(23, 66, 140, 1);
    margin: auto;
    width: 100%;
    max-width: 950px;
    background: rgba(244, 249, 255, 1);
    border-radius: 7px;
    box-shadow: 0px 10px 38px 0px #eeeeeeb0;
    margin: 70px auto 0;
}

.custom-main {
    display: flex;
    background: linear-gradient(90deg, #CDDCF3 6.77%, #E7F0FF 89.52%);
    border-radius: 7px;
    padding: 5px 40px 2px 40px;
    justify-content: space-between;
    align-items: center;
}

.text-right {
    direction: rtl
}

.custom-header {
    color: rgba(23, 66, 140, 1);
    padding: 5px;
    display: flex !important;
    flex-direction: row-reverse;
    align-items: center;
    gap: 10px;
}

.custom-footer {
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 30px 30px;
    padding: 20px 40px 40px 40px;
    margin-top: 10px;
    margin-bottom: 20px;
}

.custom-logo {
    display: flex;
    align-items: center;
}

.custom-title {
    display: flex;
    align-items: center;
}

.custom-box {
    /*    padding: 7px;*/
    background: white;
    background: rgba(255, 255, 255, 1);
    border-radius: 7px;
    box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.5);
    margin-top: 10px;
    width: 95%;
}

.custom-prompt-text {
    display: flex;
    flex-direction: row;
    padding: 7px;
}

.waiting-chat {
    font-size: 16px;
    margin-top: 10px;
}

.box-shadow {
    display: none;
}

.upload-file-btn {
    padding: 7px;
}

.attached-files {
    display: flex;
    gap: 5px;
}

.file-item {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    padding: 5px 12px;
    background-color: rgba(244, 249, 255, 1);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    max-width: 100%;
    color: rgba(23, 66, 140, 0.8);
    margin: 5px 0;
}
/*.custom-header-title {
    font-size: 20px;
    font-weight: 600;*/
/*padding: 19px;
    margin: 0; */
/*text-align: center;
    display: block;
    white-space: nowrap;
    max-width: 930px;
    overflow: hidden;
    text-overflow: ellipsis;
}*/

.custom-header-title {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    display: block;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 930px;
    margin: 0 auto;
}

.custom-input-field {
    flex-grow: 2;
    border: none;
}
    /*    min-width: 35vw;
}*/

    .custom-input-field:focus {
        opacity: 1.5;
    }

    .custom-input-field::placeholder {
        opacity: 0.5;
    }

    .custom-input-field:focus {
        outline: none;
    }


.custom-button {
    border: none;
    background: blue;
    color: white;
    margin-left: auto;
    background: rgba(224, 234, 249, 1);
    border-radius: 7px;
    color: rgba(23, 66, 140, 1);
    font-weight: 600;
    min-width: 30px;
    color: #1379E8;
    font-size: 15px;
}

button[disabled] {
    cursor: default;
    opacity: 0.5;
}

.custom-section {
    min-height: 10vh;
    padding: 0px 40px 15px 40px;
}

.custom-header-label label {
    color: rgba(98, 129, 181, 1);
    padding: 5px 15px;
    min-width: 50px;
    border-radius: 7px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    background: rgba(255, 255, 255, 1);
}

.custom-header-label {
    padding: 0;
    margin: 0;
    opacity: 0.6;
    text-align: center;
    display: block;
    padding: 35px;
}

.loader {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
    background: #FFF;
    box-shadow: -15px 0 #FFF, 15px 0 #FFF;
    box-sizing: border-box;
    animation: shadowPulse 2s linear infinite;
    margin: 5px;
    display: block;
}

.copy-answer {
    width: 18px;
    float: inline-end;
    cursor: pointer;
    margin-left: 5px;
}

lottie-player.virutal-assisant-logo.walking-sequence {
    height: 95px;
}

@keyframes shadowPulse {
    33% {
        background: #FFF;
        box-shadow: -15px 0 #16306e, 15px 0 #FFF;
    }

    66% {
        background: #16306e;
        box-shadow: -15px 0 #FFF, 15px 0 #FFF;
    }

    100% {
        background: #FFF;
        box-shadow: -15px 0 #FFF, 15px 0 #16306e;
    }
}

label.question-box {
    background: rgba(98, 129, 181, 1);
    border-radius: 7px;
    min-width: 60px;
    padding: 7px;
    float: right;
    display: block;
}

label.answer-box {
    background: rgba(98, 129, 181, 1);
    border-radius: 7px;
    min-width: 60px;
    padding: 7px;
    float: left;
    display: block;
}

.answer-box {
    display: inline-grid;
}

.chat-bot {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    list-style-type: none;
    padding: 10px;
    margin: 0;
    max-height: 55vh;
    overflow: auto;
}

.message {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.5);
    position: relative;
    margin-bottom: 30px;
    color: white;
    margin: 0;
    max-width: 92%;
    margin: 5px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

    .message.left {
        padding: 5px 20px;
        background: white;
        border: 0.5px solid rgba(91, 165, 219, 0.5);
        color: rgba(23, 66, 140, 0.8);
        margin-bottom: 35px;
        min-width: 40px;
    }

    .message.right {
        align-self: flex-end;
        padding: 5px 20px;
        background: rgb(38 128 224);
    }

.logo {
    width: 30px
}

.message.right .logo {
    left: auto;
    right: 10px;
}

.message.left p {
    margin: 15px 0;
}

.message p {
    margin: 0;
}

.text_input {
    font-size: 16px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 15px;
    width: 100%;
}

footer, hr {
    display: none;
}

/* ========== SOURCE BUTTONS ========== */
.sourceButton {
    font-size: 14px;
    margin: 3px;
    min-height: 25px;
    height: auto;
    width: 22%;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    background-color: #e0eaf9;
    border: 1px solid #6281b5;
    border-radius: 7px;
    cursor: pointer;
    margin-left: 0px;
    padding: 5px 8px;
    line-height: 1.3;
    text-align: left;
}

    .sourceButton a {
        display: block;
        white-space: normal;
        word-break: break-word;
        overflow: visible;
        text-decoration: none;
        color: inherit;
    }

.more-info-source {
    width: 7% !important;
    background-color: #d0e5f6d4;
}

.source {
    max-height: none;
    overflow: visible;
    min-width: 360px;
    display: block;
    flex-wrap: wrap;
    gap: 5px;
    align-items: flex-start;
}

    .source label {
        flex-shrink: 0;
        align-self: center;
        margin-right: 5px;
    }

/* ========== FEEDBACK ========== */

.feedback {
    float: right;
    margin: 5px;
    margin-right: 0;
}

    .feedback i {
        font-size: 16px;
        cursor: pointer;
    }

/* ========== ERROR MESSAGES ========== */

.error {
    background-color: #ebcfcf;
    border: 1px solid #ce6e6e;
    border-radius: 7px;
    color: #a94442;
    padding: 10px;
    position: relative;
    z-index: 200000;
}

h3.errorMessage.box-shadow {
    padding: 40px;
}

.errorMessage i {
    color: red;
    font-size: 30px;
}

/* ========== SWEETALERT2 ========== */

.swal2-popup {
    font-size: 1.5rem;
}

div:where(.swal2-container) .swal2-textarea {
    height: 87px;
    padding: 0;
    margin-left: 130px;
}

.custom-header-label[hidden] {
    display: none;
}

.callback-form-container {
    text-align: left;
}

    .callback-form-container .swal2-input,
    .callback-form-container .swal2-textarea {
        width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .callback-form-container .swal2-textarea {
        min-height: 100px;
        resize: vertical;
    }

/* ========== CLEAN CHAT BUTTON ========== */

.clean-chat {
    display: none;
    margin-top: 10px;
    cursor: pointer;
    display: none;
    font-size: large;
    padding: 2px 0px;
    text-align: center;
    font-size: 16px;
    padding: 9px;
    border-radius: 7px;
    color: rgba(23, 66, 140, 1);
    margin-left: 5px;
    background: rgba(224, 234, 249, 1);
    border-radius: 7px;
    color: rgba(23, 66, 140, 1);
}


.container-flex {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: center;
}

/* ========== SUGGESTED QUESTIONS ========== */

.suggested-questions {
    list-style: none;
    display: inline-flex;
    width: 99%;
    flex-direction: row-reverse;
    justify-content: flex-start;
}

    .suggested-questions button {
        border: 1px solid #174AE4;
        box-shadow: rgba(9, 30, 66, 0.25) 0px 4px 8px -2px, rgba(9, 30, 66, 0.08) 0px 0px 0px 1px;
        padding: 2px 15px;
        overflow: hidden;
        color: #174ae7;
        font-size: 14px;
        border-radius: 7px;
        background: white;
        margin: 5px;
    }

        .suggested-questions button:hover {
            background: #b3e4fe4d;
            cursor: pointer;
        }

/* ========== TABLES ========== */

.message table {
    font-family: Arial, Helvetica, sans-serif;
    border-collapse: collapse;
    width: 100%;
}

.message th {
    border: 1px solid #ddd;
    padding: 8px;
}


.message table tr:hover {
    background-color: #ccc;
}

.message table th {
    padding-top: 12px;
    padding-bottom: 12px;
    text-align: left;
    background-color: #ccc;
    color: white;
}


/* ========== RTL SUPPORT ========== */

.right-to-left .custom-main {
    direction: rtl;
}

.right-to-left .custom-prompt-text {
    direction: rtl;
}

.right-to-left ul.chat-bot {
    direction: rtl;
}

.right-to-left .container-flex {
    direction: rtl;
}


/* ========== IFRAME MODE ========== */
/*//ifram
*/

.in-iframe .custom-chat {
    width: 100vw;
    margin: 0 !important;
    padding: 0;
    box-shadow: none;
}

/*.in-iframe .custom-input-field {
    min-width: 70vw;
}
*/

.in-iframe .container-flex {
    position: relative; /* Changed from absolute */
    border-top: 1px solid #e2dfdfc9;
    background: aliceblue;
    padding: 10px 0;
    margin-top: 10px;
}

/*.in-iframe .container-flex {
    border-top: 1px solid #e2dfdfc9;
    display: flex;
    position: absolute;
    top: 82%;
    width: 99%;
    justify-content: center;
    left: 50%;
    transform: translateX(-50%);
    background: aliceblue;
}*/

/*.in-iframe .custom-footer {
    position: absolute;
    top: 90%;
    width: 100%;
    height: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 30px 30px;
    padding: 0;
    margin-bottom: 0px;
    margin-top: 21px;
}*/

/* Remove the fixed positioning conflicts */
.in-iframe .custom-footer {
    position: relative; /* Changed from absolute */
    margin: 0;
    padding: 0 10px;
    height: 35px;
}

    .in-iframe .custom-footer img {
        width: 90px;
    }

.in-iframe {
    background: rgba(244, 249, 255, 1);
    padding: 0;
}

    .in-iframe .suggested-questions, .in-iframe .custom-logo {
        display: none;
    }

    .in-iframe .custom-main {
        margin-top: -20px;
        max-height: 70px;
    }

    .in-iframe .wrapper.menu {
        padding: 0;
    }

    /* Keep normal layout in iframe */
    .in-iframe .human-assist-wrapper {
        position: relative; /* Not absolute */
        width: 100%;
        display: flex;
        justify-content: flex-end;
        margin-top: 10px;
        padding: 0 20px;
    }

/* ========== RESPONSIVE TEXT SIZING ========== */
.chat-bot .message .typeing {
    font-size: clamp(13px, 1.5vw, 15px);
    line-height: 1.5;
}

.in-iframe .chat-bot {
    height: calc(100vh - 130px);
    max-height: none;
    overflow-y: auto;
}

.in-iframe .custom-header-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.in-iframe .container-flex {
    padding: 0;
}


.in-iframe .chat-bot .typeing h1 {
    font-size: 1.9em !important;
    margin: 0.6em 0 !important;
    font-weight: 600;
}

.in-iframe .chat-bot .typeing h2 {
    font-size: 1.3em !important;
    margin: 0.5em 0 !important;
    font-weight: 600;
}

.in-iframe .chat-bot .typeing h3 {
    font-size: 1.1em !important;
    margin: 0.5em 0 !important;
    font-weight: 600;
}

.in-iframe .chat-bot .typeing h4,
.in-iframe .chat-bot .typeing h5,
.in-iframe .chat-bot .typeing h6 {
    font-size: 1em !important;
    margin: 0.4em 0 !important;
    font-weight: 600;
}

.in-iframe .chat-bot .typeing p {
    font-size: 1em;
    margin: 0.5em 0;
    line-height: 1.4;
}



/* ========== MEDIA QUERIES ========== */

@media (min-width: 200px) and (max-width: 750px) {
    .in-iframe .source {
        max-height: max-content;
        overflow: auto;
        display: block;
        flex-wrap: wrap;
        flex-direction: row;
        align-items: center;
        gap: 5px;
        justify-content: flex-start;
        min-width: 212px;
    }

    .in-iframe .message {
        max-width: 100%;
    }

        .in-iframe .message.left, .in-iframe .message.right {
            padding: 5px 5px;
        }

            .in-iframe .message.left p {
                margin: 0px 0;
            }

    .in-iframe .sourceButton {
        width: calc(50% - 5px);
        min-width: 100px;
    }

    .in-iframe button.sourceButton.more-info-source {
        display: none;
    }

    .in-iframe .custom-section {
        padding: 0px 10px 0 10px;
    }
}

@media (min-width: 200px) and (max-width: 1450px) {

    .chat-bot {
        max-height: calc(100vh - 300px);
    }

    .custom-chat {
        margin: 10px auto 0;
    }

    .source {
        min-width: 300px;
    }
}

@media screen and (max-width: 768px) {

    .custom-main {
        padding: 0;
    }

    .custom-section {
        padding: 0;
    }

    .message {
        max-width: 90% !important;
    }
}

@media (max-width: 450px) {
    .in-iframe .chat-bot .typeing {
        font-size: 13px !important;
    }

        .in-iframe .chat-bot .typeing h1,
        .in-iframe .chat-bot .typeing h2 {
            font-size: 1.1em !important;
        }

    .source {
        min-width: auto;
    }

    .sourceButton {
        width: calc(100% - 6px);
        margin: 2px 0;
    }
}

.message {
    max-width: 80%; /* Prevent bubbles from stretching full width */
    word-wrap: break-word; /* Wrap long words */
    overflow-wrap: break-word;
    white-space: normal; /* Allow wrapping (important!) */
}

    .message .text-left {
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }

.analyze {
    width: max-content;
}

    .analyze.collapsed:before {
        content: "\f101";
    }

    .analyze:before {
        font-family: 'FontAwesome';
        content: "\f103";
        padding-left: 15px;
        float: right;
    }

.file-preview-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.docx-preview.file-content-preview {
    padding: 15px;
}

.docx-preview img {
    max-width: 100%;
    height: auto;
    display: block;
}

.file-preview-container .container {
    max-width: 1000px;
    margin: 0 auto;
}

.file-preview-container .file-preview {
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
    margin: 2px;
    border-radius: 10px;
    background-color: white;
}

.file-preview-container .file-preview-title {
    font-size: 1.2em;
    font-weight: 700;
    padding: 0 15px;
}

.file-preview-container .navigation-buttons {
    text-align: center;
    margin-top: 20px;
}

    .file-preview-container .navigation-buttons button {
        padding: 10px 20px;
        margin: 0 10px;
        font-size: 16px;
        border: none;
        border-radius: 5px;
        background-color: #007BFF;
        color: white;
        cursor: pointer;
        transition: background-color 0.3s;
    }

        .file-preview-container .navigation-buttons button:hover:not(:disabled) {
            background-color: #0056b3;
        }

        .file-preview-container .navigation-buttons button:disabled {
            background-color: #cccccc;
            cursor: not-allowed;
        }

.file-preview-container .table-wrapper, .txt-preview {
    overflow: auto;
    max-height: 400px;
    border-bottom: 1px solid #d0d0d0;
    border-top: 1px solid #d0d0d0;
}

.file-preview-container table {
    width: 100%;
    border-collapse: collapse;
}

.file-preview-container th, .file-preview-container td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.file-preview-container th {
    background-color: #007BFF;
    color: white;
    font-weight: bold;
}

.file-preview-container tr:nth-child(even) {
    background-color: #ffffff;
}

.file-preview-container .highlight {
    font-weight: bold;
    color: red;
}

.file-preview-container .active-highlight {
    background-color: yellow;
    border-radius: 3px;
}

.file-preview-container .image-preview img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: 0 auto;
}

.file-preview-container .image-preview {
    padding: 15px 0;
    max-height: 100%;
}

.file-preview-container .svg-preview svg {
    max-width: 100%;
    height: auto;
}

.file-preview-container i.expand-btn {
    float: inline-end;
    cursor: pointer;
}

.file-preview-model-dialog {
    min-width: 55%;
    max-height: max-content;
}

    .file-preview-model-dialog .modal-body .file-preview {
        box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
        margin: 2px;
        border-radius: 10px;
        background-color: white;
        padding: 15px;
        min-width: 99%;
        width: fit-content;
    }

    .file-preview-model-dialog button.close {
        color: white;
        border: white;
        opacity: 1;
        padding-left: 5px;
    }

    .file-preview-model-dialog .modal-title {
        display: inline;
    }

    .file-preview-model-dialog .file-preview .file-preview-title {
        display: none;
    }

    .file-preview-model-dialog .highlight-btn {
        float: none;
        margin-bottom: 15px;
        margin-left: 20px;
    }

    .file-preview-model-dialog .highlight.active {
        background: orange !important;
    }

    .file-preview-model-dialog .highlight-navigation {
        position: sticky;
        z-index: 100;
        background: #ffffff;
        display: flex;
        gap: 10px;
        top: -15px;
        align-items: flex-start;
    }

    .file-preview-model-dialog table tr {
        background-color: #cccccc2b;
    }

    .file-preview-model-dialog table th {
        padding-top: 12px;
        padding-bottom: 12px;
        text-align: left;
        background-color: #ccc;
        color: black;
        font-weight: 200;
    }

    .file-preview-model-dialog table {
        border-collapse: collapse;
        width: 100%;
        max-width: 100%;
        table-layout: fixed;
    }

        .file-preview-model-dialog table th, .file-preview-model-dialog table td {
            border: 1px solid #ddd;
            padding: 8px;
            overflow: visible; /*important for semantic search*/
            word-wrap: break-word;
            white-space: normal;
            vertical-align: top;
        }

.modal-header {
    color: #ffffff;
    background-color: #184063;
}

.modal-body {
    color: #184063;
    max-height: 80vh;
    overflow: auto;
}

.source-row {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: flex-start;
}

.source-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .source-actions i,
    .source-actions span i {
        font-size: 14px;
        color: #555;
        cursor: pointer;
        transition: color 0.2s ease;
    }

        .source-actions i:hover,
        .source-actions span i:hover {
            color: #000;
        }

.source-file {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

    .source-file a {
        display: inline-block;
        max-width: 260px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }


.chat-bot h1,
.chat-bot h2 {
    margin-top: 0.3em;
    margin-bottom: 0.2em;
}

h1 {
    font-size: 2.75rem;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 2.25rem;
}

h4 {
    font-size: 2rem;
}

h5 {
    font-size: 1.75rem;
}


/* Mobile */
@media (max-width: 576px) {
    h1 {
        font-size: 1.4rem;
        line-height: 1.4;
    }

    h2 {
        font-size: 1.25rem;
        line-height: 1.4;
    }

    h3 {
        font-size: 1.1rem;
    }

    h4 {
        font-size: 1rem;
    }

    h5 {
        font-size: 0.95rem;
    }

    .source-file a {
        max-width: 100%;
    }
}
