/* Global colours */
:root {
    --colour-one:#826110;
    --colour-two:#192442;
    --colour-three:#103082;
    --colour-four:#D7B561;
    --colour-five:#9EBAFF;
    --colour-six:#FFEFC9;
    --colour-seven:#82103A;
    --colour-eight:#108218;

    --white-background:#fff;
    --sidebar-bg:rgb(16, 48, 130, 0.05);
    --message-input-bg: rgb(16, 48, 130, 0.1);
    --hover-colour: var(--colour-five);
    --grey-border: #ddd;
}


/* Reset and Global Styles */



*, *:before, *:after {
    box-sizing: border-box;
}

html {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: row;
    padding: 0;
    height: 100%;
    margin: 0;
    font-family: "Inter", sans-serif;
    background: var(--white-background);
}

select {
    font-family: "Inter", sans-serif;
}

a:-webkit-any-link {
    color: var(--colour-three);
    cursor: pointer;
    font-size: 1em;
    text-decoration: none;
}

a:-webkit-any-link:hover {
    color: var(--hover-colour);
}

h1 {
    margin-bottom: 0.5em;
    margin: 0;
    color: var(--colour-two);
}

h2 {
    font-size: 1.2rem;
    color: var(--colour-two);
}

ul {
    list-style-position: inside;
    padding-inline-start: 2px;
}

#question {
    font-size: 1.6rem;
    color: var(--colour-two);
}

.button-front {
    text-decoration: none;
    color: var(--white-background);
    background-color: var(--colour-two);
    border-radius: 2rem;
    font-size: 1vw;
    cursor: pointer;
    transition: background-color 0.3s;
    height: fit-content;
    width: 9vw;
    border: none;
    padding: 0.5rem;
}

.button-front:hover {
    background-color: var(--hover-colour);
}

#saveBtn {
    margin-inline: auto;
    max-width: fit-content;
    display: block;
    background-color: #666;
}

.save-btn {
    background-color: var(--grey-border);
    color: var(--white-background);
    border: none;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: not-allowed;
    border-radius: 5px;
}

.save-btn.active {
    background-color: var(--colour-three);
    cursor: pointer;
}

.centering {
    text-align: center;
}

/* Index Page */
#login {
    font-family: "Inter", sans-serif;
}

#login-logo {
    width: 30vw;
}

.foot-links {
    position: absolute;
    bottom: 1.7rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    width: 100%;
    font-size: 0.8rem;
}

#productBy {
    position: absolute;
    bottom: 3vw;
    font-size: 1vw;
    color: var(--colour-three);
    font-weight: bolder;
}

.gtd-logo {
    position: absolute;
    bottom: 2vw;
    display: flex;
    justify-content: center;

    #image {
        width: 8vw;
    }
}


#tagline-container {
    display: inline-block;
}

.tagline {
    color: var(--colour-two);
    margin: 0;
    font-size: 2vw;
    font-weight: bold;
    overflow: hidden;
    border-right: .15em solid var(--colour-two);
    white-space: nowrap;
    animation: typing 2s forwards;
    width: 0;
}

.video-text {
    color: var(--colour-two);
    margin: 0;
    font-size: 1vw;
    font-weight: bold;
    font-style: italic;
    white-space: nowrap;
    cursor: pointer;
}

.video-text:hover {
    color: var(--hover-colour);
}

.warning{
    color: red;
    display: none;
    font-size: 10px;
    margin: 0;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--white-background);
    width: 40%;
    margin: 0 auto;
    position: relative;
}

.headlines {
    position: absolute;
    text-align: center;
}

#about-modal, #contact-modal, #conversations-modal, #available-data-modal{
    z-index: 99999;
    display: none;
      .content {
          width: 39%;
          max-height: 99%;
          left: 60.5%;
          background: var(--white-background);
    }
     .body {
         font-size: 1rem;
         padding: 1rem;
         max-height: 99%;
    }
     .logo {
         max-width: 20rem;
         margin: auto;
         display: block;
    }
    .conversations {
        width: 90%;
    }
}

#by {
    padding: 10px;
    color: var(--colour-two);
}

/* Layout and Containers */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.content {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to right, var(--colour-five), var(--colour-six));
    border-radius: 10px;
    width: 60%;
    z-index: 2;
}

/* Menu */
.menu {
    position: fixed;
    top: 0;
    right: 0;
    padding: 10px;
    z-index: 1;
}

