/* ==========================================================================
   Help & Workflows Sidebar — Layout and Component Styles
   All units in rem (0.0625rem = 1px). Zero px values.
   Dark theme is DEFAULT (:root), light overrides via [data-theme="light"].
   Accent: Solvuh green (#22c55e) and emerald (#10b981).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties — Dark Theme (Default)
   -------------------------------------------------------------------------- */
:root {
  --sidebar-bg: #0f172a;
  --sidebar-border: #334155;
  --sidebar-text: #e2e8f0;
  --sidebar-link-color: #94a3b8;
  --sidebar-link-hover: #e2e8f0;
  --sidebar-active-bg: rgba(34, 197, 94, 0.15);
  --sidebar-active-border: #22c55e;
  --page-bg: #0f172a;
  --main-text: #e2e8f0;
  --main-heading: #f1f5f9;
  --breadcrumb-text: #94a3b8;
  --breadcrumb-link: #22c55e;
  --card-bg: #1e293b;
  --card-border: #334155;
  --step-counter-from: #22c55e;
  --step-counter-to: #10b981;
  --step-bg: #1e293b;
  --accent-primary: #22c55e;
  --accent-secondary: #10b981;
}

/* --------------------------------------------------------------------------
   2. Light Theme Overrides
   -------------------------------------------------------------------------- */
[data-theme="light"] {
  --sidebar-bg: #f8fafc;
  --sidebar-border: #e2e8f0;
  --sidebar-text: #1e293b;
  --sidebar-link-color: #64748b;
  --sidebar-link-hover: #1e293b;
  --sidebar-active-bg: rgba(34, 197, 94, 0.1);
  --sidebar-active-border: #22c55e;
  --page-bg: #f8fafc;
  --main-text: #1e293b;
  --main-heading: #0f172a;
  --breadcrumb-text: #64748b;
  --breadcrumb-link: #16a34a;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --step-counter-from: #22c55e;
  --step-counter-to: #10b981;
  --step-bg: #f1f5f9;
  --accent-primary: #22c55e;
  --accent-secondary: #10b981;
}

/* --------------------------------------------------------------------------
   3. Workflow Page — Top-Level Flex Container
   -------------------------------------------------------------------------- */
.workflow-page {
  display: flex;
  min-height: 100vh;
  background: var(--page-bg);
}

/* --------------------------------------------------------------------------
   4. Sidebar — Fixed Width, Sticky, Mobile Slide-In
   -------------------------------------------------------------------------- */
.workflow-sidebar {
  width: 17.5rem;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--sidebar-bg);
  border-right: 0.0625rem solid var(--sidebar-border);
  padding: 1.5rem 0;
  z-index: 100;
}

@media (max-width: 48rem) {
  .workflow-sidebar {
    position: fixed;
    left: -18rem;
    transform: translateX(0);
    transition: transform 0.3s;
    z-index: 1000;
  }

  .workflow-sidebar.open {
    transform: translateX(18rem);
  }
}

/* --------------------------------------------------------------------------
   5. Sidebar title
   -------------------------------------------------------------------------- */
.sidebar-title {
  padding: 0.5rem 1.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sidebar-link-color);
}

/* --------------------------------------------------------------------------
   6. Category <details> wrapper
   -------------------------------------------------------------------------- */
.sidebar-category {
  border: none;
  margin: 0;
  padding: 0;
}

/* --------------------------------------------------------------------------
   7. Category summary — min-height 2.75rem for touch target
   -------------------------------------------------------------------------- */
.sidebar-category summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  min-height: 2.75rem;
  cursor: pointer;
  color: var(--sidebar-text);
  font-weight: 600;
  font-size: 0.875rem;
  list-style: none;
  border: none;
  background: transparent;
  transition: background 0.2s;
}

/* --------------------------------------------------------------------------
   8. Remove default marker
   -------------------------------------------------------------------------- */
.sidebar-category summary::-webkit-details-marker {
  display: none;
}

/* --------------------------------------------------------------------------
   9. Chevron icon via FontAwesome
   -------------------------------------------------------------------------- */
.sidebar-category summary::before {
  content: "\f054";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.625rem;
  transition: transform 0.2s;
  margin-right: 0.5rem;
  width: 0.75rem;
  display: inline-block;
}

/* --------------------------------------------------------------------------
   10. Rotate chevron when open
   -------------------------------------------------------------------------- */
.sidebar-category[open] summary::before {
  transform: rotate(90deg);
}

/* --------------------------------------------------------------------------
   11. Summary hover
   -------------------------------------------------------------------------- */
.sidebar-category summary:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .sidebar-category summary:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* --------------------------------------------------------------------------
   12. Icon inside summary
   -------------------------------------------------------------------------- */
