#chat-container,
#open-chat-btn,
#confirmation-view,
#confirmation-popup,
#warning-view,
#warning-popup {
  position: fixed;
  margin: 0;
  z-index: 997;
}

#open-chat-btn {
  bottom: 15px;
  left: 15px;
}

#chat-container,
#confirmation-view,
#confirmation-popup,
#warning-view,
#warning-popup {
  bottom: 0px;
  left: 0px;
}

#chat-container,
#confirmation-view,
#warning-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 100vw;
  box-shadow: -2px 2px 10px 0px rgba(0, 0, 0, 0.25);
  background-color: #FFFFFF;
  display: none;
}

#confirmation-view,
#warning-view {
  display: none;
  background: rgba(0, 0, 0, 0.33);
  z-index: 998;
}

#confirmation-popup,
#warning-popup {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 16px;
  height: 176px;
  width: 100%;
  max-width: 100vw;
  padding: 16px;
  border-radius: 16px 16px 0 0;
  background: #FFFFFF;
  z-index: 999;
}

#confirmation-popup {
  height: 176px;
}

#warning-popup {
  height: 248px;
}

#confirmation-popup>*,
#warning-popup>* {
  margin: 0;
  line-height: 24px;
  text-align: center;
}

#confirmation-popup button,
#warning-popup button {
  padding: 8px 24px;
  border-radius: 8px;
  background: #D74344;
  color: #FFF;
  font-family: Roboto;
  font-size: 16px;
  letter-spacing: 0.8px;
  border: unset;
}

#open-chat-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background-color: #d74344;
  color: white;
  border-radius: 20px;
  cursor: pointer;
}

#open-chat-btn span {
  display: none;
}

#chat-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
  background-color: #d74344;
  width: 100%;
  height: 10%;
  padding: 16px;
  border: 0;
  border-radius: 13px 13px 0 0;
  font-size: 16px;
  font-weight: 700;
}

#chat-header i {
  cursor: pointer;
}

.chat-view {
  height: 90%;
  padding: 24px 16px;
}

#messages-view {
  display: none;
  padding: 0 0 24px;
}

#message-section {
  height: calc(100% - 61px - 44px);
  display: flex;
  flex-direction: column;
  padding: 0 16px;
}

#message-container {
  word-wrap: break-word;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  height: 100%;
}

#message-container p:first-of-type {
  margin-top: auto !important;
}

#message-container p {
  border-radius: 8px;
  padding: 8px 16px;
  font-family: Roboto;
  font-size: 14px;
  font-weight: 400;
  line-height: 21px;
}

#message-container p a {
  text-decoration: none;
  color: #D74344;
  font-weight: 700;
}

.user-message {
  margin: 5px 0px 5px 16px;
  background-color: #222;
  color: #FFF;
  text-align: right;
  align-self: end;
}

.assistant-message {
  margin: 5px 16px 5px 0px;
  background-color: #F2F2F2;
  color: #000;
  text-align: left;
}

.assistant-message.typing {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 64px !important;
  height: 37px;
}

#end-chat,
#end-chat:hover {
  position: absolute;
  padding: 0;
  top: 9px;
  left: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 50px;
  background-color: white;
  border-radius: 8px;
  margin: 0;
  cursor: pointer;
  color: black;
  font-size: 16px;
  letter-spacing: 0.05em;
  border: 1px solid black;
}

#email-form {
  height: 100%;
  display: flex;
  flex-direction: column;
  margin: 0;
  border-radius: 0 0 13px 13px;
  text-align: left;
}

#email-form p {
  font-size: 16px;
  line-height: 24px;
  margin-bottom: 16px;
}

#email-form label {
  text-align: left;
  font-size: 16px;
  line-height: 24px;
  margin-top: 8px;
}

#email-input,
#ticket-view #support-email {
  margin: 0;
}

#email-input,
#email-input:focus,
#email-input:focus-visible,
#email-input:active,
#support-email,
#support-email:focus,
#support-email:focus-visible,
#support-email:active {
  height: 56px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #999;
  outline: none;
  font-size: 16px;
}

#email-form button {
  height: 44px;
  border-radius: 8px;
  background: #D74344;
  color: #FFFFFF;
  font-family: Roboto;
  font-size: 16px;
  margin: auto 0 0;
  transition: none;
  border: unset;
}

#email-form button:disabled {
  background: #E6E6E6;
  color: #999;
}

#message-form {
  height: 44px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0;
  padding: 0 16px;
}

#message-form button {
  display: flex;
  width: 44px;
  height: 44px;
  padding: 8px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  background: #222;
  color: white;
  border: unset;
}

#message-form button:disabled {
  background: #999;
}

#chat-msg-input,
#chat-msg-input:focus,
#chat-msg-input:focus-visible,
#chat-msg-input:active {
  width: calc(100% - 44px - 6px);
  height: 44px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #999;
  outline: none;
  font-size: 16px;
}

#survey-view,
#ticket-view {
  display: none;
}