.menu-button {
    cursor: pointer;
    padding: 5px 10px;
    background-color: transparent;
    border: none;
    font-size: 30px;
    color: var(--colour-two);
}

.menu-button:hover {
    color: var(--hover-colour);
}


.dropdown-menu {
    display: none;
    position: fixed;
    flex-direction: column;
    right: 3rem;
    background-color: var(--white-background);
    min-width: 9rem;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    align-items: baseline;
    border-radius: 2rem;
}

.menu-dropdown-item {
    font-size: 1rem;
    color: var(--colour-two);
    padding: 1rem;
    width: 100%;
    border-radius: 2rem;
}

.menu-icon {
    padding: 10px;
}

.rename-input {
    border-color: var(--colour-two);
    border-width: thin;
    outline: none;
    font-size: 0.8rem;
    background-color: transparent;
    border-radius: 2rem;
    max-width: fit-content;
}

.sidebar-li {
    display: flex;
    justify-content: space-between;
    position: relative;
    border-radius: 1.5rem;
    padding: 0.3rem;
}

.sidebar-link {
    display: flex;
    width: fit-content;
}

#training-stage {
    position: absolute;
    top: 2rem;
}

#training-stage-label {
    position: absolute;
    top: 0.5rem;
}


/* Icons and ToolTips */

.icon,
.verify-icon,
.copy-icon,
.analysis-icon {
    display: flex;
    color: var(--colour-two);
    cursor: pointer;
    gap: 5px;
    padding: 0.5rem;
}

.tooltip-content {
    display: none;
    position: absolute;
    text-align: center;
    padding: 5px 10px;
    border-radius: 6px;
    z-index: 999999 !important;
    max-width: 200px;
    word-wrap: break-word;
    white-space: normal;
    box-sizing: border-box;
    font-size: 0.9em;
}

.hover-title {
    position: relative;
    display: inline-block;
}

.hover-title:hover::after {
    content: attr(data-title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 1;
    background-color: var(--colour-two);
    color: var(--white-background);
    padding: 5px;
    border-radius: 4px;
    font-size: 14px;
}


.communication {
    background: var(--colour-two);
    color: var(--white-background);
}

.notification {
    position: fixed;
    bottom: 40px;
    right: 40px;
    padding: 15px;
    border-radius: 5px;
    z-index: 1000;
    background: var(--colour-two);
    color: var(--white-background);
}

#assistant-logo {
    width: 2rem;
}

#user-logo {
    color: var(--colour-two);
}

.assistant-icon {
    display: flex;
    position: relative;
    left: 2.5%;
    top:-1rem;
    gap: 0.5rem; /* Space between icons */
}


/* Chat List */
#chat-list {
    padding: 0.5rem;
    overflow-x: auto;
    min-height: calc(100vh - 7.2rem);
    max-height: calc(100vh - 7.1rem);
}

.chat-event {

}

#chat-search {
    width: 20%;
    padding: 0.5rem;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--grey-border);
}

#chat-interface {
    display: flex;
    flex-direction: column;
    width: 80%;
    background-color: var(--white-background);
    border-left: 1px solid var(--grey-border);
}

#chat-box {
    display: block;
    overflow-y: auto;
    width: 100%;
    margin-bottom: 5rem;
    transition: margin-bottom 0.2s ease; /* Optional smooth adjustment */
    overflow-x: hidden;
}

.chat-message {
    width: 95%;
    overflow-x: auto;
    overflow-y: auto;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 3rem;
    border-width: 0.1rem;
    border-color: var(--grey-border);
    border-style: solid;
}

.chat-message-left {
    background-color: var(--message-input-bg);
    color: var(--colour-two);
    text-align: left;
    font-weight: 500;
    width: fit-content;
    max-width: 87%;
    margin-right: 10%;
    -webkit-animation-name: slideIn;
    animation-duration: 1s;
}

.chat-message-right {
    max-height: 40rem;
    border-width: 0;
    border-left-width: 0.1rem;
    border-radius: 0;
}

  .chat-image-thumbnail,
  .chat-html-content{
      width: 75px; /* Or any size you prefer for thumbnails */
      height: 75px;
      cursor: pointer; /* Indicates the image is clickable */
      margin: 5px 0; /* Space around the image */
    }

 .conversationsTitle {
    font-size: 1.8rem;
     color: var(--colour-two);
 }