.sidebar-category summary i {
  width: 1.25rem;
  text-align: center;
  font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   13. Sidebar pages list
   -------------------------------------------------------------------------- */
.sidebar-pages {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* --------------------------------------------------------------------------
   14. Sidebar links — min-height 2.75rem for touch target
   -------------------------------------------------------------------------- */
.sidebar-category a,
.sidebar-pages a {
  display: flex;
  align-items: center;
  padding: 0.5rem 1.5rem 0.5rem 3rem;
  min-height: 2.75rem;
  color: var(--sidebar-link-color);
  text-decoration: none;
  font-size: 0.8125rem;
  border-left: 0.1875rem solid transparent;
  transition: all 0.2s;
}

/* --------------------------------------------------------------------------
   15. Sidebar link hover
   -------------------------------------------------------------------------- */
.sidebar-category a:hover,
.sidebar-pages a:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--sidebar-link-hover);
  border-left-color: var(--sidebar-active-border);
}

[data-theme="light"] .sidebar-category a:hover,
[data-theme="light"] .sidebar-pages a:hover {
  background: rgba(0, 0, 0, 0.03);
}

/* --------------------------------------------------------------------------
   16. Active sidebar link
   -------------------------------------------------------------------------- */
.sidebar-category a.active,
.sidebar-pages a.active {
  background: var(--sidebar-active-bg);
  color: #fff;
  border-left-color: var(--sidebar-active-border);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   17. Sidebar footer
   -------------------------------------------------------------------------- */
.sidebar-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 0.0625rem solid var(--sidebar-border);
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  min-height: 2.75rem;
  color: var(--sidebar-link-color);
  text-decoration: none;
  font-size: 0.8125rem;
  transition: all 0.2s;
}

.sidebar-footer-link:hover {
  color: var(--sidebar-link-hover);
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .sidebar-footer-link:hover {
  background: rgba(0, 0, 0, 0.03);
}

/* --------------------------------------------------------------------------
   18. Main Content Area
   -------------------------------------------------------------------------- */
.workflow-main {
  flex: 1;
  padding: 2rem 1.5rem;
  max-width: 60rem;
  margin: 0 auto;
}

@media (min-width: 48rem) {
  .workflow-main {
    padding: 2.5rem 3rem;
  }
}

/* --------------------------------------------------------------------------
   19. Breadcrumb
   -------------------------------------------------------------------------- */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.breadcrumb a {
  color: var(--breadcrumb-link);
  text-decoration: none;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  padding: 0 0.25rem;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  color: var(--breadcrumb-text);
}

/* --------------------------------------------------------------------------
   20. Main Heading & Description
   -------------------------------------------------------------------------- */
.workflow-main h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--main-heading);
  margin-bottom: 0.5rem;
}

.workflow-desc {
  color: var(--sidebar-link-color);
  font-size: 1.0625rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   21. SVG Container (Diagrams)
   -------------------------------------------------------------------------- */
.svg-container {
  background: var(--card-bg);
  border: 0.0625rem solid var(--card-border);
  border-radius: 0.75rem;
  padding: 2rem 1.5rem 1.5rem;
  margin-bottom: 2rem;
  overflow-x: auto;
}

.svg-container svg {
  width: 100%;
  height: auto;
  display: block;
}

/* --------------------------------------------------------------------------
   22. Steps (Ordered list with CSS counters)
   -------------------------------------------------------------------------- */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step-counter;
}

.steps li {
  position: relative;
  padding: 0.75rem 0 0.75rem 3.5rem;
  margin-bottom: 0.75rem;
  background: var(--step-bg);
  border-radius: 0.5rem;
  min-height: 2.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.steps li::before {
  counter-increment: step-counter;
  content: counter(step-counter);
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--step-counter-from), var(--step-counter-to));
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps li strong {
  color: var(--main-heading);
  font-size: 0.9375rem;
  display: block;
  margin-bottom: 0.25rem;
}

.steps li p {
  color: var(--main-text);
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   23. Help Theme Toggle Button — min 2.75rem touch target
   -------------------------------------------------------------------------- */
.help-theme-toggle {
  position: fixed;
  bottom: 5.5rem;
  right: 1.25rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 0.0625rem solid var(--sidebar-border);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  font-size: 1rem;
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
}

.help-theme-toggle:hover {
  transform: scale(1.1);
}

/* --------------------------------------------------------------------------
   24. Sidebar Toggle Button (Mobile) — min 2.75rem touch target
   -------------------------------------------------------------------------- */
.sidebar-toggle {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #22c55e, #10b981);
  color: #fff;
  font-size: 1.125rem;
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0.25rem 1rem rgba(34, 197, 94, 0.4);
}

/* --------------------------------------------------------------------------
   25. Sidebar Backdrop (Mobile Overlay)
   -------------------------------------------------------------------------- */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   26. Desktop Breakpoint — Hide Mobile Controls, Reset Sidebar
   -------------------------------------------------------------------------- */
@media (min-width: 48rem) {
  .sidebar-toggle {
    display: none;
  }

  .sidebar-backdrop {
    display: none;
  }

  .workflow-sidebar {
    position: sticky;
    left: auto;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   27. Screen-Reader-Only Utility
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 0.0625rem;
  height: 0.0625rem;
  padding: 0;
  margin: -0.0625rem;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   28. Scrollbar Styling for Sidebar
   -------------------------------------------------------------------------- */
.workflow-sidebar::-webkit-scrollbar {
  width: 0.375rem;
}

.workflow-sidebar::-webkit-scrollbar-track {
  background: #0f172a;
}

.workflow-sidebar::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 0.1875rem;
}

.workflow-sidebar::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

[data-theme="light"] .workflow-sidebar::-webkit-scrollbar-track {
  background: #f1f5f9;
}

[data-theme="light"] .workflow-sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}

[data-theme="light"] .workflow-sidebar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* --------------------------------------------------------------------------
   29. Help Welcome (Hub Index)
   -------------------------------------------------------------------------- */
.help-welcome {
  text-align: center;
  padding: 2rem 1rem;
  max-width: 40rem;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   30. Category Card Grid (Help Hub Index)
   -------------------------------------------------------------------------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1.25rem;
}

.category-card {
  background: var(--card-bg);
  border: 0.0625rem solid var(--card-border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: all 0.2s;
  text-decoration: none;
  display: block;
  min-height: 2.75rem;
}

.category-card:hover {
  transform: translateY(-0.125rem);
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.2);
  border-color: var(--sidebar-active-border);
}

.category-card .card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--accent-primary);
}

