@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');

:root {
  --chat-widget-color: #785fcb;
  --chat-widget-active-color: #ffe195;
}
.hidden{
  display: none;
}
.chat-widget-container {
  position: fixed;
  z-index: 9999;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  user-select: none;
}

.chat-widget-toggle {
  position: fixed;
  z-index: 9998;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--chat-widget-color);
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-widget-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.chat-widget-toggle i {
  transition: transform 0.3s ease;
}

.chat-widget-window-open ~ .chat-widget-toggle i {
  transform: rotate(90deg);
}

.chat-widget-window {
  position: absolute;
  top: 0;
  left: 0;
  width: 350px;
  height: 450px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s ease;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
}

.chat-widget-window.chat-widget-window-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.chat-widget-container:not(.chat-widget-draggable) .chat-widget-window {
  right: 0;
}

.chat-widget-header {
  background: var(--chat-widget-color);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-widget-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.chat-widget-logo {
  width: 48px;
  min-width: 48px;
  height: 48px;
  margin-right: 8px;
  border-radius: 50%;
  border: 1px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-widget-logo svg {
  width: 24px;
  height: 24px;
}



.chat-widget-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.8;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-widget-close:hover {
  opacity: 1;
}

.chat-widget-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f7f7f7;
  align-items: center;
}

.chat-widget-messages {
  flex: 1;
  min-height: 150px;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  width: min(980px, 100%);
  scroll-behavior: smooth;
  
}
.chat-widget-messages * {
  font-size: inherit;
}
.chat-widget-message p {
  margin-block-start: 0;
  margin-block-end: 0;
}

.chat-widget-hotwords {
  background: #fff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.chat-widget-hotwords-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  width: min(980px, 100%);
}

.chat-widget-hotwords-toggle {
  background: white;
  color: #6b7280;
  cursor: pointer;
  font-size: 12px;
  transition: transform 0.2s ease;
  border: 1px solid #A6A6A6;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  transform: translateY(-66%);
  right: 16px;
}

.chat-widget-hotwords-content {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  width: min(980px, 100%);
}

.chat-widget-hotword {
  padding: 6px 12px;
  background: white;
  border: 1px solid var(--chat-widget-color);
  border-radius: 22px;
  font-size: 16px;
  color: var(--chat-widget-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-widget-hotword:hover {
  background: var(--chat-widget-active-color);
  color: var(--chat-widget-color);
  border-color: var(--chat-widget-active-color); 
}

.chat-widget-hotword-back {
  background: white;
  border-color: #A6A6A6;
  color: #A6A6A6;
}

.chat-widget-hotword-back:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: white;
}

.chat-widget-message {
  max-width: min(80%, 560px);
  padding: 12px 16px;
  border-radius: 18px;
  margin-bottom: 10px;
  word-wrap: break-word;
  animation: chatWidgetFadeIn 0.4s ease;
  line-height: 1.5;
  /* white-space: pre-wrap; */
  user-select: text;
  transition: all 0.4s ease;
  font-size: inherit;
}
.chat-widget-message a{
  color: var(--chat-widget-color);
  text-decoration: underline;
}
.chat-widget-message ul, .chat-widget-message ol {
  margin: 0.5em 0;
  margin-block-start: 0.5em;
  margin-block-end: 0.5em;
  padding-left: 1.5em;
}
.chat-widget-message li{
  padding-left: 0.5em;
  margin: 0.25em 0;
  position: relative;
  /* //list-style-position: inside; */
}
.chat-widget-message li::marker {
  color: var(--chat-widget-color);
}
@keyframes chatWidgetFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-widget-message-user, .chat-widget-message-form ,.chat-widget-message-rule,.chat-widget-message-user_chat {
  background: var(--chat-widget-color);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.chat-widget-message-bot {
  background: #eff6fe;
  color: #3D3D3D;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid #D0E2F4;
  box-shadow: 0 4px 10px #D0E2F4;
}

.chat-widget-message-loading {
  padding: 12px 16px !important;
}

.chat-widget-loading-dots {
  display: inline-flex;
  gap: 4px;
}

.chat-widget-loading-dots span {
  width: 8px;
  height: 8px;
  background: #3B83F7;
  border-radius: 50%;
  animation: chatWidgetLoadingBounce 1.4s infinite ease-in-out both;
}

.chat-widget-loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.chat-widget-loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes chatWidgetLoadingBounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

.chat-widget-input-container {
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  background: white;
  display: flex;
  justify-content: center;
  width: 100%;
}
.chat-widget-input-content{
  border-radius: 24px;
  background-color: #e1e2e5;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  width: min(980px, 100%);
  gap: 0px;
}
.chat-widget-input {
  flex: 1;
  padding: 12px 16px;
  outline: none;
  font-size: 16px;
  transition: border-color 0.2s;
  background-color: #e1e2e5;
  border-top-left-radius: 24px;
  border-bottom-left-radius: 24px;
  line-height: 20px;
}

.chat-widget-input:focus {
  border-color: var(--chat-widget-color);
  outline: 1px solid var(--chat-widget-color);
}

.chat-widget-send {
  padding: 2px 16px;
  border: none;
  border-radius: 24px;
  background: transparent;
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-widget-send:hover {
  transform: scale(1.02);
  opacity: 0.8;
}

.chat-widget-draggable.chat-widget-container {
  cursor: default;
}

.chat-widget-draggable.chat-widget-container.chat-widget-dragging {
  opacity: 0.8;
  cursor: moving;
}

.chat-widget-draggable.chat-widget-container.chat-widget-dragging .chat-widget-window {
  transform: scale(1.02);
}

.chat-widget-container.chat-widget-dragging .chat-widget-toggle {
  pointer-events: none;
}

@media (max-width: 480px) {
  .chat-widget-window {
    width: calc(100vw - 40px);
    height: calc(100vh - 140px);
    max-height: 500px;
  }
}

.chat-widget-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.chat-widget-header-actions i{
  font-size: 24px;
}
.chat-widget-settings {
  background: transparent;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.chat-widget-settings:hover {
  opacity: 1;
}

.chat-widget-fullscreen {
  background: transparent;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.chat-widget-fullscreen:hover {
  opacity: 1;
}

.chat-widget-window.chat-widget-fullscreen-mode {
  position: fixed;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0;
  z-index: 10000;
}

.chat-widget-container.chat-widget-container-fullscreen {
  z-index: 10000;
}

.chat-widget-container-fullscreen .chat-widget-toggle {
  display: none;
}

.chat-widget-container-fullscreen .chat-widget-header {
  cursor: default !important
}

.chat-widget-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.chat-widget-settings-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  display: none;
  flex-direction: column;
  z-index: 10;
  align-items: center;
}

.chat-widget-content.chat-widget-settings-open .chat-widget-settings-panel {
  display: flex;
}

.chat-widget-settings-header {
  display: flex;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 16px;
  width: 100%;
}

.chat-widget-settings-back {
  background: none;
  border: none;
  color: #000000;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.chat-widget-settings-back:hover {
  color: var(--chat-widget-color);
}

.chat-widget-settings-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 980px;
  width: 100%;
}

.chat-widget-settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background-color: #f7f7f7;
  border-radius: 16px;
}

.chat-widget-font-size-item {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  flex-direction: column;
}

.chat-widget-font-size {
  display: flex;
  align-items: center;
  gap: 22px;
}

.chat-widget-settings-item span {
  font-size: 16px;
  color: #3D3D3D;
}

.chat-widget-settings-item b {
  font-size: 16px;
  color: #3D3D3D;
}

.chat-widget-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.chat-widget-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.chat-widget-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e5e7eb;
  transition: 0.3s;
  border-radius: 24px;
}

.chat-widget-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.chat-widget-switch input:checked + .chat-widget-slider {
  background-color: var(--chat-widget-color);
}

.chat-widget-switch input:checked + .chat-widget-slider:before {
  transform: translateX(20px);
}

.chat-widget-font-size-buttons {
  display: flex;
  gap: 8px;
  border: 1px solid #3D3D3D44;
  border-radius: 10px;
  margin-top: 8px;
  background-color: white;
  padding: 5px 12px;
  width: 100%;
  justify-content: space-between;
}

.chat-widget-font-btn {
  padding: 6px 12px;
  border: none;
  background: white;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  color: #3D3D3D;
  transition: all 0.2s;
  flex: 1;
  font-weight: 500;
}

.chat-widget-font-btn:hover {
  border-color: var(--chat-widget-color);
  color: var(--chat-widget-color);
}

.chat-widget-font-btn.active {
  background: var(--chat-widget-color);  
  border-color: var(--chat-widget-color);
  color: white;
}
.chat-widget-history,.chat-widget-privacy{
  cursor: pointer;
}
.chat-widget-history-content,.chat-widget-privacy-content{
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  flex:1;
  margin-left: 18px;
}

.chat-widget-history-logo,.chat-widget-privacy-logo{
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background-color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #3D3D3D44;
  margin-left: -8px;
}

.chat-widget-form-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  display: none;
  flex-direction: column;
  z-index: 20;
  align-items: center;
}

.chat-widget-content.chat-widget-form-open .chat-widget-form-panel {
  display: flex;
}

.chat-widget-form-header {
  display: flex;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 16px;
  width: 100%;  
}

.chat-widget-form-back {
  background: none;
  border: none;
  color: #000000;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.chat-widget-form-back:hover {
  color: var(--chat-widget-color);
}

.chat-widget-form-content {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap:12px;
  max-width: 980px;
  width: 100%;
}

.chat-widget-form-content .w-50 {
  width: calc(50% - 6px);
}
.chat-widget-form-group {
  width: 100%;
}
.chat-widget-form-input,
.chat-widget-form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
  box-sizing: border-box;
  color: #3D3D3D;
}
.chat-widget-form-select{
  color: #3D3D3D88;
}
.chat-widget-form-select option {
  padding: 8px;
  background-color: #fff;
  color: #3D3D3D88;
}
.chat-widget-form-select::picker-icon{
  width: 24px;
  height: 24px;
  padding-right: 1em;
}
.chat-widget-form-input:focus,
.chat-widget-form-select:focus {
  border-color: var(--chat-widget-color);
}

