/* -----------------------------------------------------------------------

Variables


      "default-text-color": "#000",
      "link-text-color": "#a7abb2",
      "primary-background-color": "#ec601a",
      "primary-text-color": "#fff",
      "secondary-background-color": "#e0e0e0",
      "secondary-text-color": "#000",

----------------------------------------------------------------------- */

:root {
  --text: #000;
  --primary: #eb5b25;
  --primary-light: #eb5b2580;
  --primary-text: #fff;
  --secondary: #e0e0e0;
  --secondary-light: #e0e0e080;
  --secondary-text: #000;
  --link-text: #87888b;
  --intelli-link-text: #000000;
  --error: #ec1427;
  --sucess: #1ba60d;
  --font-family: "Open Sans", sans-serif;
}

/* -----------------------------------------------------------------------
Override Bootstrap css vars
----------------------------------------------------------------------- */

.btn {
  --bs-btn-font-size: var(--bs-body-font-size);
}

.btn-primary {
  --bs-btn-border-width: 0;
  --bs-btn-bg: var(--primary);
  --bs-btn-color: var(--primary-text);
  --bs-btn-active-bg: var(--primary);
  --bs-btn-hover-bg: var(--primary);
  --bs-btn-focus-box-shadow: 0 0 0 .25rem var(--primary-light);
  --bs-btn-disabled-bg: var(--primary-light);
  --bs-btn-disabled-color: var(--primary-text);
}

.btn-secondary {
  --bs-btn-border-width: 0;
  --bs-btn-bg: var(--secondary);
  --bs-btn-active-bg: var(--secondary);
  --bs-btn-hover-bg: var(--secondary);
  --bs-btn-disabled-bg: var(--secondary-light);
  --bs-btn-color: var(--secondary-text);
  --bs-btn-hover-color: var(--secondary-text);
  --bs-btn-disabled-color: var(--secondary-text);
  --bs-btn-focus-box-shadow: 0 0 0 .25rem var(--secondary-light);
}

.alert-warning {
  --bs-alert-color: var(--error);
  --bs-alert-bg: transparent;
  --bs-alert-border-color: var(--error);
}

.bi-exclamation-triangle {
  fill: var(--error);
}

.bi-check-circle{
  fill: var(--sucess)
}


.toast.error {
  --bs-toast-bg:  color-mix(in srgb,var(--error),#FFF 93%);
  --bs-toast-border-color: color-mix(in srgb,var(--error),#FFF 93%);
}

.toast.success {
  --bs-toast-bg:  color-mix(in srgb,var(--sucess),#FFF 97%);
  --bs-toast-border-color: color-mix(in srgb,var(--sucess),#FFF 97%);
}

.card {
  --bs-card-spacer-x: 0;
  --bs-card-border-radius: 0;
  --bs-card-border-width: 0;
}

.container-fluid {
  --bs-gutter-x: 2rem; /* padding = 0.5 of gutter = 1rem */
}

/* -----------------------------------------------------------------------
General
----------------------------------------------------------------------- */

* {
  font-family: var(--font-family);
  color: var(--text)
}

textarea {
  resize: none;
}

/* -----------------------------------------------------------------------
override bootstrap classes
----------------------------------------------------------------------- */

.required {
  color: var(--error)
}

.btn-primary svg {
  fill: var(--primary-text);
}

.btn-secondary svg {
  fill: var(--secondary-text);
}

.btn-icon {
  padding: 5px;
}

.alert .bi {
  width: 2rem;
  height: 2rem;
}

.form-control,
.form-select {
  font-size: var(--bs-body-font-size);
}

.form-control:focus,
.form-check-input:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 .25rem var(--primary-light);
}

.form-control:hover,
.form-check-input:hover {
  border-color: var(--primary);
}

.btn-upload-attachment-loading {
  position: relative;
}

.btn-upload-attachment-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  border: 4px solid transparent;
  border-top-color: var(--primary-text);
  border-radius: 50%;
  animation: button-loading-spinner 1s ease infinite;
}

@keyframes button-loading-spinner {
  from {
    transform: rotate(0turn);
  }

  to {
    transform: rotate(1turn);
  }
}

.lds-ring {
  position: relative;
  width: 32px;
  height: 32px;
}

.lds-ring div {
  box-sizing: border-box;
  display: block;
  position: absolute;
  width: 28px;
  height: 28px;
  margin: 4px;
  border: 4px solid;
  border-radius: 50%;
  animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  border-color: var(--text) transparent transparent transparent;
}

.lds-ring div:nth-child(1) {
  animation-delay: -0.45s;
}

.lds-ring div:nth-child(2) {
  animation-delay: -0.3s;
}

.lds-ring div:nth-child(3) {
  animation-delay: -0.15s;
}

@keyframes lds-ring {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* -----------------------------------------------------------------------

Chat (wrapper)

----------------------------------------------------------------------- */

#chat-wrapper {
  min-width: calc(350px - (var(--bs-gutter-x) * .5) - 2rem); /* 2rem = 2* --bs-card-spacer-x*/
  height: 100dvh;
}

#chat-wrapper textarea #chat-input-area {
  height: calc(3 * 1.5rem + .75rem + 2px); /* 3 rows */
}

/* -----------------------------------------------------------------------

Chat (loading)

----------------------------------------------------------------------- */

#chat-loading {
  height: 100dvh;
}