.category-card h3 {
  font-size: 1rem;
  color: var(--main-heading);
  margin-bottom: 0.5rem;
}

.category-card p {
  font-size: 0.8125rem;
  color: var(--sidebar-link-color);
  margin: 0;
}

/* --------------------------------------------------------------------------
   31. Contact Support Form Styles
   -------------------------------------------------------------------------- */
.contact-section {
  max-width: 40rem;
  margin: 3rem auto;
  padding: 2rem;
  background: var(--card-bg);
  border-radius: 0.75rem;
  border: 0.0625rem solid var(--card-border);
}

.contact-form .form-group {
  margin-bottom: 1rem;
}

.contact-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--main-heading);
  margin-bottom: 0.375rem;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  min-height: 2.75rem;
  border-radius: 0.375rem;
  border: 0.0625rem solid var(--card-border);
  background: var(--sidebar-bg);
  color: var(--main-text);
  font-size: 0.875rem;
}

.contact-form textarea {
  min-height: 8rem;
  resize: vertical;
}

.contact-form .btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.625rem 1.5rem;
  background: linear-gradient(135deg, #22c55e, #10b981);
  color: #fff;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.contact-form .btn-submit:hover {
  transform: translateY(-0.0625rem);
  box-shadow: 0 0.25rem 0.75rem rgba(34, 197, 94, 0.4);
}

.contact-form .privacy-notice {
  font-size: 0.75rem;
  color: var(--sidebar-link-color);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.form-success {
  background: rgba(34, 197, 94, 0.1);
  border: 0.0625rem solid #22c55e;
  border-radius: 0.375rem;
  padding: 1rem;
  color: #22c55e;
  text-align: center;
  display: none;
}

.form-error {
  background: rgba(239, 68, 68, 0.1);
  border: 0.0625rem solid #ef4444;
  border-radius: 0.375rem;
  padding: 1rem;
  color: #ef4444;
  text-align: center;
  display: none;
}

/* --------------------------------------------------------------------------
   32. Benefits / About Section on Help Hub
   -------------------------------------------------------------------------- */
.help-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.help-benefit-card {
  background: var(--card-bg);
  border: 0.0625rem solid var(--card-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-align: center;
}

.help-benefit-card .benefit-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--accent-secondary);
}

.help-benefit-card h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--main-heading);
  margin-bottom: 0.375rem;
}

.help-benefit-card p {
  font-size: 0.8125rem;
  color: var(--sidebar-link-color);
  margin: 0;
  line-height: 1.5;
}

.help-about-section {
  margin: 2.5rem 0 1.5rem;
}

.help-about-section h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--main-heading);
  margin-bottom: 0.75rem;
  text-align: center;
}

.help-about-section > p {
  color: var(--sidebar-link-color);
  font-size: 0.9375rem;
  text-align: center;
  max-width: 36rem;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   33. FAQ Accordion Styles
   -------------------------------------------------------------------------- */
.faq-section {
  margin: 2.5rem 0;
}

.faq-section h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--main-heading);
  margin-bottom: 1rem;
  text-align: center;
}

.faq-item {
  margin-bottom: 0.5rem;
}

.faq-btn {
  width: 100%;
  text-align: left;
  background: var(--card-bg);
  border: 0.0625rem solid var(--card-border);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--main-heading);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 2.75rem;
  transition: border-color 0.2s;
}

.faq-btn:hover {
  border-color: var(--accent-primary);
}

.faq-btn .accordion-icon {
  color: var(--sidebar-link-color);
  transition: transform 0.2s;
  font-size: 0.75rem;
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1.25rem;
  background: var(--card-bg);
  border: 0.0625rem solid var(--card-border);
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
}

.faq-content.open {
  max-height: 62.5rem;
  padding: 0.75rem 1.25rem 1rem;
}

.faq-content p {
  color: var(--main-text);
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0;
}
