/* afisha-v2/comment-modal.css — E1 (INK-PROD-QA-ES)
   Comment form popup. Markup/behaviour mirror the master-profile inquiry
   modal (.mp-modal, master-profile-v2/page.css) so the look + a11y match the
   rest of the platform ("не переизобретаем") — copied into the afisha
   namespace (.ep-comment-modal) rather than importing master-profile CSS/JS.
   Token fallbacks keep it safe if a DS token isn't present on event pages. */

/* ---- Trigger button (sits where the inline form used to be) ---- */
/* Hidden until comment-modal.js confirms JS is live and has moved the form
   into the modal — graceful no-JS degradation (form stays inline + usable). */
.ep-comment-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2, 8px);
  margin-top: var(--space-4, 16px);
  padding: 12px 20px;
  font: inherit;
  font-weight: 600;
  color: var(--color-text, #f2f2f2);
  background: var(--color-bg-elevated, #1b1b1f);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.14));
  border-radius: var(--radius-full, 999px);
  cursor: pointer;
  transition: all var(--transition-fast, 0.18s ease);
}

.ep-comment-trigger:hover {
  color: var(--color-text, #fff);
  background: var(--color-bg-hover, #26262b);
  border-color: var(--color-border-strong, rgba(255, 255, 255, 0.24));
}

.ep-comment-trigger__icon {
  width: 18px;
  height: 18px;
}

/* ---- Modal shell (clone of .mp-modal) ---- */
.ep-comment-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 1000);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4, 16px);
  opacity: 0;
  transition: opacity var(--transition-fast, 0.18s ease);
}

.ep-comment-modal[hidden] {
  display: none;
}

.ep-comment-modal.open {
  opacity: 1;
}

.ep-comment-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ep-comment-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-6, 24px);
  background: var(--color-bg-elevated, #1b1b1f);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-lg, 16px);
  transform: translateY(8px) scale(0.98);
  transition: transform var(--transition-fast, 0.18s ease);
}

.ep-comment-modal.open .ep-comment-modal__dialog {
  transform: translateY(0) scale(1);
}

.ep-comment-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl, 22px);
  line-height: 1;
  color: var(--color-text-secondary, #b7b7bd);
  background: var(--color-bg-elevated, #1b1b1f);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.14));
  border-radius: var(--radius-full, 999px);
  cursor: pointer;
  transition: all var(--transition-fast, 0.18s ease);
}

.ep-comment-modal__close:hover {
  color: var(--color-text, #fff);
  background: var(--color-bg-hover, #26262b);
}

/* The moved-in #ep-comment-form already carries its own .ep-comments__form
   styling; just let it fill the dialog and drop any top margin. */
.ep-comment-modal__body > #ep-comment-form {
  margin: 0;
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .ep-comment-modal,
  .ep-comment-modal__dialog {
    transition: none;
  }
}

@media (max-width: 480px) {
  .ep-comment-modal {
    padding: 0;
    align-items: flex-end;
  }
  .ep-comment-modal__dialog {
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-lg, 16px) var(--radius-lg, 16px) 0 0;
  }
}
