/* ================= Help Modal / Keyboard Shortcuts ================= */
.help-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.help-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.help-modal-content {
  position: relative;
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Dark mode: ensure solid blue gradient background - fully opaque */
html:not(.light) .help-modal-content {
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f172a 100%) !important;
  background-color: #1a1a2e !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 1 !important;
  mix-blend-mode: normal !important;
  isolation: isolate !important;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.help-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.help-modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.help-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.help-modal-close:hover {
  background: rgba(255, 255, 255, .05);
  color: var(--text);
}

.help-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.shortcut-item:last-child {
  border-bottom: none;
}

.shortcut-keys {
  display: flex;
  gap: 4px;
  align-items: center;
}

.shortcut-keys kbd {
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 8px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
  min-width: 24px;
  text-align: center;
}

.shortcut-desc {
  color: var(--text-dim);
  font-size: 14px;
  margin-left: 16px;
  flex: 1;
}

html.light .shortcut-keys kbd {
  background: #ffffff;
  border-color: rgba(0, 0, 0, .15);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

/* Help Modal - Large variant */
.help-modal-large .help-modal-content {
  max-width: 700px;
}

/* Light mode help modal */
html.light .help-modal-content {
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

/* Help Modal Tabs */
.help-modal-tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.help-modal-tabs::-webkit-scrollbar {
  display: none;
}

.help-tab {
  background: none;
  border: none;
  padding: 12px 16px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.help-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .03);
}

.help-tab.active {
  color: var(--text);
  border-bottom-color: var(--dx-emerald);
}

/* Help Tab Content */
.help-tab-content {
  display: none;
}

.help-tab-content.active {
  display: block;
}

.help-tab-content h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.help-tab-content > p {
  margin: 0 0 24px 0;
  color: var(--text-dim);
  line-height: 1.6;
}

.help-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.help-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.help-section h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.help-section p {
  margin: 0;
  color: var(--text-dim);
  line-height: 1.6;
  font-size: 14px;
}

.help-section ul {
  margin: 8px 0;
  padding-left: 20px;
  color: var(--text-dim);
}

.help-section li {
  margin: 4px 0;
  line-height: 1.6;
}

.help-section kbd {
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

/* FAQ Accordion */
.faq-item {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item:hover {
  border-color: rgba(255, 255, 255, .2);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 16px;
  text-align: left;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: background 0.2s ease;
}

.faq-question:hover {
  background: rgba(255, 255, 255, .03);
}

.faq-question svg {
  flex-shrink: 0;
  transition: transform 0.3s ease;
  color: var(--text-dim);
}

.faq-question[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: rgba(255, 255, 255, .02);
}

.faq-answer p {
  padding: 0 16px 16px 16px;
  margin: 0;
  color: var(--text-dim);
  line-height: 1.6;
  font-size: 14px;
}

.faq-answer kbd {
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

html.light .faq-answer {
  background: rgba(0, 0, 0, .02);
}

html.light .faq-answer kbd {
  background: #ffffff;
  border-color: rgba(0, 0, 0, .15);
}
