/* ============================================================
   THE HIDEOUT — tickets.css (v2)
   Player support tickets: list + live thread view. After styles.css.
   ============================================================ */

.tk-page { padding: calc(var(--nav-h) + 48px) 0 96px; position: relative; z-index: 1; }

.tickets-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 30px; }
.tickets-head h1 { font-size: clamp(34px, 5vw, 54px); }
.tickets-head .sub { font-family: var(--mono); font-size: 12.5px; color: var(--fg-muted); margin-top: 10px; letter-spacing: .04em; }

/* ---- the "New Ticket" / "Send Reply" button ---- */
.btn-queue {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 13px 22px;
  border-radius: 999px; font-family: var(--display); font-weight: 600; font-size: 15px;
  background: linear-gradient(180deg, var(--aqua-bright), var(--aqua)); color: var(--on-aqua);
  box-shadow: 0 0 0 1px rgba(34,211,238,.4), 0 8px 30px -8px rgba(34,211,238,.6);
  transition: transform .2s var(--ease), box-shadow .25s var(--ease);
}
.btn-queue:hover { transform: translateY(-2px); }
.btn-queue:disabled { opacity: .55; transform: none; cursor: default; }

/* ---- tab filters ---- */
.player-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.player-tabs button {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-strong);
  font-size: 13.5px; color: var(--fg-muted); font-family: var(--display); font-weight: 600; transition: all .2s;
  min-height: 42px;
}
.player-tabs button:hover { color: var(--fg); border-color: var(--aqua-line); }
.player-tabs button.on { background: var(--aqua); color: var(--on-aqua); border-color: var(--aqua); }

/* ---- list ---- */
.status-list { display: grid; gap: 10px; }
.status-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s, transform .1s;
}
.status-list .status-row[data-open] { cursor: pointer; }
.status-list .status-row[data-open]:hover { border-color: var(--aqua-line); transform: translateY(-1px); }
.status-row > div:first-child { flex: 1; min-width: 0; }
.status-row .title { font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--fg); }
.status-row .sub { font-family: var(--mono); font-size: 11.5px; color: var(--fg-dim); margin-top: 5px; line-height: 1.5; word-break: break-word; }
.status-row .sub a { color: var(--aqua); }
.status-row .when { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); white-space: nowrap; }

/* ---- status badges ---- */
.badge-status {
  font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; flex: none;
}
.badge-status.open, .badge-status.review, .badge-status.interview { color: #38bdf8; background: rgba(56,189,248,.12); }
.badge-status.awaiting, .badge-status.pending, .badge-status.submitted, .badge-status.returned { color: #fbbf24; background: rgba(251,191,36,.12); }
.badge-status.resolved, .badge-status.accepted, .badge-status.approved { color: #4ade80; background: rgba(74,222,128,.12); }
.badge-status.denied, .badge-status.rejected { color: #f87171; background: rgba(248,113,113,.12); }

/* ---- thread detail ---- */
#ticket-detail { display: none; }
.td-back { font-family: var(--mono); font-size: 12px; color: var(--fg-muted); letter-spacing: .12em; text-transform: uppercase; background: none; border: none; padding: 6px 0; min-height: 44px; }
.td-back:hover { color: var(--aqua); }
.td-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 6px; }
.td-head h2 { font-size: clamp(24px, 3vw, 34px); }
.td-meta { font-family: var(--mono); font-size: 11.5px; color: var(--fg-dim); margin: 8px 0 24px; word-break: break-word; }

.thread { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.msg { max-width: 80%; padding: 13px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.msg.mine { align-self: flex-end; border-color: var(--aqua-line); background: var(--aqua-ghost); border-bottom-right-radius: 4px; }
.msg.staff { align-self: flex-start; border-bottom-left-radius: 4px; }
.msg .who { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 6px; }
.msg .who .st { color: var(--aqua); }
.msg .txt { font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; color: var(--fg); word-break: break-word; }
.msg .ts { font-family: var(--mono); font-size: 10px; color: var(--fg-dim); margin-top: 6px; }
.msg .ts a { color: var(--aqua); }
.msg-sys { align-self: center; text-align: center; font-family: var(--mono); font-size: 11px; color: var(--fg-muted);
  background: var(--surface); border: 1px solid var(--line); padding: 7px 16px; border-radius: 999px; max-width: 90%; }

/* ---- attachments + embeds ---- */
.tk-atts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
.tk-att-img { max-width: 260px; max-height: 220px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; display: block; }
.tk-att-vid { max-width: 320px; max-height: 240px; border-radius: 8px; border: 1px solid var(--line); background: #000; }
.tk-att-exp { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 12px; }
.tk-embed-yt { position: relative; width: min(400px, 100%); aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.tk-embed-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.tk-embed { display: flex; gap: 12px; text-decoration: none; max-width: 420px; border: 1px solid var(--line); border-left: 3px solid var(--aqua); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.tk-embed:hover { border-color: var(--aqua-line); }
.tk-embed-img { flex-shrink: 0; width: 96px; background-size: cover; background-position: center; }
.tk-embed-body { padding: 10px 12px; min-width: 0; }
.tk-embed-site { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 3px; }
.tk-embed-title { font-size: 13px; font-weight: 600; color: var(--aqua); margin-bottom: 3px; }
.tk-embed-desc { font-size: 12px; color: var(--fg-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- reply box ---- */
.reply-box textarea { width: 100%; background: var(--bg-1); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--fg);
  font-family: var(--mono); font-size: 14px; line-height: 1.7; padding: 13px 15px; min-height: 110px; resize: vertical; outline: none; }
.reply-box textarea:focus { border-color: var(--aqua); box-shadow: 0 0 0 3px var(--aqua-ghost); }
.reply-box textarea::placeholder { color: var(--fg-dim); }
.reply-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.reply-actions .btn-queue { margin-left: auto; }

.tk-file-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tk-chip { font-family: var(--mono); font-size: 11.5px; color: var(--fg); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 8px 4px 12px; display: inline-flex; align-items: center; gap: 5px; }
.tk-chip button { color: var(--fg-dim); font-size: 13px; padding: 0 2px; }
.tk-chip button:hover { color: var(--aqua); }
.tk-attach-btn { border: 1px solid var(--line-strong); color: var(--fg-muted); border-radius: 999px; padding: 10px 14px; font-family: var(--mono); font-size: 12px; cursor: pointer; min-height: 44px; }
.tk-attach-btn:hover { border-color: var(--aqua-line); color: var(--aqua); }
#td-body.drag { outline: 2px dashed var(--aqua); outline-offset: 2px; }
.reply-closed { font-family: var(--mono); font-size: 12px; color: var(--fg-muted); text-align: center; padding: 16px; border: 1px dashed var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; }
.reply-closed a { color: var(--aqua); }

/* ---- typing indicator ---- */
.typing-ind { font-family: var(--mono); font-size: 12px; color: var(--fg-muted); padding: 2px 4px 14px; }
.typing-ind .ti-name { color: var(--aqua); }
.ti-dots { display: inline-flex; gap: 3px; margin-left: 4px; }
.ti-dots b { width: 4px; height: 4px; border-radius: 50%; background: var(--fg-muted); display: inline-block; animation: tiBlink 1.2s infinite; }
.ti-dots b:nth-child(2) { animation-delay: .2s; } .ti-dots b:nth-child(3) { animation-delay: .4s; }
@keyframes tiBlink { 0%,60%,100% { opacity: .2; } 30% { opacity: 1; } }

@media (max-width: 560px) { .msg { max-width: 94%; } }
