/*
 * TGF TicketDesk — Powered by The Geek Factory PTY LTD
 * Frontend ticketing system skin.
 */

.tgf-ticketdesk,
.tgf-ticketdesk * {
  box-sizing: border-box;
}

.tgf-ticketdesk {
  --td-bg: rgba(5, 12, 20, 0.86);
  --td-bg-soft: rgba(10, 25, 38, 0.76);
  --td-panel: rgba(8, 18, 30, 0.9);
  --td-border: rgba(54, 228, 255, 0.28);
  --td-border-strong: rgba(54, 228, 255, 0.52);
  --td-cyan: #36e4ff;
  --td-text: #eefbff;
  --td-muted: rgba(238, 251, 255, 0.68);
  --td-danger: #ff5b7a;
  --td-warning: #ffc857;
  --td-success: #50f29d;
  --td-radius: 18px;
  --td-shadow: 0 24px 80px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 2.5vw, 34px);
  color: var(--td-text);
  background:
    radial-gradient(circle at top left, rgba(54, 228, 255, 0.14), transparent 34%),
    linear-gradient(135deg, rgba(5, 12, 20, 0.92), rgba(4, 8, 14, 0.86));
  border: 1px solid var(--td-border);
  border-radius: calc(var(--td-radius) + 6px);
  box-shadow: var(--td-shadow);
  backdrop-filter: blur(14px);
}

.tgf-ticketdesk a {
  color: var(--td-cyan);
}

.tgf-td-header,
.tgf-td-card-head,
.tgf-td-ticket-title-row,
.tgf-td-form-actions,
.tgf-td-reply-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tgf-td-header {
  margin-bottom: 20px;
}

.tgf-td-header h2,
.tgf-td-card h3,
.tgf-td-ticket-view h3 {
  margin: 0;
  color: var(--td-text);
  line-height: 1.1;
}

.tgf-td-header h2 {
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: -0.04em;
}

