/* ========== ПОДДЕРЖКА ==========
   Оверлей/окно — тот же паттерн, что и у faq_styles.css/rules_styles.css. Внутри —
   список своих обращений / форма создания / тред переписки. */

#supportOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

#supportWindow {
  background: white;
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

#supportContent {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ticket-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ticket-list-row {
  display: grid;
  grid-template-columns: 2fr 0.8fr 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #eee;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.ticket-list-row:hover {
  background: #f7f8fc;
}

.ticket-list-subject {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-list-date {
  font-size: 12px;
  color: #888;
}

/* Тред переписки — те же чат-пузыри, что и в приватном чате (js/chat.js), но
   проще: только "свой/от поддержки" через sender_role, без аватарок/реакций. */
.ticket-thread {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: #fafafa;
  border-radius: 10px;
}

.ticket-message {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 10px;
  background: white;
  border: 1px solid #eee;
}

.ticket-message-staff {
  align-self: flex-start;
  background: #eef0fa;
  border-color: #dde1f5;
}

.ticket-message-user {
  align-self: flex-end;
  background: #667eea;
  border-color: #667eea;
  color: white;
}

.ticket-message-user .ticket-message-meta {
  color: rgba(255, 255, 255, 0.75);
}

.ticket-message-meta {
  font-size: 11px;
  color: #888;
  margin-bottom: 3px;
}

.ticket-message-body {
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

#ticketMessageInput,
#ticketReplyInput {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}

@media (max-width: 480px) {
  .ticket-list-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
