/* ============================================================
   Help Center — Slide-out Panel, Walkthroughs, FAQ, Chat
   ============================================================ */

/* ── Panel overlay & container ────────────────────────────── */

.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.help-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.help-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-color-2);
  border-left: 1px solid var(--glass-border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
  z-index: 9001;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.help-panel.open {
  right: 0;
}

/* ── Panel header ─────────────────────────────────────────── */

.help-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.help-panel-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-panel-header h3 .material-symbols-rounded {
  color: var(--accent-cyan);
  font-size: 20px;
}

.help-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.help-close-btn:hover {
  color: var(--text-main);
  background: var(--glass-bg-hover);
}

/* ── Tabs ─────────────────────────────────────────────────── */

.help-tabs {
  display: flex;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.help-tab {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}

.help-tab:hover {
  color: var(--text-main);
}

.help-tab.active {
  color: var(--accent-cyan);
}

.help-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  width: 60%;
  height: 2px;
  background: var(--accent-cyan);
  border-radius: 2px 2px 0 0;
}

/* ── Tab content area ─────────────────────────────────────── */

.help-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.help-tab-content::-webkit-scrollbar {
  width: 4px;
}

.help-tab-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* ── Walkthroughs tab ─────────────────────────────────────── */

.help-walkthrough-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.help-walkthrough-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.help-walkthrough-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-highlight);
  transform: translateY(-1px);
}

.help-walkthrough-card h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.help-walkthrough-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.help-walkthrough-card .help-wt-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--accent-cyan);
  opacity: 0.8;
}

.help-walkthrough-card .help-wt-meta .material-symbols-rounded {
  font-size: 14px;
}

/* ── Walkthrough spotlight overlay ────────────────────────── */

.help-spotlight-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}

.help-spotlight-overlay.active {
  pointer-events: auto;
}

.help-spotlight-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 10001;
  transition: opacity 0.25s ease;
}

.help-spotlight-hole {
  position: fixed;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
  z-index: 10002;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.help-spotlight-tooltip {
  position: fixed;
  z-index: 10003;
  background: var(--bg-color-2);
  border: 1px solid var(--glass-border-highlight);
  border-radius: 12px;
  padding: 16px 20px;
  max-width: 320px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  animation: helpTooltipIn 0.25s ease;
}

@keyframes helpTooltipIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.help-spotlight-tooltip h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.help-spotlight-tooltip p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.help-spotlight-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.help-spotlight-progress {
  font-size: 11px;
  color: var(--text-muted);
}

.help-spotlight-btns {
  display: flex;
  gap: 8px;
}

.help-spotlight-btns button {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}

.help-wt-skip {
  background: var(--glass-bg);
  color: var(--text-muted);
  border: 1px solid var(--glass-border) !important;
}

.help-wt-skip:hover {
  background: var(--glass-bg-hover);
  color: var(--text-main);
}

.help-wt-next {
  background: var(--accent-cyan);
  color: var(--text-dark);
}

.help-wt-next:hover {
  background: #33EAFF;
}

/* ── FAQ tab ──────────────────────────────────────────────── */

.help-faq-search {
  width: 100%;
  padding: 10px 14px 10px 36px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 13px;
  font-family: var(--font-family);
  margin-bottom: 12px;
  transition: border-color 0.15s;
}

.help-faq-search:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.help-faq-search-wrap {
  position: relative;
}

.help-faq-search-wrap .material-symbols-rounded {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.help-faq-section {
  margin-bottom: 16px;
}

.help-faq-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
  opacity: 0.7;
  margin-bottom: 8px;
}

.help-faq-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  margin-bottom: 6px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.help-faq-item:hover {
  border-color: var(--glass-border-highlight);
}

.help-faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  gap: 8px;
}

.help-faq-q span:first-child {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  flex: 1;
}

.help-faq-q .material-symbols-rounded {
  font-size: 18px;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.help-faq-item.open .help-faq-q .material-symbols-rounded {
  transform: rotate(180deg);
}

.help-faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.help-faq-item.open .help-faq-a {
  max-height: 300px;
}

.help-faq-a-inner {
  padding: 0 14px 12px 14px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.help-faq-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Chat tab ─────────────────────────────────────────────── */

.help-chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.help-chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 12px;
}

.help-chat-messages::-webkit-scrollbar {
  width: 4px;
}

.help-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.help-chat-welcome {
  text-align: center;
  padding: 24px 8px;
}

.help-chat-welcome .material-symbols-rounded {
  font-size: 36px;
  color: var(--accent-cyan);
  margin-bottom: 8px;
}

.help-chat-welcome h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.help-chat-welcome p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.help-chat-msg {
  display: flex;
  gap: 8px;
  max-width: 95%;
}

.help-chat-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.help-chat-msg.user .help-chat-bubble {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: var(--text-dark);
  border-bottom-right-radius: 4px;
}

.help-chat-msg.assistant .help-chat-bubble {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
}

.help-chat-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.help-chat-bubble strong {
  color: #80E8FF;
  font-weight: 600;
}

.help-chat-thinking {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

.help-chat-thinking span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  animation: helpDotBounce 1.2s ease-in-out infinite;
}

.help-chat-thinking span:nth-child(2) { animation-delay: 0.2s; }
.help-chat-thinking span:nth-child(3) { animation-delay: 0.4s; }

@keyframes helpDotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-5px); opacity: 1; }
}

/* ── Chat input ───────────────────────────────────────────── */

.help-chat-input-wrap {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.help-chat-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 13px;
  font-family: var(--font-family);
  transition: border-color 0.15s;
}

.help-chat-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.help-chat-input::placeholder {
  color: var(--text-muted);
}

.help-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-cyan);
  color: var(--text-dark);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.help-chat-send:hover {
  background: #33EAFF;
}

.help-chat-send .material-symbols-rounded {
  font-size: 18px;
}

/* ── Topbar help button ───────────────────────────────────── */

.help-trigger-btn {
  position: relative;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 768px) {
  .help-panel {
    width: 100vw;
    max-width: 100vw;
    right: -100vw;
  }
}