#survey-view form,
#ticket-view form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 100%;
  margin: 0;
  overflow-y: auto;
  position: relative;
}

#survey-view form>*>*,
#survey-view form>*,
#ticket-view form>*>*,
#ticket-view form>* {
  width: 100%;
  text-align: left;
}

#survey-view form>*:last-child,
#ticket-view form>*:last-child {
  margin-bottom: 0;
}

#survey-view form>*>*>*,
#survey-view form>*>*,
#ticket-view form>*>*>*,
#ticket-view form>*>* {
  width: 100%;
  margin: 0 0 8px;
}

#ticket-view form>div>div,
#survey-view form>div>div {
  margin: 0 0 24px;
}

#ticket-view form>div>div:last-child,
#survey-view form>div>div:last-child {
  margin: 0;
}

#survey-view #chat-comment,
#ticket-view #support-message {
  height: 120px;
  max-height: 15vh;
  width: 100%;
  margin: 0;
  font-size: 16px;
}

#survey-view p,
#ticket-view p {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  text-align: left;
}

#survey-view label,
#ticket-view label {
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
}

#survey-view .chat-rating label {
  font-size: 12px;
}

#survey-view button,
#survey-view button:hover,
#ticket-view button,
#ticket-view button:hover {
  display: flex;
  height: 44px;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  background: #D74344;
  color: #FFF;
  font-family: Roboto;
  font-size: 16px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin: 8px 0 0;
  border: unset;
}

#survey-view button:last-of-type,
#survey-view button:last-of-type:hover,
#ticket-view button:last-of-type,
#ticket-view button:last-of-type:hover {
  margin-top: 8px;
  border: 1px solid #D74344;
  background: #FFF;
  color: #D74344;
  line-height: normal;
}

#ticket-view button:disabled,
#survey-view button:disabled {
  color: #999;
  background: #E6E6E6;
}

.chat-rating {
  direction: rtl;
  unicode-bidi: bidi-override;
  color: #ddd;
  display: flex;
  justify-content: flex-end;
}

.chat-rating input {
  display: none;
}

.chat-rating label:hover,
.chat-rating label:hover~label,
.chat-rating input:checked+label,
.chat-rating input:checked+label~label {
  color: #ffc107;
}

#thank-you-view {
  flex-direction: column;
  justify-content: flex-start;
  text-align: left;
  display: none;
}

#thank-you-view p {
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
}

#thank-you-view button,
#thank-you-view button:hover {
  display: flex;
  height: 44px;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  background: #D74344;
  color: #FFF;
  font-family: Roboto;
  font-size: 16px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin: auto 0 0;
  border: unset;
}

.dot-flashing {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background-color: #696969;
  color: #696969;
  animation: dot-flashing 1s infinite linear alternate;
  animation-delay: 0.5s;
}

.dot-flashing::before,
.dot-flashing::after {
  content: "";
  display: inline-block;
  position: absolute;
  top: 0;
}

.dot-flashing::before {
  left: -15px;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background-color: #696969;
  color: #696969;
  animation: dot-flashing 1s infinite alternate;
  animation-delay: 0s;
}

.dot-flashing::after {
  left: 15px;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background-color: #696969;
  color: #696969;
  animation: dot-flashing 1s infinite alternate;
  animation-delay: 1s;
}

@keyframes dot-flashing {
  0% {
    background-color: #696969;
  }

  50%,
  100% {
    background-color: #D3D3D3;
  }
}

/* Tablet adjustments */
@media (min-width: 768px) {
  #open-chat-btn {
    width: 100px;
  }

  #open-chat-btn span {
    display: block;
  }

  #chat-container,
  #confirmation-view,
  #confirmation-popup,
  #warning-view,
  #warning-popup {
    bottom: 15px;
    left: 15px;
  }

  #chat-container,
  #confirmation-view,
  #warning-view {
    height: 540px;
    max-height: 95%;
    width: 342px;
    border-radius: 15px;
  }

  #confirmation-popup,
  #warning-popup {
    width: 342px;
    border-radius: 16px;
  }

  #message-container p:first-of-type {
    margin-top: 24px !important;
  }
}

#create_ticket_btn,
#create_ticket_btn:hover {
  display: none;
  padding: 8px 16px;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  border-radius: 24px;
  border: 1px solid var(--primary-default, #D74344);
  color: var(--primary-default, #D74344);
  font-size: 14px;
  font-weight: 500;
  text-transform: unset;
  margin: 8px 0px 12px;
  max-width: 300px;
}

#message-header {
  display: flex;
  align-items: center;
  height: 61px;
  padding: 24px 16px;
  gap: 8px;
  box-shadow: -2px 2px 10px 0px rgba(0, 0, 0, 0.25);
}

#message-header p {
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  margin: 0;
}

#chat-logo {
  width: 36px;
  height: 36px;
  line-height: 36px;
  border-radius: 50%;
  color: #fff;
  background: #000;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
}