/* Voice mode controls */
:root {
  --vh: 100%;
}
.voice-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}
.voice-button, #muteButton, #unmuteButton, #stopVoiceModeButton {
  background: #f5f5f5;
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s;
}
.voice-button img {
  width: 18px;
  height: 18px;
  filter: brightness(0);
}
#muteButton, #unmuteButton, #stopVoiceModeButton {
  font-size: 18px;
  color: #333;
}
.voice-button:hover, #muteButton:hover, #unmuteButton:hover, #stopVoiceModeButton:hover {
  background: #e0e0e0;
}
.stop-button {
  background: #ffeaea;
  color: #d9534f;
  border-color: #d9534f;
}
.stop-button:hover {
  background: #ffd6d6;
}
html {
  font-size: 14px;
  max-height: 100vh;
  overflow: auto;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  background: url(../image/bg-img.jpg);
  background-position: center;
  background-size: cover;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* OPTIONAL: Style for New Chat button */
.btn-new-chat {
  font-size: 1rem;
  padding: 6px 16px;
}

a {
  color: #000000 !important;
  word-break: break-word;
}

button, .btn-success, .btn-outline-primary {
  background: #000000 !important;
  border: none !important;
  color: #fff !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 30px;
}

a.navbar-center-brand {
  color: #000 !important;
}

.list-group {
  height: calc(var(--vh) * 100 - 156px);
  overflow: auto;
}

.list-group-item a {
  color: #000 !important;
  font-size: 14px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header nav {
  width: 100%;
  height: 60px;
}

main {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(4px);
}

.chat-section {
  display: flex;
}

.chat-section .left-panel {
  /* background: #f2f4f7b3; */
  background: #fff;
  padding: 15px 0;
  width: 23%;
  height: calc(var(--vh) * 100);
  overflow: auto;
  border-right: 1px solid #dcdcdc;
}

.chat-section .left-panel .list-group-item:first-child, .list-group-item+.list-group-item {
  border-radius: 0;
}

.chat-section .left-panel .list-group-item {
  padding: 6px 16px;
  background: transparent;
  border: 0;
}

.chat-section .left-panel .list-group-item:last-child {
  border-bottom: 0;
}

.chat-section .right-panel {
  width: 78%;
  display: flex;
  flex-direction: column;
  padding: 20px;
  height: calc(var(--vh) * 100);
  overflow: auto;
}

.chat-width {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.chat-width .chat-window {
  position: relative;
}

.spinner-border, .spinner-grow {
  min-width: 1rem;
  min-height: 1rem;
}

footer {
  background: #000000;
  color: #fff !important;
  padding: 10px;
  line-height: normal !important;
  position: relative !important;
}

.list-group-item a:hover {
  text-decoration: underline !important;
}

.input-group>.form-control, .input-group>.form-floating, .input-group>.form-select {
  box-shadow: none !important;
}

.input-group>.form-control:focus, .input-group>.form-floating:focus, .input-group>.form-select:focus {
  border: 1px solid #7e7e7e;
}

.input-group {
  box-shadow: 0 0 40px #00000024;
  padding: 20px;
  border-radius: 20px;
  gap: 10px;
  background: #fff;
  flex-wrap: nowrap;
}

.input-group .btn {
  border-radius: 40px !important;
  height: 36px;
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000 !important;
}

h2.mb-0 {
  font-size: 24px;
  line-height: 30px;
  font-weight: 600;
}

.form-control {
  padding: 10px 15px;
  border: 0 !important;
  padding: 0;
}

.sender {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.sender span, .receiver span {
  padding: 10px 12px;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  background: #fff;
  display: block;
  max-width: 75%;
  word-break: break-word;
}

.sender span p:last-child , .receiver span p:last-child {
  margin-bottom: 0;
}

.sender, .receiver {
  margin-bottom: 12px;
}

.receiver span {
  background: #f3f4f7;
  border: 0;
}

.bg-dark {
  background: #000 !important;
}

.text-center.text-muted {
  height: 100%;
    position: relative;
    display: flex;
    align-items: self-end;
    justify-content: center;
    padding-bottom: 20px;
    font-size: 28px;
    font-weight: 300;
    color: #000 !important;
    line-height: 36px;
}

#chat-history {
  max-height: calc(var(--vh) * 100 - 235px);
  overflow-y: auto;
  height: auto;
}

#prompt-suggestions{
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

#prompt-suggestions h6 {
  margin-bottom: 10px;
}

#prompt-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.prompt-button {
  border-radius: 30px;
  font-size: 13px;
  padding: 6px 18px;
  color: #000 !important;
  background: #eaecf1 !important;
}

.prompt-button:hover {
  background: #dadce4 !important;
}

#show-more-prompts {
  background: #000 !important;
  color: #fff !important;
  margin-top: 10px;
}

nav {
  box-shadow: 0 0 40px #00000029;
}

#plus {
  display: none;
}

#minus {
  display: none;
}

nav .btn {
  font-size: 14px;
  border-radius: 30px;
}

.nav-link {
  margin-right: 10px;
  color: #000 !important;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.navbar-center-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  white-space: nowrap;
}

.navbar-toggler-bar {
  display: block;
  width: 14px;
  height: 2px;
  background-color: #fff;
  margin: 4px 0;
}

.agent-title {
  color: #000 !important;
  font-size: 18px;
  font-weight: 500;
  text-decoration: none;
}

.agent-menu {
  display: none;
}

