/* /assets/css/pages/support.css */

.support-layout {
  flex: 1;
  display: flex;
  align-items: stretch;
  min-width: 0;
}

/* main */
.support-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 40px;
}

/* tabs */
.support-tabs {
  border: 0.5px solid #161616;
  padding: 3px;
  border-radius: 1px;
  margin-bottom: 24px;
}

.support-tab {
  flex: 1;
  border: none;
  background: #ffffff;
  cursor: pointer;
  font-size: 20px;
  font-weight: 500;
  color: #999999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5px;
  min-height: 40px;
  position: relative;
  line-height: 40px;
}
.support-tab.has-unread::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d32525;
  display: inline-block;
  margin-bottom: 10px;
}
.support-tab + .support-tab {
  border-left: none;
}

.support-tab.is-active {
  background: #161616;
  color: #ffffff;
}

.support-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d32525;
  display: inline-block;
  flex: 0 0 auto;
}

/* list */

.support-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0 0 0 12px;
  cursor: pointer;
  border-bottom: 1px solid #666666;
  border-radius: 0;
  position: relative;
}

/* Непрочитанный чат: accent слева + жирный текст + точка */
.support-item--unread {
  padding-left: 12px;
}
.support-item--unread::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 10px;
  width: 3px;
  background: #d32525;
  border-radius: 1px;
}
.support-item--unread .support-item__name,
.support-item--unread .support-item__date {
  font-weight: 700;
  color: #161616;
}
.support-item--unread .support-item__preview {
  font-weight: 600;
  color: #161616;
}

.support-item__date, .support-item__name {
  font-size: 20px;
  font-weight: 500;
  color: #333333;
}

.support-item__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.support-item__title-row .support-item__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-item__date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.support-item__preview {
  margin: 4px 0 8px;
  font-size: 18px;
  color: #333333;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* thread */
.support-thread-view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.support-thread-head {
  display: flex;
  align-items: center;
  gap: 1.875rem;
  margin-bottom: 24px;
}

.support-back {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  -webkit-mask: url(/assets/img/partners/row-left.svg) no-repeat center / 20px
    20px;
  mask: url(/assets/img/partners/row-left.svg) no-repeat center / 20px 20px;
  background-color: #666666;
}

.support-thread-title {
  font-size: 24px;
  font-weight: 500;
  color: #000000;
  line-height: 1;
}

/* messages area */
.support-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  height: 1px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.msg {
  position: relative;
  border-radius: 1px;
  font-size: 18px;
  color: #333333;
  padding: 16px 40px 16px 16px;
  width: fit-content;
  max-width: 65%;
  min-width: 10%;
}
.msg__time {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 12px;
  color: #777777;
}

.msg--client {
  background: #0000000d;
  margin-left: auto;
}
.msg--support {
  background: #ffffff;
  border: 0.5px solid #666666;
  margin-right: auto;
}

.support-load-older {
  align-self: center;
  margin: 4px 0 8px;
  padding: 8px 14px;
  border: 1px solid #656565;
  background: #ffffff;
  color: #333333;
  font-size: 14px;
  cursor: pointer;
}
.support-load-older:disabled {
  opacity: 0.55;
  cursor: default;
}

/* composer */
.support-composer {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 8px;
  margin-top: 16px;
}

.support-attach {
  border: 1px solid #656565;
  background: #ffffff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.msg__img {
  display: block;
  max-width: 200px;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.msg__image-btn {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  line-height: 0;
}
.msg__text--empty {
  opacity: 0.5;
}
.msg-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: rgba(0, 0, 0, 0.85);
}
.msg-image-lightbox[hidden] {
  display: none !important;
}
.msg-image-lightbox__img {
  max-width: min(96vw, 1200px);
  max-height: 80vh;
  object-fit: contain;
}
.msg-image-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}
.msg-image-lightbox__open {
  color: #fff;
  text-decoration: underline;
}
body.msg-image-lightbox-open {
  overflow: hidden;
}
.support-input {
  border: none;
  padding: 18.5px 8px;
  font-size: 18px;
  flex: 1;
  color: #161616;
  outline: none;
}
.support-input::placeholder{
  color: #666666;
}
.support-send {
  height: 44px;
  width: 44px;
  border: none;
  background: #333333;
  cursor: pointer;
  margin: auto;
  margin-right: 8px;
}

/* side (like reviews) */
.support-side {
  display: none;
  width: 376px;
  flex: 0 0 376px;
  background: #333333;
  color: #ffffff;
  overflow: visible;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100%;
  padding: 25px 24px;
}

.support--thread .support-side {
  display: block;
}

.support--thread .support-main {
  border-right: 1px solid rgba(0, 0, 0, 0.25);
}

.message-send-block {
  display: flex;

  border: 1px solid #656565;
}
.side-block + .side-block {
  margin-top: 16px;
  border-top: 1px solid #ffffff99;
}

.side-title {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  margin: 8px 0 5px;
}

.side-subtitle {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin: 10px 0 8px;
}

.side-label {
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 8px;
  opacity: 0.6;
}

.side-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0.5px solid #999999;
}
.side-row .side-input {
  border: none;
}
.side-input {
  width: 100%;
  height: 40px;
  border: 0.5px solid #999999;
  background: none;
  color: #ffffff;
  padding: 0 12px;
  font-size: 18px;
}

.side-pill {
  width: 100%;
  height: 40px;
  border: 0.5px solid #999999;
  border-radius: 1px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  font-size: 18px;
  color: #ffffff;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-decoration: underline;
  cursor: pointer;
  background: none;
}

.side-actions {
  display: flex;
}

.side-icon-btn {
  border: none;
  background: none;
  cursor: pointer;
  margin-right: 10px;
}

.side-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* bottom toggle */
.side-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.side-toggle-text {
  font-size: 14px;
  color: #d32525;
}

.side-switch {
  position: relative;
  width: 44px;
  height: 22px;
  flex: 0 0 44px;
}

.side-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.side-switch .ui {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.side-switch .ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  transition: transform 0.15s ease;
}

.side-switch input:checked + .ui {
  background: rgba(56, 178, 54, 0.35);
  border-color: rgba(56, 178, 54, 0.6);
}

.side-switch input:checked + .ui::after {
  transform: translateX(22px);
}
/* skeleton / loading сообщений при входе в тред */
.support-messages-skel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 0;
}
.support-messages-skel__row {
  height: 56px;
  max-width: 55%;
  border-radius: 1px;
  background: linear-gradient(90deg, #f0f0f0 0%, #e6e6e6 50%, #f0f0f0 100%);
  background-size: 200% 100%;
  animation: support-skel-shine 1.1s ease-in-out infinite;
}
.support-messages-skel__row--right {
  align-self: flex-end;
  max-width: 48%;
}
@keyframes support-skel-shine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.msg--pending {
  opacity: 0.72;
}
.msg--failed {
  outline: 1px solid #c62828;
}

/* фикс дергания: табы всегда flex по умолчанию, а в thread скрываются классом */
#support-page .support-tabs {
  display: flex;
}

#support-page.support--thread .support-tabs {
  display: none;
}
.support-list-view{
  overflow: auto;
}

.support-list-state {
  padding: 24px 8px;
  color: #666666;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.support-list-state[hidden] {
  display: none !important;
}

.support-list-state--error {
  color: #c62828;
}

.support-list-state__retry {
  border: 1px solid #161616;
  background: #fff;
  cursor: pointer;
  padding: 8px 14px;
  font-size: 14px;
}

.support-list-view .wa-pager {
  margin-top: 16px;
}

.support-item__head{
    display: flex;
    justify-content: space-between;
}