.chat-widget-form-checkbox {
  display: flex;
  align-items: center;
  width: min(720px, 100%);
  margin:16px auto 0 auto;
}

.chat-widget-form-checkbox label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: #6b7280;
  cursor: pointer;
  font-weight: 500;
}

.chat-widget-form-checkbox input {
  width: 16px;
  height: 16px;
}
.chat-widget-form-checkbox input:checked {
  background-color: var(--chat-widget-color);
}
.chat-widget-form-input-error {
  border-color: #f87171;
}

.chat-widget-privacy-link {
  color: var(--chat-widget-color);
  text-decoration: none;
}

.chat-widget-privacy-link:hover {
  text-decoration: underline;
}

.chat-widget-form-submit {
  background: var(--chat-widget-color);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  width: min(720px, 100%);
  height: 44px;
  margin:12px auto;
}

.chat-widget-form-submit:hover {
  background: var(--chat-widget-active-color);
  color: var(--chat-widget-color);
}
.chat-widget-form-submit .chat-widget-loading-dots span {
  background-color: currentColor !important;
}

.track-result{
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.track-result .title{
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #D8D8D8;
}
.track-result .title span{
  font-weight: 500;
  color: var(--chat-widget-color);
}
.track-result .title span:first-child{
  color: #3D3D3D;
}
.track-result .bg-white{
  padding: 8px 12px 12px 12px;
  border-radius: 24px;
  background-color: #FFFFFF;
  border: 1px solid var(--chat-widget-color);
  display: flex;
  flex-direction: column;
}
.track-result .content{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
}
.track-result .content>div{
  display: flex;
  flex-direction: column;
}
.track-result .content .w-50{
  width: calc(50% - 6px);
}
.track-result .content .w-100{
  width: 100%;
}
.track-result .content label{
  font-weight: 400;
  color: #3D3D3D;
}
.track-result .content span{
  font-weight: 500;
  color: #3D3D3D;
}
.track-result a{
  color: #C83E3E;
  text-decoration: none;
  font-weight: bold;
  margin: auto;
}