/* Message Input */
.message-area {
    border: transparent;
    display: flex;
    min-height: 2.5rem;
    background-color: var(--message-input-bg);
    border-radius: 15px;
    padding: 5px;
    width: 40rem;
    align-self: center;
    position: absolute;
    bottom: 2%;
}

.message-role {
    font-weight: bolder;
    padding-bottom: 5px;
    padding-right: 5px;
    font-size: 0.9em;
}


.search-input {
    background-color: transparent;
    border: none;
    outline: none;
    width: 100%;
    font-size: 1rem;
    resize: none; /* Prevent manual resizing */
    overflow: hidden; /* Hide scrollbars */
    box-sizing: border-box; /* Include padding and border in size calculations */
    padding: 0.5rem;
    font-family: inherit; /* Inherit the font family from the parent */
    color: inherit;
    height: 2.5rem;
}

.send-input,
.copy-input {
    border: none;
    border-radius: 50px;
    width: 50px;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    color: var(--colour-two)
}

.send-input {
    background-image: url('/media/send.png');
}

#new-chat-button {
    border: none;
    background-color: transparent;
    color: var(--colour-two);
    cursor: pointer;
}

#new-chat-button:hover {
    color: var(--hover-colour);
}


#new-conversation-container {
    padding: 0.5rem;
    height: 4.5rem;
}

.fa-plus {
    color: var(--colour-two);
}

.fa-solid {
    color: var(--colour-two);
}

/* Chart Editor */
#chart-content {
    width: 79%;
    height: 99%;
    overflow-y: auto;
}

#modalImage {
    background-color: var(--white-background);
    width: 45vw;
    margin-inline: auto;
}

#imageModalInputContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 2rem;
}

#imageModalInput {
    width: 50rem;
    position: unset;
    height: 2.2rem;
}

#imageModalChat {
  display: none;
  background-color: var(--white-background);
  border: 0.15em solid var(--grey-border);
  width: 19%;
  left: 0.5%;
  top:0.5%;
  height: fit-content;
  max-height: 99%;
  overflow-y: auto;
  border-radius: 2.1rem;
  z-index: 99999 !important;
}

#objectChat {
    margin-top: 2rem;
    margin-inline: auto;
    width: fit-content;
    padding: 1rem
;
}

#modal-messages {

}

.modal-chat-message{
    padding-bottom: 2rem;
}

.modal-chat-message-left {
    text-align: right;
    font-weight: 600;
}

.verify-icon-modal {
    padding-left: 0.5rem;
    cursor: pointer;
}

/* Search Params */
#search-params {
    border: 1px solid var(--grey-border);
    display: flex;
    background-color: transparent;
    border-radius: 1rem;
    width: 100%;
    margin-bottom: 0.1rem;
    height: 2rem;
}

#conversation-search {
    width: 100%;
    border: none;
    outline:none;
    font-size: 0.8rem;
    padding-left: 0.5rem;
    background-color: transparent;
}

#searchToolTip {
    padding-top: 0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    font-size: 0.9rem;
    color: var(--colour-two);
}

#search-button {
    padding-top: 0.5rem;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 0.9em;
    color: var(--colour-two);
}

.search-label-icon {
    width: 20px;
    height: 20px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: transparent;
    -webkit-animation-name: slideIn;
    animation-duration: 0.5s;
}

.modal-content {
    background-color: var(--white-background);
    position: fixed;
    inset: 0px;
    width: 50rem;
    right: 0.5%;
    top: 0.5%;
    height: 50rem;
    overflow-y: auto;
    margin-left: auto;
    padding: 1rem;
    border-radius: 2rem;
    border: 0.15em solid var(--grey-border);
    -webkit-animation-name: slideIn;
    animation-duration: 0.5s;
}

.close {
    position: absolute;
    right: 1rem;
    top: 0;
    color: var(--colour-two);
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: var(--hover-colour);
    text-decoration: none;
    cursor: pointer;
}

#close-signup {
    color: var(--colour-two);
    display: none;
}

.close-modal {
    color: var(--colour-five);
}

.close-modal:hover,
.close-modal:focus {
    color: var(--white-background);
    text-decoration: none;
    cursor: pointer;
}

#modal-title {
    font-size: 1rem;
}

.modal-info {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1; /* Sit on top */
  left: 20%;
  top: 0;
  width: 80%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
  align-items: center; /* Aligns vertically center */
  justify-content: center; /* Aligns horizontally center */
}

