/**
 * Mobile (max-width 991.98px): back arrow hides the detail panel so the website list is full width.
 * Class toggled by js/website-browser.js (Velzon .user-chat / .user-chat-show pattern).
 */
@media (max-width: 991.98px) {
  .website-chat-wrapper.website-browser-mobile-list-mode .chat-leftsidebar {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  .website-chat-wrapper.website-browser-mobile-list-mode {
    min-height: calc(100vh - 130px);
  }

  /*
   * Detail slide-in: Velzon uses z-index 99 + chat pattern; SimpleBar and card areas can
   * still show the website list “through” the UI. When the list is not in full-width mode,
   * hide the sidebar from painting entirely (layout space is unchanged; detail overlay
   * still covers the same region).
   */
  .website-chat-wrapper {
    isolation: isolate;
  }

  .website-chat-wrapper:not(.website-browser-mobile-list-mode) {
    overflow: hidden;
  }

  .website-chat-wrapper:not(.website-browser-mobile-list-mode) .chat-leftsidebar {
    visibility: hidden;
    pointer-events: none;
  }

  .website-chat-wrapper.website-browser-mobile-list-mode .chat-leftsidebar {
    visibility: visible;
    pointer-events: auto;
  }

  .website-chat-wrapper .chat-leftsidebar {
    position: relative;
    z-index: 1;
  }

  .website-chat-wrapper #website-detail-wrapper.user-chat.user-chat-show {
    z-index: 100 !important;
    background-image: none !important;
    background-color: var(--vz-body-bg, #ffffff) !important;
    box-shadow: -6px 0 18px rgba(15, 23, 42, 0.08);
    min-height: calc(100vh - 8rem);
  }

  .website-chat-wrapper #website-detail-wrapper.user-chat.user-chat-show .chat-content,
  .website-chat-wrapper #website-detail-wrapper.user-chat.user-chat-show #users-chat {
    width: 100%;
    max-width: none;
    min-height: 100%;
    background-color: var(--vz-body-bg, #ffffff);
  }

  .website-chat-wrapper #website-detail-wrapper.user-chat.user-chat-show .chat-conversation,
  .website-chat-wrapper #website-detail-wrapper.user-chat.user-chat-show .simplebar-content-wrapper,
  .website-chat-wrapper #website-detail-wrapper.user-chat.user-chat-show .simplebar-mask {
    background-color: var(--vz-body-bg, #ffffff);
  }
}

/**
 * Inline loading indicator next to sidebar website links (AJAX detail load).
 */
.website-browser-item-progress {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-inline-start: 0.35rem;
  vertical-align: middle;
  line-height: 1;
  flex-shrink: 0;
}

.website-browser-item-progress__spinner {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  flex-shrink: 0;
  box-sizing: border-box;
  border: 2px solid rgba(128, 128, 128, 0.28);
  border-top-color: currentColor;
  border-radius: 50%;
  opacity: 0.92;
  animation: website-browser-spin 0.7s linear infinite;
  vertical-align: middle;
}

.website-browser-item-progress__label {
  font-size: 0.8125rem;
  line-height: 1.2;
  opacity: 0.9;
  white-space: nowrap;
}

.website-browser-item-progress__dots {
  display: inline;
  letter-spacing: 0.02em;
}

.website-browser-item-progress__dot {
  display: inline-block;
  animation: website-browser-dot 1.2s ease-in-out infinite;
  opacity: 0.35;
}

.website-browser-item-progress__dot:nth-child(1) {
  animation-delay: 0s;
}

.website-browser-item-progress__dot:nth-child(2) {
  animation-delay: 0.2s;
}

.website-browser-item-progress__dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes website-browser-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes website-browser-dot {
  0%,
  60%,
  100% {
    opacity: 0.2;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-0.06em);
  }
}

/**
 * Sidebar row (Views): li > .sudovisor-list-item > a.website-item + .progress
 * Flex must be on .sudovisor-list-item — the loader is a sibling of <a>, not of <li>.
 */
/* Theme sets .sudovisor-list-item { display: block } — must override when loader is a sibling of <a>. */
.sudovisor-list-item.website-browser-item-loading {
  display: flex !important;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
}

.sudovisor-list-item.website-browser-item-loading > a.website-item {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-decoration: none;
}

/* Inner Bootstrap row (avatar + title) must shrink so the link shares the row with the loader */
.sudovisor-list-item.website-browser-item-loading > a.website-item > .d-flex {
  min-width: 0;
  width: 100%;
}

.sudovisor-list-item.website-browser-item-loading > a.website-item .flex-grow-1 {
  min-width: 0;
}

.sudovisor-list-item.website-browser-item-loading > .website-browser-item-progress {
  flex: 0 0 auto;
  margin-inline-start: 0;
  align-self: center;
}

li.website-browser-item-loading {
  min-width: 0;
}

/**
 * "Write a review" — distinct from sidebar (pencil + copy, no ring spinner).
 */
/* Beat .btn / theme display so quill + label + “Opening review…” stay on one row */
a.js-open-review-modal.website-browser-review-modal-loading {
  display: inline-flex !important;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  vertical-align: middle;
}

.website-browser-review-modal-progress {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  vertical-align: middle;
  line-height: 1;
  flex-shrink: 0;
}

.website-browser-review-modal-progress__icon {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.88;
  animation: website-browser-review-pulse 1s ease-in-out infinite;
}

.website-browser-review-modal-progress__label {
  font-size: 0.8125rem;
  line-height: 1.2;
  opacity: 0.88;
  white-space: nowrap;
  font-style: italic;
}

.website-browser-review-modal-progress__dots {
  display: inline;
  letter-spacing: 0.02em;
}

.website-browser-review-modal-progress__dot {
  display: inline-block;
  animation: website-browser-review-dot 1.1s ease-in-out infinite;
  opacity: 0.4;
}

.website-browser-review-modal-progress__dot:nth-child(1) {
  animation-delay: 0s;
}

.website-browser-review-modal-progress__dot:nth-child(2) {
  animation-delay: 0.18s;
}

.website-browser-review-modal-progress__dot:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes website-browser-review-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes website-browser-review-dot {
  0%,
  55%,
  100% {
    opacity: 0.2;
  }

  28% {
    opacity: 1;
  }
}
