/* The support channels (Zalo, Telegram, email): a list on the support page,
   and the same list inside the home page's floating Hỗ trợ button. Split from
   style.css, which only the pages that show a channel need. */

.channels {
  margin: 28px 0 0;
  padding: 6px;
  list-style: none;
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid var(--hairline);
}

.channel {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 14px;
  border-radius: 16px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color var(--press) ease;
}

.channel:hover {
  background: var(--glass-hover);
}

.channel .icon {
  flex: none;
  color: var(--silver);
}

.channel-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.channel-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.channel-where {
  font-size: 14px;
  color: var(--body);
  overflow-wrap: anywhere;
}

.channel .go {
  flex: none;
  color: var(--muted);
}

/* ---- The floating Hỗ trợ button, home page only ---------------------------
   A <details>: it opens and closes with no script, and a screen reader hears
   whether it is open. help.js adds Escape and a tap outside to close it. */

.help {
  position: fixed;
  z-index: 10;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
}

.help-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 20px 0 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ground);
  font-size: 15px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.2);
  transition: transform var(--press) ease;
}

.help-button::-webkit-details-marker {
  display: none;
}

.help-button:active {
  transform: scale(0.97);
}

.help-button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.help-button .icon-close,
.help[open] .help-button .icon-open {
  display: none;
}

.help[open] .help-button .icon-close {
  display: block;
}

.help-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(340px, calc(100vw - 32px));
  /* A phone on its side or a page zoomed to 400 % is short: the panel scrolls
     inside itself rather than running off the top, where nothing reaches it. */
  max-height: calc(100vh - 100px);
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 14px 14px;
  border-radius: 24px;
  background: #151517;
  border: 1px solid var(--edge);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.help-title {
  padding: 0 8px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.help-text {
  margin-top: 4px;
  padding: 0 8px;
  font-size: 14px;
  color: var(--body);
}

.help-panel .channels {
  margin-top: 14px;
  padding: 0;
  background: none;
  border: 0;
}

.help-more {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 6px;
  border-top: 1px solid var(--hairline);
  color: var(--silver);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.help-more:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* The button sits over the page's last line: leave it room to scroll clear. */
.help ~ .footer nav {
  padding-bottom: calc(max(28px, env(safe-area-inset-bottom)) + 72px);
}

@media (prefers-reduced-motion: no-preference) {
  .help[open] .help-panel {
    animation: help-open 180ms var(--ease-out);
  }

  @keyframes help-open {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .channel,
  .help-button {
    transition: none;
  }
}

@media (forced-colors: active) {
  .help-button,
  .help-panel {
    border: 1px solid CanvasText;
  }
}