#chat-loading .spinner-border {
  color: var(--bs-gray-700);
  width: 3rem;
  height: 3rem;
}

/* -----------------------------------------------------------------------

Chat (start)

----------------------------------------------------------------------- */

#chat-start {
  border: none;
}

#chat-start .form-check-label,
#chat-start .form-check-input[type=checkbox] {
  cursor: pointer;
}

#chat-start .form-check a {
  color: var(--link-text);
  text-decoration: none;
}

#chat-start .form-check a:hover {
  color: var(--primary);
}

#chat-start #chat-policy-checkbox:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

#chat-start.rtl .form-check {
  padding-right: 1.5em;
  padding-left: 0;
}

#chat-start.rtl .form-check .form-check-input {
  float: right;
  margin-left: 0;
  margin-right: -1.5em;
}

/* -----------------------------------------------------------------------

Timeout

----------------------------------------------------------------------- */

#chat-timeout {
  border: none;
}

/* -----------------------------------------------------------------------

Chat (end)

----------------------------------------------------------------------- */

#chat-end-rating button {
  width: 40%;
  max-width: 200px;
}

/* -----------------------------------------------------------------------

Chat (waiting)

----------------------------------------------------------------------- */

#chat-waiting {
  height: inherit;
  background-color: #fafafa;
  border-radius: .375rem;
  -webkit-box-shadow: inset 0 0 10px 2px rgba(0,0,0,0.02);
  box-shadow: inset 0 0 10px 2px rgba(0,0,0,0.02);
  overflow: hidden;
}

#chat-waiting-queue-position,
#chat-waiting-queue-time {
  font-size: calc(var(--bs-body-font-size) * 0.875);
}

/*

@see https://codepen.io/nzbin/pen/GGrXbp

*/

.dot-bricks {
  position: relative;
  top: 7.5px;
  left: -10020px;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background-color: var(--primary);
  color: var(--primary);
  box-shadow: 9991px -16px 0 0 var(--primary), 9991px 0 0 0 var(--primary), 10007px 0 0 0 var(--primary);
  animation: dotBricks 2s infinite ease;
}

.dot-bricks.rtl {
  left: -9980px;
}

@keyframes dotBricks {
  0% {
    box-shadow: 9991px -16px 0 0 var(--primary), 9991px 0 0 0 var(--primary), 10007px 0 0 0 var(--primary);
  }
  8.333% {
    box-shadow: 10007px -16px 0 0 var(--primary), 9991px 0 0 0 var(--primary), 10007px 0 0 0 var(--primary);
  }
  16.667% {
    box-shadow: 10007px -16px 0 0 var(--primary), 9991px -16px 0 0 var(--primary), 10007px 0 0 0 var(--primary);
  }
  25% {
    box-shadow: 10007px -16px 0 0 var(--primary), 9991px -16px 0 0 var(--primary), 9991px 0 0 0 var(--primary);
  }
  33.333% {
    box-shadow: 10007px 0 0 0 var(--primary), 9991px -16px 0 0 var(--primary), 9991px 0 0 0 var(--primary);
  }
  41.667% {
    box-shadow: 10007px 0 0 0 var(--primary), 10007px -16px 0 0 var(--primary), 9991px 0 0 0 var(--primary);
  }
  50% {
    box-shadow: 10007px 0 0 0 var(--primary), 10007px -16px 0 0 var(--primary), 9991px -16px 0 0 var(--primary);
  }
  58.333% {
    box-shadow: 9991px 0 0 0 var(--primary), 10007px -16px 0 0 var(--primary), 9991px -16px 0 0 var(--primary);
  }
  66.666% {
    box-shadow: 9991px 0 0 0 var(--primary), 10007px 0 0 0 var(--primary), 9991px -16px 0 0 var(--primary);
  }
  75% {
    box-shadow: 9991px 0 0 0 var(--primary), 10007px 0 0 0 var(--primary), 10007px -16px 0 0 var(--primary);
  }
  83.333% {
    box-shadow: 9991px -16px 0 0 var(--primary), 10007px 0 0 0 var(--primary), 10007px -16px 0 0 var(--primary);
  }
  91.667% {
    box-shadow: 9991px -16px 0 0 var(--primary), 9991px 0 0 0 var(--primary), 10007px -16px 0 0 var(--primary);
  }
  100% {
    box-shadow: 9991px -16px 0 0 var(--primary), 9991px 0 0 0 var(--primary), 10007px 0 0 0 var(--primary);
  }
}

