/**
 * Shared feedback modal (thumbs up / thumbs down) for ns_t3ac and ns_t3as.
 * Appended to document.body — must sit above chatbot / search overlays.
 */
.ns-t3cs-feedback-modal {
  --ns-t3cs-feedback-bg: #1a1a1a;
  --ns-t3cs-feedback-border: #3a3a3a;
  --ns-t3cs-feedback-text: #f5f5f5;
  --ns-t3cs-feedback-muted: #9ca3af;
  --ns-t3cs-feedback-input-bg: #252525;
  --ns-t3cs-feedback-primary: #3a85e6;
  --ns-t3cs-feedback-primary-hover: #2f6fd4;
  --ns-t3cs-feedback-chip-selected: rgba(58, 133, 230, 0.18);

  box-sizing: border-box;
  display: none;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  inset: 0;
  pointer-events: none;
  position: fixed;
  visibility: hidden;
  z-index: 2147483000;
}

.ns-t3cs-feedback-modal.is-open {
  display: block;
  pointer-events: auto;
  visibility: visible;
}

/* Scoped inside chatbot panel (shadow DOM) — not full-page overlay */
.ns-t3cs-feedback-modal--scoped {
  border-radius: inherit;
  inset: 0;
  position: absolute;
  z-index: 200;
}

.ns-t3cs-feedback-modal--scoped .ns-t3cs-feedback-modal__dialog {
  max-height: calc(100% - 24px);
  max-width: calc(100% - 24px);
}

.ns-t3cs-feedback-modal[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.ns-t3cs-feedback-modal *,
.ns-t3cs-feedback-modal *::before,
.ns-t3cs-feedback-modal *::after {
  box-sizing: border-box;
}

.ns-t3cs-feedback-modal__backdrop {
  background: rgba(0, 0, 0, 0.55);
  inset: 0;
  position: absolute;
  z-index: 0;
}

.ns-t3cs-feedback-modal__dialog {
  background: var(--ns-t3cs-feedback-bg);
  border: 1px solid var(--ns-t3cs-feedback-border);
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  color: var(--ns-t3cs-feedback-text);
  display: flex;
  flex-direction: column;
  left: 50%;
  max-height: min(90vh, 720px);
  max-width: min(520px, calc(100vw - 32px));
  overflow: hidden;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  z-index: 1;
}

.ns-t3cs-feedback-modal__header {
  align-items: center;
  display: flex;
  gap: 10px;
  padding: 20px 20px 0;
}

.ns-t3cs-feedback-modal__icon {
  flex-shrink: 0;
  font-size: 22px;
  line-height: 1;
}

.ns-t3cs-feedback-modal__title {
  color: var(--ns-t3cs-feedback-text);
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

.ns-t3cs-feedback-modal__close {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--ns-t3cs-feedback-text);
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  font-size: 22px;
  height: 32px;
  justify-content: center;
  line-height: 1;
  margin: 0;
  padding: 0;
  width: 32px;
}

.ns-t3cs-feedback-modal__close:hover,
.ns-t3cs-feedback-modal__close:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.ns-t3cs-feedback-modal__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
}

.ns-t3cs-feedback-modal__field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ns-t3cs-feedback-modal__label {
  color: var(--ns-t3cs-feedback-text);
  display: block;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.ns-t3cs-feedback-modal__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ns-t3cs-feedback-modal__chip {
  background: transparent;
  border: 1px solid #4b5563;
  border-radius: 6px;
  color: var(--ns-t3cs-feedback-text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  padding: 8px 14px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ns-t3cs-feedback-modal__chip:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #6b7280;
}

.ns-t3cs-feedback-modal__chip.is-selected {
  background: var(--ns-t3cs-feedback-chip-selected);
  border-color: var(--ns-t3cs-feedback-primary);
  color: var(--ns-t3cs-feedback-text);
}

.ns-t3cs-feedback-modal__chip:focus-visible {
  outline: 2px solid var(--ns-t3cs-feedback-primary);
  outline-offset: 2px;
}

.ns-t3cs-feedback-modal__textarea {
  background: var(--ns-t3cs-feedback-input-bg);
  border: 1px solid var(--ns-t3cs-feedback-border);
  border-radius: 8px;
  color: var(--ns-t3cs-feedback-text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  min-height: 140px;
  padding: 12px 14px;
  resize: vertical;
  width: 100%;
}

.ns-t3cs-feedback-modal__textarea::placeholder {
  color: var(--ns-t3cs-feedback-muted);
}

.ns-t3cs-feedback-modal__textarea:focus {
  border-color: var(--ns-t3cs-feedback-primary);
  outline: none;
}

.ns-t3cs-feedback-modal__counter {
  color: var(--ns-t3cs-feedback-muted);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 6px;
  text-align: right;
}

.ns-t3cs-feedback-modal__footer {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 0 20px 20px;
  position: relative;
  z-index: 2;
}

.ns-t3cs-feedback-modal__btn {
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  min-height: 40px;
  padding: 10px 18px;
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.ns-t3cs-feedback-modal__btn--cancel {
  background: transparent;
  border: 1px solid #4b5563;
  color: var(--ns-t3cs-feedback-text);
}

.ns-t3cs-feedback-modal__btn--cancel:hover,
.ns-t3cs-feedback-modal__btn--cancel:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  border-color: #6b7280;
  outline: none;
}

.ns-t3cs-feedback-modal__btn--submit {
  background: var(--ns-t3cs-feedback-primary);
  border: 1px solid var(--ns-t3cs-feedback-primary);
  color: #fff;
}

.ns-t3cs-feedback-modal__btn--submit:hover:not(:disabled),
.ns-t3cs-feedback-modal__btn--submit:focus-visible:not(:disabled) {
  background: var(--ns-t3cs-feedback-primary-hover);
  border-color: var(--ns-t3cs-feedback-primary-hover);
  outline: none;
}

.ns-t3cs-feedback-modal__btn--submit:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ns-t3cs-feedback-modal__footer.is-hidden {
  display: none !important;
}

@media (max-width: 480px) {
  .ns-t3cs-feedback-modal__header,
  .ns-t3cs-feedback-modal__body,
  .ns-t3cs-feedback-modal__footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .ns-t3cs-feedback-modal__footer {
    padding-bottom: 16px;
  }

  .ns-t3cs-feedback-modal__footer .ns-t3cs-feedback-modal__btn {
    flex: 1 1 auto;
    min-width: 0;
  }
}
