/* Общий контейнер страницы с шаблоном */
.aiux-reviews-page {
  max-width: 1200px;
  margin: 40px auto 60px;
  padding: 0 16px;
}

/* Верхняя часть: две равные колонки */
.aiux-reviews-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: flex-start;
}

/* Нижний блок: карта */
.aiux-reviews-bottom {
  margin-top: 40px;
}

/* Блок отзывов (левая колонка) */
.aiux-reviews-block {
  background: #050708;
  border-radius: 18px;
  border: 1px solid #1f2937;
  padding: 20px;
}

.aiux-reviews-title {
  margin: 0 0 16px;
  font-size: 20px;
  color: #e5e7eb;
}

.aiux-reviews-empty {
  color: #9ca3af;
  font-size: 0.95rem;
}

/* Список и карточки отзывов */
.aiux-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.aiux-review-card {
  background: #0b0e11;
  border-radius: 16px;
  border: 1px solid #111827;
  padding: 14px 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.aiux-review-card:hover {
  background: #111827;
  transform: translateY(-2px);
}

/* Шапка карточки: имя + рейтинг */
.aiux-review-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.aiux-review-title {
  min-width: 0;
}

.aiux-review-name {
  color: #f9fafb;
  font-size: 1rem;
}

.aiux-review-meta {
  margin-top: 2px;
  font-size: 0.85rem;
  color: #9ca3af;
}

/* Звезды рейтинга */
.aiux-review-rating {
  white-space: nowrap;
}

.aiux-review-star {
  font-size: 16px;
  opacity: 0.3;
}

.aiux-review-star.is-active {
  opacity: 1;
  color: #fbbf24;
}

/* Текст отзыва */
.aiux-review-text {
  margin-top: 8px;
  font-size: clamp(0.9rem, 1vw + 0.6rem, 1.05rem);
  line-height: 1.5;
  color: #e5e7eb;
}

/* Сворачивание/разворачивание текста */
.aiux-review-card.is-collapsed .aiux-review-text {
  max-height: 6.5em; /* около 3–4 строк */
  overflow: hidden;
}

/* Футер карточки: кнопка раскрытия + кнопка комментариев */
.aiux-review-footer {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Кнопка "Читать полностью" */
.aiux-review-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  color: #60a5fa;
  cursor: pointer;
}

/* Кнопка "Комментарии (N)" */
.aiux-review-comment-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  color: #9ca3af;
  cursor: pointer;
}

.aiux-review-comment-toggle:hover {
  color: #e5e7eb;
}

/* Блок комментариев под отзывом */
.aiux-review-comments-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #111827;
}

.aiux-review-comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.aiux-review-comment {
  padding: 6px 8px;
  border-radius: 10px;
  background: #020617;
}

.aiux-review-comment-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.aiux-review-comment-author {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e5e7eb;
}

.aiux-review-comment-date {
  font-size: 0.8rem;
  color: #6b7280;
}

.aiux-review-comment-text {
  font-size: 0.85rem;
  color: #d1d5db;
}

.aiux-review-no-comments {
  font-size: 0.85rem;
  color: #9ca3af;
}