/* -----------------------------------------------------------------------

Chat (history)

----------------------------------------------------------------------- */

#chat-history {
  height: inherit; /* needed to trigger scrollbars */
  overflow: auto;
  background-color: #fafafa;
  border-radius: .375rem;
  padding-left: 10px;
  padding-right: 10px;
  padding-bottom: 40px;
  -webkit-box-shadow: inset 0 0 10px 2px rgba(0,0,0,0.02);
  box-shadow: inset 0 0 10px 2px rgba(0,0,0,0.02);
}
/* prevent scrolling, black text on white paper, hide buttons  */
@media print {
  #chat-history {
    overflow: visible !important;
  }
  .chat-step.chat-step-user .chat-step-chip {
    color: black !important;
  }
  .chat-step.chat-step-agent .chat-step-chip {
    color: black !important;
  }
  button {
    background: transparent !important;
    color: transparent !important;
    border: none !important;
  }
}

.chat-step-wrapper {
  padding-top: 10px;
}

.chat-step {
  max-width: min(65%, 500px);
  line-height: 20px;
  align-items: center;
  margin-left: 5px;
  z-index: 1;
}

.chat-step .chat-step-username,
.chat-step .chat-step-chip-attach #attach-title {
  font-weight: bold;
  font-size: calc(var(--bs-body-font-size) * 1.0625);
}

.chat-step .chat-step-chip-attach #attach-title {
  color: var(--primary-text)
}

.chat-step .chat-step-chip {
  height: min-content;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
  overflow-y: hidden;
  padding: 7px 14px 8px;
  margin: 3px 0;
  width: fit-content;
}

.chat-step .chat-step-chip {
  height: min-content;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
  overflow-y: hidden;
  padding: 7px 14px 8px;
  margin: 3px 0;
  width: fit-content;
}

.chat-step .chat-step-chip-image {
  max-width: 100%;
  max-height: 70vh;
}

.chat-step .chat-step-chip-attach {
  background-color: var(--primary);
  color: var(--primary-text);
  padding: 7px 14px 8px;
  margin: 3px 0;
  width: fit-content;
  max-width: calc(100vw - 120px); /* or 100%?*/
  min-width: 150px;
}

.chat-step .chat-step-chip-attach a {
  text-decoration: none;
  cursor: pointer;
}

.chat-step .chat-step-chip-attach .row {
  flex-wrap: nowrap;
  overflow-x: clip;
}

.chat-step .chat-step-chip-attach #attach-text {
  opacity: 75%;
  font-size: calc(var(--bs-body-font-size) * 0.8125);
  line-height: 15px;
  color: var(--primary-text)
}

.chat-step .chat-step-chip-attach .row .col-3 {
  text-align: center;
  padding-top: 6px;
  width: 56px; /* 32 + 2 * 12 */
}

.chat-step.chat-step-user .chat-step-chip {
  background-color: var(--primary);
  color: var(--primary-text);
}

.chat-step.chat-step-agent .chat-step-chip {
  background-color: var(--secondary);
  color: var(--secondary-text);
}

.chat-step.chat-step-agent .chat-step-chip * {
  color: var(--secondary-text);
}

.chat-step.chat-step-agent .chat-step-chip a {
  color: var(--link-text);
  text-decoration: none;
}

.chat-step.chat-step-agent .chat-step-chip nm-intellilink, .chat-step.chat-step-agent .chat-step-chip nm-faq {
  cursor: pointer;
  color: var(--intelli-link-text);
}