#upload-icon {
  font-size: 20px;
  cursor: pointer;
  display: inline-block;
  display: flex;
  align-items: center;
  padding: 0 5px;
}

img {
  width: 100%;
}

#file-name {
  line-height: normal;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 400;
}

.voice-control-icons {
  position: relative;
  z-index: 99 !important;
}

#file-name.voice-control-icons{
  max-width: 160px;
}

.button-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  z-index: 9;
  transition: all 0.4s ease;
}

  .button-container.voice-control {
    background: #ffffff;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    position: absolute;
    border-radius: 20px !important;
    transition: all 0.4s ease;
  }

  .wave-button img {
    filter: brightness(0);
    height: 36px;
  }

  .button-container button {
      background-color: #d7d7d7;
      border: none;
      color: #152e42;
      padding: 2px 5px;
      border-radius: 20px;
      cursor: pointer;
      font-size: 18px;
      height: 36px;
      width: 36px;
  }

      .button-container button:disabled {
          background-color: #b9b9b9;
          cursor: not-allowed;
      }

    button#startVoiceModeButton {
      background: transparent !important;
      width: auto;
      height: auto;
    }

#loadingButton {
  position: relative;
  z-index: 999;
}

#chat-form {
  position: relative;
}

.chat-alert {
  position: absolute;
  left: 0;
  right: 0;
  top: -35px;
  margin-bottom: 0;
  background: #b93847;
  border: 0;
  border-radius: 20px;
  font-size: 14px;
  color: #fff;
  padding: 5px 14px;
}

@media screen and (max-width: 1199px) {
  .navbar-brand img {
    height: 60px;
  }
  .agent-title {
    font-size: 16px;
    text-align: right;
  }
}

@media screen and (max-width: 991px) {
  .chat-section .left-panel {
    width: 35%;
  }
  .chat-section .right-panel {
    width: 65%;
  }
  .button-container.voice-control {
    justify-content: flex-start;
    padding-left: 20px;
  }
  #file-name.voice-control-icons {
    max-width: 160px;
    position: absolute;
    top: -15px;
    right: 0;
    border-radius: 20px;
    color: #fff;
    max-width: 320px;
    text-align: center;
    align-items: center;
    justify-content: center;
    font-size: 12px;
  }
  #file-name.voice-control-icons.selected {
    background: #000000;
    padding: 5px 10px;
  }
  #file-name.voice-control-icons:before {
    content: "";
    height: 12px;
    width: 12px;
    position: absolute;
    bottom: -12px;
    right: 66px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
  }
  #file-name.voice-control-icons.selected:before{
    border-top: 6px solid #000000;
  }
}

@media (max-width: 767px) {
  #plus {
    display: block;
  }
  nav img {
    height: 40px;
  }
  h2.mb-0 {
    font-size: 17px;
    line-height: 23px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .navbar-translate {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .navbar-collapse {
    position: absolute;
    left: 0;
    top: 60px;
    background: #f1f1f1;
    width: 100%;
    padding: 20px;
    text-align: center;
    z-index: 9;
  }

  #btnNavbarToggler {
    display: block;
  }
  .collapse:not(.show) {
    display: none !important;
  }
  .navbar-expand-sm .navbar-nav {
    flex-direction: column;
    width: 100%;
  }
  
}

@media screen and (max-width: 575px) {
  .chat-section {
    flex-wrap: wrap;
  }
  .chat-section .left-panel, .chat-section .right-panel {
    width: 100%;
    height: auto;
  }
  .input-group {
    padding: 15px 15px;
  }
  a.navbar-center-brand {
    max-width: 120px;
    white-space: break-spaces;
    text-align: center;
    font-size: 15px;
  }
  .agent-menu {
    display: block;
    position: relative;
    z-index: 99;
  }
  .chat-history {
    display: none;
    width: 280px;
    position: absolute;
    height: calc(var(--vh) * 100);
    top: 0;
    overflow: auto;
    z-index: 9;
    background: #fafafa;
    padding-top: 45px;
    box-shadow: 0 0 30px #0000005e;
  }
  .list-group {
    height: calc(var(--vh) * 100 - 99px);
  }
  .navbar-brand {
    order: 3;
  }
  .navbar-brand img {
    height: 45px;
  }
  .chat-section .left-panel {
    padding: 5px 0;
  }
  .chat-width {
    height: calc(var(--vh) * 100 - 95px);
  }
  .text-center.text-muted {
    padding-bottom: 10px;
    font-size: 24px;
    line-height: 28px;
  }
  .sender span, .receiver span {
    max-width: 85%;
  }
  .button-container {
    gap: 10px;
  }
}

@media (min-width: 576px) {
  .navbar-expand-sm .navbar-collapse {
      flex-basis: initial !important;
      flex-grow: initial !important;
  }
}


.run-status-bubble {
  background: #f3f6fb;
  border: 1px solid #e6eefb;
  padding: 8px 10px;
  border-radius: 8px;
  margin: 8px 0;
  font-size: 13px;
  color: #222;
  max-width: 78%;
}

.run-status-bubble .run-status-title {
  font-weight: 600;
  display:block;
}

.run-status-bubble .run-status-detail {
  color:#444;
  font-size:12px;
  margin-top:6px;
  white-space:pre-wrap;
}

.run-status-bubble.run-status-done {
  opacity: 0.7;
  transition: opacity 0.6s;
}
.run-status-bubble.run-status-final {
  border-style: dashed;
}
.rs-source { color:#6b6b6b; font-weight:400; font-size:11px; margin-left:6px; }