.modal-input {
    border-radius: 0.5rem;
    border: 0.1rem solid var(--grey-border);
    width: 100%;
}

.modal-input:focus,
.modal-input:active {
    outline: none;
}

.modal-checkbox {
    accent-color: var(--colour-two);
}

.modal-checkbox:active {
    outline: none;
}

.options-modal {
  display: none;
  background-color: transparent;
  border: 0.15em solid var(--grey-border);
  width: 19%;
  left: 0.5%;
  top:0.5%;
  height: fit-content;
  max-height: 99%;
  overflow-y: auto;
  border-radius: 1rem;
}

/* Loader Styles */
.loader,
.data-loader {
    border: 5px solid var(--grey-border);
    border-top: 5px solid var(--colour-two);
    border-radius: 50%;
    width: 10px;
    height: 10px;
    animation: spin 2s linear infinite;
}

.data-loader {
    border-top-width: 8px;
    width: 60px;
    height: 60px;
    margin-bottom: 10%;
}

/* Dropdown Menu Styles */
.dropdown-menu-chat-list {
    display: none;
    z-index: 1000;
    background-color: var(--white-background);
    border: 1px solid var(--grey-border);
    width: 8rem;
    border-radius: 2rem;
    top: 90%;
    right: 3%;
    position: absolute;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 1rem;
    text-decoration: none;
    color: var(--colour-two);
    text-align: center;
    font-size: 1rem;
    border-radius: 2rem;
    background-color: var(--white-background);
}

.dropdown-item:hover {
    color:  var(--hover-colour);
}

.dropdown-button-chat-list {
    position: absolute;
    left: 90%;
    bottom: 20%;
    background: transparent;
    border: transparent;
    font-size: 1.2em;
    font-weight: bolder;
    cursor: pointer;
}

.dropdown-button-chat-list:hover {
    color: var(--colour-five);
}

/* Data Selection */
.data-info {
    font-size: 1.2em;
    border-radius: 15px;
    color: var(--colour-two);
}

.data-dropdown {
    width: 200px;
    font-size: 0.9em;
}

.data-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    width: 100%;
}

#data-category-title,
#dataset-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 20pt;
}

#selected-data {
    position: relative;
    font-size: 1rem;
    padding-top: 1rem;
    margin-left: 2.5%;
}

#selected-data-description {
    position: relative;
    padding-bottom: 3rem;
    margin-left: 2.5%;
    font-weight: bolder;
}

.analysis-description {
    display: none;
    -webkit-animation-name: fadeIn; /* Chrome, Safari, Opera */
    animation-duration: 2s;
}

.fa-solid {
    color: var(--colour-two);
}

.fa-solid:hover {
    color: var(--colour-five);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 0.5rem;
}

th,
td {
    padding: 0.5rem;
    background-color: var(--white-background);
    color: var(--colour-two);
}

th {
    text-align: left;
    padding: 0.5rem;
}

thead th {
    background-color: var(--colour-two);
    color: var(--white-background);
}

tbody tr:hover {
    background-color: rgba(84, 84, 170, 0.1);
}

tbody td {
    position: relative;
}

tbody td:hover:before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -9999px;
    bottom: -9999px;
    z-index: -1;
    background-color: rgba(84, 84, 170, 0.1);
}

.message-table {
    width: unset;
}

/* Scrollbar Styles */
.modal::-webkit-scrollbar,
.body::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
#chat-box::-webkit-scrollbar,
#modal-messages::-webkit-scrollbar,
#chart-content::-webkit-scrollbar {
    width: 0.3rem;
    height: 0.3rem;
    background-color: transparent;
    border-radius: 0.5rem;
}

.modal::-webkit-scrollbar-thumb,
.chat-message::-webkit-scrollbar-thumb,
.body::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
#chat-box::-webkit-scrollbar-thumb,
#chat-list::-webkit-scrollbar-thumb,
#modal-messages::-webkit-scrollbar-thumb,
#chart-content::-webkit-scrollbar-thumb {
    border-radius: 1rem;
    background-color: var(--grey-border);
}

.chat-message::-webkit-scrollbar {
    height: 0.3rem;
    width: 0.3rem;
}

#chat-list::-webkit-scrollbar {
    width: 0.2rem;
    height: 0;
}

#modal-messages::-webkit-scrollbar {
    height: 0.3rem;
    width: 0.3rem;
}

