/* ════════════ SUPPORT TICKETS ════════════ */

/* ── Floating help button ── */
/* Desktop: stack above buttons — AI chatbot=28px, Team Chat=96px, Support=164px */
.support-fab {
  position: fixed;
  bottom: 164px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(99,102,241,.45);
  z-index: 900;
  transition: transform .2s, box-shadow .2s;
}
.support-fab:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(99,102,241,.55); }
.support-fab .support-fab__badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  border-radius: 99px;
  background: #ef4444;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ── Submit modal ── */
.support-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 16px;
}
.support-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.support-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.support-modal__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.support-modal__sub {
  font-size: .8rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Form fields */
.support-field { display: flex; flex-direction: column; gap: 6px; }
.support-label { font-size: .82rem; font-weight: 600; color: var(--text); }
.support-input, .support-textarea, .support-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .88rem;
  padding: 9px 12px;
  width: 100%;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}
.support-input:focus, .support-textarea:focus, .support-select:focus {
  border-color: #6366f1;
}
.support-textarea { resize: vertical; min-height: 90px; }

/* Screenshot upload */
.support-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  position: relative;
}
.support-upload-zone:hover, .support-upload-zone--drag { border-color: #6366f1; background: #6366f108; }
.support-upload-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.support-upload-zone__icon { font-size: 2rem; margin-bottom: 6px; }
.support-upload-zone__text { font-size: .82rem; color: var(--muted); }
.support-upload-zone__text strong { color: #6366f1; }

/* Preview */
.support-preview {
  position: relative;
  display: inline-block;
}
.support-preview img {
  max-height: 160px;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}
.support-preview__remove {
  position: absolute;
  top: -8px; right: -8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
}

/* Priority pill */
.support-priority-row { display: flex; gap: 8px; flex-wrap: wrap; }
.support-priority-pill {
  padding: 5px 14px;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  background: transparent;
  color: var(--text);
}
.support-priority-pill:hover { border-color: #6366f1; }
.support-priority-pill--active[data-p="low"]    { background: #22c55e20; border-color: #22c55e; color: #22c55e; }
.support-priority-pill--active[data-p="medium"] { background: #f59e0b20; border-color: #f59e0b; color: #f59e0b; }
.support-priority-pill--active[data-p="high"]   { background: #ef444420; border-color: #ef4444; color: #ef4444; }

/* ── Support page (full page) ── */
.support-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

/* Ticket list */
.support-tickets { display: flex; flex-direction: column; gap: 12px; }
.support-ticket {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .15s;
}
.support-ticket:hover { border-color: #6366f1; }
.support-ticket__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.support-ticket__title { font-weight: 600; font-size: .95rem; color: var(--text); }
.support-ticket__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.support-ticket__user { font-size: .78rem; color: var(--muted); }
.support-ticket__time { font-size: .75rem; color: var(--muted); }
.support-ticket__body { font-size: .83rem; color: var(--muted); line-height: 1.5; }
.support-ticket__screenshot { margin-top: 6px; }
.support-ticket__screenshot img {
  max-height: 120px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: opacity .15s;
}
.support-ticket__screenshot img:hover { opacity: .85; }

/* Badges */
.support-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}
.support-badge--open     { background: #6366f120; color: #6366f1; }
.support-badge--in_progress { background: #f59e0b20; color: #f59e0b; }
.support-badge--resolved { background: #22c55e20; color: #22c55e; }
.support-badge--closed   { background: var(--border); color: var(--muted); }
.support-badge--low      { background: #22c55e15; color: #22c55e; }
.support-badge--medium   { background: #f59e0b15; color: #f59e0b; }
.support-badge--high     { background: #ef444415; color: #ef4444; }

/* Admin controls */
.support-ticket__admin {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.support-admin-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: .78rem;
  padding: 4px 8px;
  cursor: pointer;
}

/* Filter bar */
.support-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.support-filter-btn {
  padding: 5px 14px;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.support-filter-btn:hover, .support-filter-btn--active {
  border-color: #6366f1;
  color: #6366f1;
  background: #6366f110;
}

/* Empty state */
.support-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.support-empty__icon { font-size: 3rem; margin-bottom: 12px; }

/* Lightbox */
.support-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  cursor: zoom-out;
}
.support-lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

/* Admin reply box */
.support-reply-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.support-reply-thread { display: flex; flex-direction: column; gap: 8px; }
.support-reply-msg {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .82rem;
  line-height: 1.5;
}
.support-reply-msg strong { color: #6366f1; font-size: .75rem; display: block; margin-bottom: 2px; }

@media (max-width: 600px) {
  .support-modal { padding: 16px; }
  .support-ticket__top { flex-direction: column; }
}
