/* PKTok Support chat bubble (support-chat.js). Standalone on purpose — app.js and the shared
   stylesheets are never touched (docs/TERV-SUPPORT-CHAT.md). Colors ride the console's theme
   variables with safe fallbacks, so dark/light both work and a missing variable degrades to a
   sane dark look instead of breaking. */

.pk-support-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 8900;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid var(--line-2, #2c3a4d);
  background: var(--grad, linear-gradient(90deg, #2666f0, #722ed2));
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}
.pk-support-btn.pk-visible {
  display: flex;
}
.pk-support-btn:hover {
  transform: scale(1.06);
}

.pk-support-panel {
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 8901;
  width: min(370px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 110px));
  display: none;
  flex-direction: column;
  border: 1px solid var(--line-2, #2c3a4d);
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel, #0d1725);
  color: var(--text, #fff);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.pk-support-panel.pk-open {
  display: flex;
}

.pk-support-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface, #121b2a);
  border-bottom: 1px solid var(--line, #1f2a3a);
}
.pk-support-head b {
  flex: 1;
  font-size: 15px;
}
.pk-support-head button {
  background: none;
  border: none;
  color: var(--muted, #a3adbd);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
}
.pk-support-head button:hover {
  color: var(--text, #fff);
}

.pk-support-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.pk-support-msg {
  max-width: 86%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.pk-support-msg.pk-user {
  align-self: flex-end;
  background: var(--accent, #2666f0);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.pk-support-msg.pk-bot {
  align-self: flex-start;
  background: var(--surface-2, #1a2433);
  border: 1px solid var(--line, #1f2a3a);
  border-bottom-left-radius: 4px;
}
.pk-support-msg.pk-note {
  align-self: center;
  background: transparent;
  color: var(--muted, #a3adbd);
  font-size: 12.5px;
  text-align: center;
}

.pk-support-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line, #1f2a3a);
  background: var(--surface, #121b2a);
}
.pk-support-form textarea {
  flex: 1;
  resize: none;
  height: 44px;
  max-height: 110px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2, #2c3a4d);
  background: var(--field, #131d2c);
  color: var(--text, #fff);
  font: inherit;
  font-size: 14px;
}
.pk-support-form textarea:focus {
  outline: none;
  border-color: var(--accent, #2666f0);
}
.pk-support-form button {
  align-self: flex-end;
  height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: var(--accent, #2666f0);
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.pk-support-form button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Mobile: the bubble sits above the bottom nav; the OPEN panel goes FULL SCREEN (messenger
   style — owner feedback 2026-08-15: the small floating window was clumsy on a phone). 100dvh
   tracks the iOS keyboard/URL-bar; the 16px input font disables Safari's focus auto-zoom. */
@media (max-width: 900px) {
  .pk-support-btn {
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    width: 48px;
    height: 48px;
    font-size: 21px;
  }
  .pk-support-btn.pk-hidden {
    display: none;
  }
  .pk-support-panel {
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border: none;
    border-radius: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .pk-support-head {
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
  }
  .pk-support-form textarea {
    font-size: 16px; /* <16px would trigger iOS focus zoom */
  }
}

/* Own-link box (board #30): the streamer's own PKTOK link under an answer, with a Copy button.
   The URL is fetched from /api/support/own-link — it is never part of the chat text. */
.pk-support-link {
  align-self: flex-start;
  width: 86%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--accent, #2666f0);
  background: var(--surface, #121b2a);
  font-size: 13px;
}
.pk-support-link-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pk-support-link input {
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--line-2, #2c3a4d);
  background: var(--field, #131d2c);
  color: var(--text, #fff);
  font: inherit;
  font-size: 12.5px;
}
.pk-support-link button {
  padding: 7px 12px;
  border: none;
  border-radius: 8px;
  background: var(--accent, #2666f0);
  color: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.pk-support-link button.pk-secondary {
  background: var(--surface-2, #1a2433);
  border: 1px solid var(--line-2, #2c3a4d);
  color: var(--text, #fff);
}

/* Light theme rides the console's [data-theme="light"] switch. */
:root[data-theme='light'] .pk-support-panel {
  background: var(--panel, #ffffff);
  color: var(--text, #16202e);
  box-shadow: 0 16px 48px rgba(20, 30, 50, 0.18);
}

/* ── Kapcsolat page (support-contact.js) ─────────────────────────────────── */

.pk-contact {
  max-width: 1060px;
  padding: 8px 4px 40px;
}
.pk-contact h1 {
  margin: 0 0 6px;
}
.pk-contact-lead {
  color: var(--muted, #a3adbd);
  margin: 0 0 22px;
}
.pk-contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}
.pk-contact-card {
  background: var(--panel, #0d1725);
  border: 1px solid var(--line, #1f2a3a);
  border-radius: 16px;
  padding: 18px;
}
.pk-contact-card h3 {
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pk-contact-card p {
  color: var(--muted, #a3adbd);
  font-size: 14px;
  margin: 0 0 12px;
}
.pk-contact-card form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pk-contact-card input,
.pk-contact-card textarea,
.pk-contact-thread textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2, #2c3a4d);
  background: var(--field, #131d2c);
  color: var(--text, #fff);
  font: inherit;
  font-size: 14px;
  resize: vertical;
}
.pk-contact-btn {
  align-self: flex-start;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: var(--accent, #2666f0);
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.pk-contact-btn.pk-secondary {
  background: var(--surface-2, #1a2433);
  border: 1px solid var(--line-2, #2c3a4d);
}
.pk-contact-mail {
  color: var(--accent-cyan, #18b8fc);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}
.pk-contact-notice {
  font-size: 13.5px;
  color: var(--ok, #10b981);
}
.pk-contact-notice.pk-error {
  color: #f87171;
}
.pk-contact-empty {
  color: var(--muted, #a3adbd);
}
.pk-ticket-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  margin: 0 0 8px;
  border: 1px solid var(--line, #1f2a3a);
  border-radius: 12px;
  background: var(--panel, #0d1725);
  color: var(--text, #fff);
  font: inherit;
  cursor: pointer;
}
.pk-ticket-row:hover {
  border-color: var(--accent, #2666f0);
}
.pk-ticket-status {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-2, #1a2433);
}
.pk-st-open {
  color: #fbbf24;
}
.pk-st-answered {
  color: var(--ok, #10b981);
}
.pk-st-closed {
  color: var(--muted, #8b95a6);
}
.pk-ticket-subject {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pk-ticket-meta {
  flex: 0 0 auto;
  color: var(--muted, #a3adbd);
  font-size: 12.5px;
}
.pk-contact-thread {
  margin-top: 26px;
  border-top: 1px solid var(--line, #1f2a3a);
  padding-top: 18px;
}
.pk-contact-back {
  background: none;
  border: none;
  color: var(--accent-cyan, #18b8fc);
  font: inherit;
  cursor: pointer;
  padding: 0;
  margin-bottom: 10px;
}
.pk-ticket-msg {
  border: 1px solid var(--line, #1f2a3a);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 0 0 10px;
  background: var(--panel, #0d1725);
}
.pk-ticket-msg.pk-from-admin {
  border-color: var(--accent, #2666f0);
  background: var(--surface, #121b2a);
}
.pk-ticket-msg-head {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--muted, #a3adbd);
}
.pk-ticket-msg-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.pk-contact-thread form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.pk-contact-thread-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
@media (max-width: 900px) {
  .pk-ticket-meta {
    display: none;
  }
}