#chart-content::-webkit-scrollbar {
    height: 0;
}


/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@-webkit-keyframes slideIn {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

@keyframes slideIn {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.fade-in-element {
    animation: fadeIn 1s;
}


/* TO SORT */


#search-header {

}
  #signup-logo {
    width: 20rem;
  }

  #signup-close {
      color: var(--colour-two);
  }

  #profile-modal-signup {
      display: block;
      width: 40%;
      margin-left: 60%;
  }

#profile-content-signup {
    width: fit-content;
    height: fit-content;
    padding: 2rem;
    margin: auto;
    position: absolute;
}


#profile-content {
    width: 19%;
    margin-inline: 0;
    left: 0.5%;
    height: fit-content;
}


  /* Style for save button */
  .save-btn {
    background-color: var(--colour-two);
    color: var(--white-background);
    border: none;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: not-allowed;
    border-radius: 5px;
  }

  .save-btn.active {
    background-color: var(--colour-five);
    cursor: pointer;
  }


.modal-messages {
    overflow-y: scroll;
    width: 30%;
    height: 700px;
}

.field-description {
    font-size: smaller;
    color: var(--colour-two);
    font-style: italic;
    padding-bottom: 3px;
}

.field-type {
    font-size: smaller;
    color: var(--colour-one);
}

#datatype-id {
    display: none;
}


#productBySignUp {
     font-size: 0.8rem;
    color: var(--colour-three);
    font-weight: bolder;
    margin-top: 2rem;
}

#overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.7); /* Optional: semi-transparent background */
            cursor: wait;
            z-index: 1000;
            display: none;
        }


/* Aspect Ratio Changes */

@media (max-width: 20rem) {
    .auth-buttons,
    #productBy,
    #login-logo {
        display: none; /* Hide the form */
    }

    .content {
        width: 100%;
    }
}
@media (max-height: 20rem) {
    .auth-buttons,
    #productBy,
    #login-logo {
        display: none; /* Hide the form */
    }

    .content {
        width: 100%;
    }
}

.description-container {
    display: flex;
    align-items: center;
}

/* CSS for fading text in and out but never completely invisible */
.retrieving {
  opacity: 0.2; /* Minimum opacity (20% visibility) */
  animation: fadeAnimation 2s infinite; /* 4 seconds for one complete cycle */
  padding-left: 10px;
}

@keyframes fadeAnimation {
  0% {
    opacity: 0.2; /* Start at 20% visibility */
  }
  50% {
    opacity: 1; /* Fully visible */
  }
  100% {
    opacity: 0.2; /* Back to 20% visibility */
  }
}

.sort-icon{
    padding-left: 3px;
    float: right;
    color: var(--white-background);
}


.copyright {
    margin-bottom: 1vw; /* Adds space above the footer links */
    text-align: center;
    font-size: 0.5rem;
    position: absolute;
    bottom: 0rem;
    display: flex;
}

.list-data {
    list-style-position: outside;
    padding-left: 0.5rem;
}

#available-data-modal {
    height: 100% !important;
}

/* toggle switchj */

/* Container for the toggle */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

/* Hide default checkbox */
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The track */
.slider {
    position: absolute;
    cursor: pointer;
    background-color: #ccc;
    border-radius: 24px;
    width: 100%;
    height: 100%;
    transition: background-color 0.3s;
}

/* The circular slider */
.slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

/* Toggled state */
.toggle-switch input:checked + .slider {
    background-color: #4caf50;
}

.toggle-switch input:checked + .slider::before {
    transform: translateX(26px);
}

#assess-request {
    font-size: 1rem;
    display: flex;
    align-items: center;
    margin-left: auto; /* Pushes it to the right */
    padding-top: 1rem;
}

#chat-page-header {
    display: flex;
    justify-content: space-between; /* Push items apart */
    width: 85%; /* Ensure it takes full width */
}

#selected-data-holder {
    flex-grow: 1; /* Allows it to take up remaining space */
}

#info-assess-request {
    padding-left: 0.5rem;
}

.data-list {
    margin-left: 20px;
}

.question {
    color: var(--colour-eight);
}

.question:hover {
    cursor: pointer;
    color: var(--hover-colour);
}

.footer {
    padding-bottom: 1rem;
    display: flex;
    position: absolute;
    bottom: -2%;
    font-size: 0.75rem;
    align-self: center;
}