/* Форма комментария к отзыву */
.aiux-review-comment-form {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.aiux-field label {
  font-size: 0.9rem;
  color: #e5e7eb;
}

.aiux-field input[type="text"],
.aiux-field input[type="email"],
.aiux-field select,
.aiux-field textarea {
  width: 100%;
  margin-top: 4px;
  border-radius: 8px;
  border: 1px solid #111827;
  background: #020617;
  color: #e5e7eb;
  padding: 6px 8px;
  font-size: 0.9rem;
}

.aiux-field textarea {
  resize: vertical;
}

.aiux-required {
  color: #f97316;
}

.aiux-review-comment-submit {
  justify-self: flex-start;
  padding: 6px 14px;
  border-radius: 9999px;
  border: none;
  background: #374151;
  color: #f9fafb;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.aiux-review-comment-submit:hover {
  background: #4b5563;
}

.aiux-review-comment-message {
  margin-top: 2px;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* Блок карты */
.aiux-reviews-map-block {
  background: #050708;
  border-radius: 18px;
  border: 1px solid #1f2937;
  padding: 20px;
}

.aiux-reviews-map-title {
  margin: 0 0 12px;
  font-size: 20px;
  color: #e5e7eb;
}

.aiux-reviews-map-inner {
  border-radius: 14px;
  overflow: hidden;
}

/* Блок для создания нового отзыва */
.aiux-new-review-block {
  margin-top: 24px;
  border-top: 1px solid #111827;
  padding-top: 16px;
}

.aiux-new-review-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 9999px;
  border: 1px solid #1d4ed8;
  background: #111827;
  color: #e5e7eb;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.aiux-new-review-button:hover {
  background: #1e293b;
  border-color: #2563eb;
}

/* Форма нового отзыва */
.aiux-new-review-form-wrapper {
  margin-top: 14px;
}

.aiux-new-review-form {
  display: grid;
  gap: 10px;
}

.aiux-new-review-form .aiux-field label {
  font-size: 0.9rem;
  color: #e5e7eb;
}

.aiux-new-review-form .aiux-field input[type="text"],
.aiux-new-review-form .aiux-field select,
.aiux-new-review-form .aiux-field textarea {
  width: 100%;
  margin-top: 4px;
  border-radius: 8px;
  border: 1px solid #111827;
  background: #020617;
  color: #e5e7eb;
  padding: 6px 8px;
  font-size: 0.9rem;
}

.aiux-new-review-form .aiux-field textarea {
  resize: vertical;
}

.aiux-new-review-submit {
  justify-self: flex-start;
  padding: 8px 16px;
  border-radius: 9999px;
  border: none;
  background: #2563eb;
  color: #f9fafb;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.aiux-new-review-submit:hover {
  background: #1d4ed8;
}

.aiux-new-review-message {
  margin-top: 4px;
  font-size: 0.85rem;
  color: #9ca3af;
}

/* Адаптив: на мобильных колонки складываются в одну */
@media (max-width: 860px) {
  .aiux-reviews-top {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ===== Slide-in виджет отзыва ===== */

.aiux-review-widget {
  position: fixed;
  right: 16px;
  bottom: 20%;
  z-index: 9999;
  max-width: 320px;
  background: #020617;
  border-radius: 18px;
  border: 1px solid #1f2937;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
  padding: 14px 14px 12px;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.25s ease-out, opacity 0.25s ease-out;
  font-family: inherit;
}

.aiux-review-widget.aiux-review-widget-visible {
  transform: translateX(0);
  opacity: 1;
}

.aiux-review-widget-inner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.aiux-review-widget-avatar {
  flex: 0 0 36px;
  height: 36px;
  border-radius: 9999px;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #facc15;
}

.aiux-review-widget-texts {
  flex: 1;
  min-width: 0;
}

.aiux-review-widget-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f9fafb;
  margin-bottom: 2px;
}

.aiux-review-widget-subtitle {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 8px;
}

.aiux-review-widget-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 9999px;
  border: none;
  background: #2563eb;
  color: #f9fafb;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.aiux-review-widget-cta:hover {
  background: #1d4ed8;
}

.aiux-review-widget-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  color: #6b7280;
  font-size: 14px;
  cursor: pointer;
}

.aiux-review-widget-close:hover {
  color: #e5e7eb;
}

.aiux-review-widget-form {
  margin-top: 10px;
}

.aiux-review-widget-form .aiux-field label {
  font-size: 0.8rem;
  color: #e5e7eb;
}

.aiux-review-widget-form .aiux-field input[type="text"],
.aiux-review-widget-form .aiux-field textarea {
  width: 100%;
  margin-top: 3px;
  border-radius: 8px;
  border: 1px solid #111827;
  background: #020617;
  color: #e5e7eb;
  padding: 5px 7px;
  font-size: 0.8rem;
}

.aiux-review-widget-form .aiux-field textarea {
  resize: vertical;
}

.aiux-review-widget-submit {
  margin-top: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  border: none;
  background: #16a34a;
  color: #ecfdf3;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.aiux-review-widget-submit:hover {
  background: #15803d;
}

.aiux-review-widget-message {
  margin-top: 4px;
  font-size: 0.75rem;
  color: #9ca3af;
}

/* На мобильных виджет не показываем даже если JS где-то не отфильтровал */
@media (max-width: 860px) {
  .aiux-review-widget {
    display: none !important;
  }
}
