/* Help modal — inline content (ported from legacy help.php) */
#helpModal #mwHelpContentRoot .help-header h1 {
  display: none;
}

#helpModal #mwHelpContentRoot .help-header {
  padding-top: 0;
  margin-bottom: 12px;
}

#helpModal.mw-page-modal {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(1180px, 88vw) !important;
  max-width: 1180px !important;
  height: min(86vh, 900px) !important;
  max-height: min(86vh, 900px) !important;
}

#helpModal.mw-page-modal.active {
  transform: translate(-50%, -50%) !important;
}

#helpModal .search-modal-content {
  padding: 0 16px 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) rgba(255, 255, 255, 0.06);
}

#helpModal .search-modal-content::-webkit-scrollbar,
#mwHelpContentRoot .help-modal-content::-webkit-scrollbar,
#mwHelpContentRoot .help-modal-body::-webkit-scrollbar {
  width: 7px;
}

#helpModal .search-modal-content::-webkit-scrollbar-track,
#mwHelpContentRoot .help-modal-content::-webkit-scrollbar-track,
#mwHelpContentRoot .help-modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
}

#helpModal .search-modal-content::-webkit-scrollbar-thumb,
#mwHelpContentRoot .help-modal-content::-webkit-scrollbar-thumb,
#mwHelpContentRoot .help-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 0;
}

#mwHelpContentRoot .help-page-container {
  max-width: 100%;
  margin: 0;
  padding: 8px 0 16px;
}

#mwHelpContentRoot .help-header {
  text-align: center;
  margin-bottom: 24px;
  padding: 12px 8px 8px;
}

#mwHelpContentRoot .help-header h1 {
  font-size: 1.65rem;
  color: #fff;
  margin-bottom: 8px;
  font-weight: 700;
}

#mwHelpContentRoot .help-header p {
  font-size: 0.95rem;
  color: #ccc;
  margin: 0;
}

/* RTL / LTR — Arabic reads right-to-left; English left-to-right */
html[dir="rtl"] #mwHelpContentRoot,
html[dir="rtl"] #mwHelpContentRoot .help-modal-body,
html[dir="rtl"] #mwHelpContentRoot .help-question-item,
html[dir="rtl"] #mwHelpContentRoot .help-category {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] #mwHelpContentRoot .help-question-icon {
  transform: scaleX(-1);
}

html[dir="ltr"] #mwHelpContentRoot,
html[dir="ltr"] #mwHelpContentRoot .help-modal-body,
html[dir="ltr"] #mwHelpContentRoot .help-question-item {
  direction: ltr;
  text-align: left;
}

html[dir="rtl"] #mwHelpContentRoot .help-modal-body ol,
html[dir="rtl"] #mwHelpContentRoot .help-modal-body ul {
  padding-right: 1.25rem;
  padding-left: 0;
}

html[dir="ltr"] #mwHelpContentRoot .help-modal-body ol,
html[dir="ltr"] #mwHelpContentRoot .help-modal-body ul {
  padding-left: 1.25rem;
  padding-right: 0;
}

#mwHelpContentRoot .help-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

#mwHelpContentRoot .help-category {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 16px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

#mwHelpContentRoot .help-category:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

#mwHelpContentRoot .help-category-icon {
  font-size: 1.75rem;
  margin-bottom: 10px;
  color: #00d9f5;
}

#mwHelpContentRoot .help-category h3 {
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 8px;
  font-weight: 600;
}

#mwHelpContentRoot .help-category p {
  color: #ccc;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
}

#mwHelpContentRoot .help-questions {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 16px;
}

#mwHelpContentRoot .help-questions h2 {
  color: #fff;
  font-size: 1.25rem;
  margin-bottom: 16px;
  font-weight: 600;
}

#mwHelpContentRoot .help-question-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#mwHelpContentRoot .help-question-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 217, 245, 0.3);
}

#mwHelpContentRoot .help-question-item h4 {
  color: #fff;
  font-size: 0.95rem;
  margin: 0;
  font-weight: 500;
  flex: 1;
}

#mwHelpContentRoot .help-question-icon {
  color: #00d9f5;
  font-size: 1rem;
  margin-inline-start: 12px;
}

#mwHelpContentRoot .help-modal {
  position: fixed;
  inset: 0;
  z-index: 20100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
}

#mwHelpContentRoot .help-modal.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

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

#mwHelpContentRoot .help-modal-content {
  position: relative;
  background: rgba(8, 10, 14, 0.92);
  backdrop-filter: blur(16px);
  border-radius: 0;
  padding: 0;
  max-width: 640px;
  width: 92%;
  max-height: 78vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
}

#mwHelpContentRoot .help-modal-header {
  background: rgba(255, 255, 255, 0.02);
  color: #fff;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

#mwHelpContentRoot .help-modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #00d9f5;
}

#mwHelpContentRoot .help-modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mwHelpContentRoot .help-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

#mwHelpContentRoot .help-modal-body {
  padding: 16px;
  color: #fff;
  flex: 1;
  overflow-y: auto;
  font-size: 0.88rem;
  line-height: 1.65;
}

#mwHelpContentRoot .help-modal-body p {
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.88);
}

#mwHelpContentRoot .help-modal-body strong {
  color: #00d9f5;
  font-weight: 600;
}

#mwHelpContentRoot .help-modal-body a {
  color: #00d9f5;
  text-decoration: none;
}

#mwHelpContentRoot .help-modal-body a:hover {
  color: #00f5a0;
}

#mwHelpContentRoot .help-modal-body .important-notice {
  background: rgba(255, 107, 107, 0.1);
  border-left: 3px solid #ff6b6b;
  padding: 10px 12px;
  border-radius: 0;
  margin-bottom: 14px;
}

#mwHelpContentRoot .help-modal-body ol,
#mwHelpContentRoot .help-modal-body ul {
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 16px 12px 28px;
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 14px;
}

@media (max-width: 768px) {
  #helpModal.mw-page-modal {
    width: 96vw !important;
    height: min(92vh, 100dvh) !important;
    max-height: min(92vh, 100dvh) !important;
  }
  #mwHelpContentRoot .help-categories {
    grid-template-columns: 1fr;
  }
}