.chat-step.chat-step-agent .chat-step-chip a:hover {
  text-decoration: underline;
}

.chat-step.chat-step-agent .chat-step-chip iframe {
  max-width: 500px;
}

@media only screen and (max-width: 800px) {
  .chat-step.chat-step-agent .chat-step-chip iframe {
    max-width: 300px;
  }
}

.chat-step .chat-step-time {
  font-size: calc(var(--bs-body-font-size) * 0.8125);
  opacity: 90%;
}

.chat-step.chat-step-user .chat-step-chip,
.chat-step.chat-step-user .chat-step-chip-image,
.chat-step.chat-step-user .chat-step-chip-attach,
.chat-step.chat-step-agent.rtl .chat-step-chip,
.chat-step.chat-step-agent.rtl .chat-step-chip-image,
.chat-step.chat-step-agent.rtl .chat-step-chip-attach {
  border-radius: 18px 4px 18px 18px;
}

.chat-step.chat-step-user.rtl .chat-step-chip,
.chat-step.chat-step-user.rtl .chat-step-chip-image,
.chat-step.chat-step-user.rtl .chat-step-chip-attach,
.chat-step.chat-step-agent .chat-step-chip,
.chat-step.chat-step-agent .chat-step-chip-image,
.chat-step.chat-step-agent .chat-step-chip-attach {
  border-radius: 4px 18px 18px 18px;
}

.chat-step.chat-step-user .chat-step-title {
  text-align: right;
}

.chat-step.chat-step-user.rtl .chat-step-title {
  text-align: left;
}

.chat-step.chat-step-info {
  max-width: 75%;
  text-align: center;
  font-size: calc(var(--bs-body-font-size) * 0.8125);
  line-height: 15px;
  opacity: 75%;
}

/* -----------------------------------------------------------------------

Is typing animation

----------------------------------------------------------------------- */

#chat-is-typing-spinner {
  margin-left: 42px;
  margin-top: -38px; /* relative fixed */
  z-index: 1;
  white-space: nowrap;
}

#chat-is-typing-spinner > div {
  width: 10px;
  height: 10px;
  background-color: rgb(90, 90, 90);

  border-radius: 100%;
  display: inline-block;
  -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
  animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

#chat-is-typing-spinner .bounce1 {
  -webkit-animation-delay: -0.32s;
  animation-delay: -0.32s;
}

#chat-is-typing-spinner .bounce2 {
  -webkit-animation-delay: -0.16s;
  animation-delay: -0.16s;
}

@-webkit-keyframes sk-bouncedelay {
  0%,
  80%,
  100% {
    -webkit-transform: scale(0);
  }
  40% {
    -webkit-transform: scale(1);
  }
}

@keyframes sk-bouncedelay {
  0%,
  80%,
  100% {
    -webkit-transform: scale(0);
    transform: scale(0);
  }
  40% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}

.slide-fade-enter-active {
  transition: all 0.3s ease-in;
}

.slide-fade-leave-active {
  transition: all 0.3s ease-out;
}

.slide-fade-enter-from,
.slide-fade-leave-to {
  transform: translatex(-15px);
  opacity: 0;
}

/* -----------------------------------------------------------------------

Footer

----------------------------------------------------------------------- */

footer {
  font-size: calc(var(--bs-body-font-size) * 0.6875);
}

footer a {
  color: var(--link-text);
  text-decoration: none;
  white-space: nowrap;
}

footer a:hover {
  color: var(--primary);
}

footer nav.navbar {
  justify-content: center;
  flex-wrap: nowrap;
  overflow-x: visible;
}

.overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2;
}

.popup {
  background: #fff;
}

/* -----------------------------------------------------------------------
 mobile / desktop adjustments
----------------------------------------------------------------------- */

/* small devices or mobile rotated */
@media
only screen and (max-device-height: 450px),
only screen and (max-device-height: 550px) and (max-width: 576px) {
  #chat-wrapper .chat-header {
    display: none;
  }

  #chat-wrapper #chat-premessage-textarea,
  #chat-wrapper textarea #chat-input-area {
    height: calc(2 * 1.5rem + .75rem + 2px); /* 2 rows instead of 4 */
  }
}

/* desktop (or mobile rotated) */
@media only screen and (min-device-width: 768px) {

  :root {
    --bs-body-font-size: .875rem;
  }

}