.tgf-td-eyebrow,
.tgf-td-ref {
  margin: 0 0 8px;
  color: var(--td-cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tgf-td-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.tgf-td-btn,
.tgf-ticketdesk button.tgf-td-btn,
.tgf-ticketdesk input[type="submit"].tgf-td-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 11px 18px;
  border: 1px solid var(--td-border-strong);
  border-radius: 999px;
  color: #031018;
  background: linear-gradient(135deg, var(--td-cyan), #9df5ff);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(54, 228, 255, 0.18);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tgf-td-btn:hover,
.tgf-ticketdesk button.tgf-td-btn:hover {
  transform: translateY(-1px);
}

.tgf-td-btn-ghost {
  color: var(--td-text);
  background: rgba(54, 228, 255, 0.08);
}

.tgf-td-card {
  margin-top: 16px;
  padding: clamp(16px, 2.2vw, 24px);
  background: linear-gradient(145deg, rgba(6, 16, 27, 0.92), rgba(7, 22, 34, 0.78));
  border: 1px solid var(--td-border);
  border-radius: var(--td-radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tgf-td-card-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(54, 228, 255, 0.18);
}

.tgf-td-card-head span,
.tgf-td-meta-grid span,
.tgf-td-reply-head span {
  color: var(--td-muted);
  font-size: 13px;
}

.tgf-td-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(54, 228, 255, 0.18);
  border-radius: 14px;
}

.tgf-td-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  color: var(--td-text);
}

.tgf-td-table th,
.tgf-td-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(54, 228, 255, 0.12);
  text-align: left;
  vertical-align: middle;
}

.tgf-td-table th {
  color: var(--td-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(54, 228, 255, 0.05);
}

.tgf-td-table tr:last-child td {
  border-bottom: 0;
}

.tgf-td-small-link {
  display: inline-flex;
  padding: 8px 12px;
  border: 1px solid rgba(54, 228, 255, 0.3);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
}

.tgf-td-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 2px 4px 2px 0;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: var(--td-text);
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.tgf-td-status-open,
.tgf-td-status-in_progress {
  border-color: rgba(54, 228, 255, 0.45);
  background: rgba(54, 228, 255, 0.12);
}

.tgf-td-status-awaiting_customer {
  border-color: rgba(255, 200, 87, 0.55);
  background: rgba(255, 200, 87, 0.12);
}

.tgf-td-status-resolved {
  border-color: rgba(80, 242, 157, 0.55);
  background: rgba(80, 242, 157, 0.12);
}

.tgf-td-status-closed {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.tgf-td-priority-high,
.tgf-td-priority-urgent {
  border-color: rgba(255, 91, 122, 0.55);
  background: rgba(255, 91, 122, 0.13);
}

.tgf-td-priority-low {
  border-color: rgba(80, 242, 157, 0.4);
  background: rgba(80, 242, 157, 0.09);
}

.tgf-td-form label {
  display: block;
  margin-bottom: 15px;
  color: var(--td-text);
  font-weight: 800;
}

.tgf-td-form label span {
  color: var(--td-cyan);
}

.tgf-ticketdesk input[type="text"],
.tgf-ticketdesk select,
.tgf-ticketdesk textarea {
  width: 100%;
  margin-top: 8px;
  padding: 13px 14px;
  border: 1px solid rgba(54, 228, 255, 0.28);
  border-radius: 12px;
  color: var(--td-text);
  background: rgba(3, 10, 18, 0.76);
  outline: none;
}

.tgf-ticketdesk textarea {
  resize: vertical;
  min-height: 130px;
}

.tgf-ticketdesk input:focus,
.tgf-ticketdesk select:focus,
.tgf-ticketdesk textarea:focus {
  border-color: var(--td-cyan);
  box-shadow: 0 0 0 3px rgba(54, 228, 255, 0.12);
}

.tgf-td-grid-2,
.tgf-td-grid-3,
.tgf-td-meta-grid {
  display: grid;
  gap: 14px;
}

.tgf-td-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tgf-td-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tgf-td-meta-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0;
}

.tgf-td-meta-grid div {
  padding: 14px;
  border: 1px solid rgba(54, 228, 255, 0.16);
  border-radius: 14px;
  background: rgba(54, 228, 255, 0.05);
}

.tgf-td-meta-grid strong,
.tgf-td-meta-grid span {
  display: block;
}

.tgf-td-original-message,
.tgf-td-reply-body {
  color: rgba(238, 251, 255, 0.84);
  line-height: 1.65;
}

.tgf-td-ticket-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tgf-td-status-form {
  border-color: rgba(255, 200, 87, 0.28);
}

.tgf-td-replies {
  display: grid;
  gap: 14px;
}

.tgf-td-reply {
  padding: 16px;
  border: 1px solid rgba(54, 228, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.tgf-td-reply.is-staff {
  border-color: rgba(54, 228, 255, 0.36);
  background: rgba(54, 228, 255, 0.075);
}

.tgf-td-reply-head {
  margin-bottom: 10px;
}

.tgf-td-notice {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 800;
}

.tgf-td-notice-success {
  color: var(--td-text);
  border: 1px solid rgba(80, 242, 157, 0.42);
  background: rgba(80, 242, 157, 0.12);
}

.tgf-td-notice-error {
  color: var(--td-text);
  border: 1px solid rgba(255, 91, 122, 0.42);
  background: rgba(255, 91, 122, 0.13);
}

.tgf-td-empty {
  padding: 34px 18px;
  text-align: center;
}

.tgf-td-empty-small {
  padding: 18px;
}

.tgf-td-login-gate {
  text-align: center;
}

@media (max-width: 820px) {
  .tgf-td-header,
  .tgf-td-card-head,
  .tgf-td-ticket-title-row,
  .tgf-td-form-actions,
  .tgf-td-reply-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .tgf-td-header-actions,
  .tgf-td-form-actions,
  .tgf-td-ticket-badges {
    justify-content: flex-start;
    width: 100%;
  }

  .tgf-td-btn,
  .tgf-ticketdesk button.tgf-td-btn {
    width: 100%;
  }

  .tgf-td-grid-2,
  .tgf-td-grid-3,
  .tgf-td-meta-grid {
    grid-template-columns: 1fr;
  }
}

/* v1.1 polish: HUD-safe layout, stronger button contrast, tighter form rhythm. */
.tgf-ticketdesk.tgf-td-layout-hud {
  max-height: clamp(420px, 43vh, 720px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(54, 228, 255, 0.62) rgba(3, 10, 18, 0.55);
}

.tgf-ticketdesk.tgf-td-layout-hud::-webkit-scrollbar {
  width: 9px;
}

.tgf-ticketdesk.tgf-td-layout-hud::-webkit-scrollbar-track {
  background: rgba(3, 10, 18, 0.55);
  border-radius: 999px;
}

.tgf-ticketdesk.tgf-td-layout-hud::-webkit-scrollbar-thumb {
  background: rgba(54, 228, 255, 0.62);
  border-radius: 999px;
}

.tgf-ticketdesk a.tgf-td-btn,
.tgf-ticketdesk a.tgf-td-btn:visited {
  color: #031018;
}

.tgf-ticketdesk a.tgf-td-btn-ghost,
.tgf-ticketdesk a.tgf-td-btn-ghost:visited {
  color: var(--td-text);
}

.tgf-ticketdesk a.tgf-td-btn.is-active {
  border-color: rgba(255, 255, 255, 0.64);
  box-shadow: 0 0 0 3px rgba(54, 228, 255, 0.12), 0 10px 30px rgba(54, 228, 255, 0.24);
}

.tgf-td-layout-hud .tgf-td-header {
  margin-bottom: 14px;
}

.tgf-td-layout-hud .tgf-td-header h2 {
  font-size: clamp(25px, 3vw, 36px);
}

.tgf-td-layout-hud .tgf-td-card {
  margin-top: 12px;
  padding: clamp(14px, 1.7vw, 20px);
}

.tgf-td-layout-hud .tgf-td-card-head {
  margin-bottom: 12px;
  padding-bottom: 10px;
}

.tgf-td-layout-hud .tgf-td-form label {
  margin-bottom: 11px;
}

.tgf-td-layout-hud .tgf-ticketdesk input[type="text"],
.tgf-td-layout-hud .tgf-ticketdesk select,
.tgf-td-layout-hud .tgf-ticketdesk textarea,
.tgf-ticketdesk.tgf-td-layout-hud input[type="text"],
.tgf-ticketdesk.tgf-td-layout-hud select,
.tgf-ticketdesk.tgf-td-layout-hud textarea {
  min-height: 42px;
  padding: 11px 13px;
  line-height: 1.25;
}

.tgf-ticketdesk.tgf-td-layout-hud textarea {
  min-height: 96px;
}

.tgf-td-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.tgf-td-stat {
  padding: 12px;
  border: 1px solid rgba(54, 228, 255, 0.16);
  border-radius: 14px;
  background: rgba(54, 228, 255, 0.055);
}

.tgf-td-stat strong,
.tgf-td-stat span {
  display: block;
}

.tgf-td-stat strong {
  color: var(--td-text);
  font-size: 24px;
  line-height: 1;
}

.tgf-td-stat span {
  margin-top: 6px;
  color: var(--td-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 920px) {
  .tgf-ticketdesk.tgf-td-layout-hud {
    max-height: none;
    overflow-y: visible;
  }

  .tgf-td-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* v1.3.2: better HUD spacing — no outer scrollbar for the new-ticket form. */
.tgf-ticketdesk.tgf-td-layout-hud {
  max-height: none;
  overflow-y: visible;
  padding: clamp(13px, 1.6vw, 22px);
}

.tgf-td-layout-hud .tgf-td-header {
  margin-bottom: 10px;
}

.tgf-td-layout-hud .tgf-td-card {
  margin-top: 10px;
  padding: clamp(12px, 1.45vw, 18px);
}

.tgf-td-layout-hud .tgf-td-card-head {
  margin-bottom: 9px;
  padding-bottom: 8px;
}

.tgf-td-layout-hud .tgf-td-card-head h3 {
  font-size: clamp(17px, 1.7vw, 22px);
}

.tgf-td-layout-hud .tgf-td-form label {
  margin-bottom: 9px;
  font-size: 13px;
}

.tgf-ticketdesk.tgf-td-layout-hud input[type="text"],
.tgf-ticketdesk.tgf-td-layout-hud select,
.tgf-ticketdesk.tgf-td-layout-hud textarea {
  min-height: 39px;
  margin-top: 5px;
  padding: 9px 12px;
}

.tgf-ticketdesk.tgf-td-layout-hud textarea[name="tgf_message"] {
  min-height: 76px;
}

.tgf-ticketdesk.tgf-td-layout-hud textarea[name="tgf_reply"] {
  min-height: 86px;
}

.tgf-td-layout-hud .tgf-td-grid-2,
.tgf-td-layout-hud .tgf-td-grid-3,
.tgf-td-layout-hud .tgf-td-meta-grid {
  gap: 10px;
}

.tgf-td-layout-hud .tgf-td-form-actions {
  margin-top: 4px;
}

.tgf-td-layout-hud .tgf-td-table-wrap {
  max-height: 280px;
  overflow: auto;
}

.tgf-td-layout-hud .tgf-td-replies {
  max-height: 230px;
  overflow-y: auto;
  padding-right: 6px;
}

@media (max-width: 920px) {
  .tgf-ticketdesk.tgf-td-layout-hud {
    padding: 16px;
  }

  .tgf-td-layout-hud .tgf-td-table-wrap,
  .tgf-td-layout-hud .tgf-td-replies {
    max-height: none;
    overflow: visible;
  }
}
