/* ==========================================================================
   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"].
   ========================================================================== */

/* --------------------------------------------------------------------------
   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(59, 130, 246, 0.15);
  --sidebar-active-border: #3b82f6;
  --page-bg: #0f172a;
  --main-text: #e2e8f0;
  --main-heading: #f1f5f9;
  --breadcrumb-text: #94a3b8;
  --breadcrumb-link: #3b82f6;
  --card-bg: #1e293b;
  --card-border: #334155;
  --step-counter-from: #3b82f6;
  --step-counter-to: #2563eb;
  --step-bg: #1e293b;
}

/* --------------------------------------------------------------------------
   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(59, 130, 246, 0.1);
  --sidebar-active-border: #3b82f6;
  --page-bg: #f8fafc;
  --main-text: #1e293b;
  --main-heading: #0f172a;
  --breadcrumb-text: #64748b;
  --breadcrumb-link: #2563eb;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --step-counter-from: #3b82f6;
  --step-counter-to: #2563eb;
  --step-bg: #f1f5f9;
}

/* --------------------------------------------------------------------------
   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–14. Sidebar Categories (details/summary accordion)
   -------------------------------------------------------------------------- */

/* 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 */
.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 */
.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);
}

/* --------------------------------------------------------------------------
   15. 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;
  }
}

/* --------------------------------------------------------------------------
   16–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–21. 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;
}

/* --------------------------------------------------------------------------
   22–23. 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;
}

/* --------------------------------------------------------------------------
   24–28. 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;
}

/* --------------------------------------------------------------------------
   29–30. Help Theme Toggle Button
   -------------------------------------------------------------------------- */
.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);
}

/* --------------------------------------------------------------------------
   31. Sidebar Toggle Button (Mobile)
   -------------------------------------------------------------------------- */
.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, #3b82f6, #2563eb);
  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(59, 130, 246, 0.4);
}

/* --------------------------------------------------------------------------
   32–33. 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;
}

/* --------------------------------------------------------------------------
   34. 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;
  }
}

/* --------------------------------------------------------------------------
   35. 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;
}

/* --------------------------------------------------------------------------
   36. 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;
}

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

.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: #3b82f6;
}

.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;
}

/* --------------------------------------------------------------------------
   38. 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, #3b82f6, #2563eb);
  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(59, 130, 246, 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;
}

/* ==========================================================================
   Site Header for Help Pages
   ========================================================================== */

.help-site-header {
  position: sticky;
  top: 0;
  z-index: 200;
}

.help-site-nav {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(0.75rem);
  border-bottom: 0.0625rem solid var(--sidebar-border);
}

[data-theme="light"] .help-site-nav {
  background: rgba(248, 250, 252, 0.92);
}

.help-nav-inner {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.5rem;
}

/* Brand / Logo */
.help-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.help-nav-logo {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  background: linear-gradient(135deg, #10B981, #6366F1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 0.125rem 0.5rem rgba(16, 185, 129, 0.3);
}

.help-nav-brand-text {
  font-size: 1.125rem;
  font-weight: 700;
  background: linear-gradient(135deg, #10B981, #6366F1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Desktop nav links — centered */
.help-nav-links {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 1.5rem;
}

@media (min-width: 48rem) {
  .help-nav-links {
    display: flex;
  }
}

.help-nav-link {
  color: var(--sidebar-link-color);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.375rem 0.25rem;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.2s;
}

.help-nav-link:hover {
  color: #10B981;
}

[data-theme="light"] .help-nav-link:hover {
  color: #059669;
}

.help-nav-link-active {
  color: #10B981;
  font-weight: 600;
}

[data-theme="light"] .help-nav-link-active {
  color: #059669;
}

/* Actions (right side) */
.help-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.help-nav-cta {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  min-height: 2.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #10B981, #059669);
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 0.125rem 0.5rem rgba(16, 185, 129, 0.3);
}

.help-nav-cta:hover {
  opacity: 0.9;
  transform: translateY(-0.0625rem);
}

@media (min-width: 48rem) {
  .help-nav-cta {
    display: inline-flex;
  }
}

/* Mobile hamburger */
.help-nav-mobile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: background 0.2s;
}

.help-nav-mobile-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .help-nav-mobile-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

@media (min-width: 48rem) {
  .help-nav-mobile-btn {
    display: none;
  }
}

/* Mobile menu panel */
.help-nav-mobile {
  display: none;
  flex-direction: column;
  padding: 0.5rem 1.5rem 1rem;
  border-top: 0.0625rem solid var(--sidebar-border);
}

.help-nav-mobile-open {
  display: flex;
}

@media (min-width: 48rem) {
  .help-nav-mobile,
  .help-nav-mobile-open {
    display: none;
  }
}

.help-nav-mobile-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  min-height: 2.75rem;
  color: var(--sidebar-link-color);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 0.0625rem solid var(--sidebar-border);
  transition: color 0.2s;
}

.help-nav-mobile-link:hover {
  color: #10B981;
}

/* Override OTROTL trigger styles when used as a mobile nav link */
.help-nav-mobile-link.otrotl-network-trigger {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: var(--sidebar-link-color);
  font-size: 0.875rem;
  justify-content: flex-start;
}

.help-nav-mobile-link.otrotl-network-trigger:hover {
  color: #10B981;
  background: transparent;
  transform: none;
  filter: none;
}

.help-nav-mobile-link.help-nav-link-active {
  color: #10B981;
  font-weight: 600;
}

.help-nav-mobile-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.75rem;
  padding: 0.625rem 1.25rem;
  min-height: 2.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #10B981, #059669);
  border-radius: 0.5rem;
  text-decoration: none;
  text-align: center;
}

/* Adjust workflow-page to account for sticky header */
.help-site-header + .workflow-page {
  min-height: calc(100vh - 3.5rem);
}

/* ==========================================================================
   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: #10B981;
}

.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;
}
