/* app/main/static/css/help.css
 * Estilos exclusivos da página de ajuda do DeL.
 */

:root {
  --led-primary: #1a3a5c;
  --led-accent: #2980b9;
  --led-highlight: #e67e22;
  --led-light: #f4f7fb;
  --led-text: #2c3e50;
  --led-sidebar-width: 260px;
  --led-sidebar-bg: #1a3a5c;
  --led-sidebar-text: #cdd9e5;
  --led-sidebar-active: #e67e22;
  --led-sidebar-hover: rgba(255, 255, 255, 0.08);
  --navbar-height: 56px;
  --scroll-offset: 16px;
}

/* Conteúdo principal ------------------------------------------------ */
#led-main {
  box-sizing: border-box;
  margin-left: var(--led-sidebar-width);
  padding: 36px 56px 80px;
  min-height: 100vh;
  max-width: 1100px;
  font-family: "Merriweather", Georgia, serif;
  color: var(--led-text);
  background: var(--led-light);
  font-size: 15px;
  line-height: 1.8;
}

#led-main p {
  margin: 0 0 14px;
}

#led-main ol,
#led-main ul {
  margin: 0 0 14px;
  padding-left: 24px;
}

#led-main ol li,
#led-main ul li {
  margin-bottom: 6px;
}

#led-main ol ol,
#led-main ul ul {
  margin-top: 6px;
}

#led-main a {
  color: var(--led-accent);
}

#led-main a:hover {
  color: var(--led-highlight);
}

#led-main code,
.led-modal-body code {
  padding: 2px 6px;
  border: 1px solid #c5d5e8;
  border-radius: 4px;
  background: #e8eef5;
  color: #c0392b;
  font-family: "Fira Mono", "Consolas", monospace;
  font-size: 0.9em;
}

/* Barra de progresso ------------------------------------------------- */
#led-progress {
  position: fixed;
  top: var(--navbar-height);
  left: var(--led-sidebar-width);
  right: 0;
  width: 0;
  height: 3px;
  z-index: 2000;
  background: var(--led-highlight);
  transition: width 0.1s linear;
}

/* Âncoras ------------------------------------------------------------ */
[id] {
  scroll-margin-top: calc(var(--navbar-height) + var(--scroll-offset));
}

/* Seções ------------------------------------------------------------ */
.led-section {
  padding-top: 48px;
  margin-bottom: 20px;
}

.led-section h1 {
  margin: 0 0 24px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--led-highlight);
  color: var(--led-primary);
  font-family: "Merriweather", Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
}

.led-subgroup {
  padding-top: 28px;
  margin-bottom: 18px;
}

.led-subgroup h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--led-accent);
  font-size: 1.1rem;
  font-weight: 700;
}

.led-subgroup h3::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--led-highlight);
}

/* Cabeçalhos e passos ----------------------------------------------- */
.led-section h4,
.led-section h5 {
  color: var(--led-primary);
  font-weight: 700;
}

.led-section h4 {
  margin-top: 28px;
  margin-bottom: 12px;
  font-size: 1.15rem;
}

.led-section h5 {
  margin-top: 22px;
  margin-bottom: 8px;
  font-size: 1rem;
}

.led-step-title {
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--led-primary);
  font-size: 1.05rem;
  font-weight: 700;
}

/* Badges e exemplos -------------------------------------------------- */
.mep-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--led-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

.led-example {
  margin: 14px 0;
}

.led-example-label {
  margin-bottom: 6px;
  color: var(--led-primary);
  font-weight: 700;
}

.led-code-block {
  overflow-x: auto;
  padding: 14px 16px;
  border: 1px solid #d7e0e8;
  border-radius: 6px;
  background: #f8f9fa;
  font-family: "Fira Mono", "Consolas", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Avisos ------------------------------------------------------------- */
.led-callout {
  margin: 16px 0;
  padding: 14px 18px;
  border-left: 4px solid var(--led-accent);
  border-radius: 0 6px 6px 0;
  background: #eaf4fd;
  font-size: 14px;
}

.led-callout p:last-child {
  margin-bottom: 0;
}

.led-callout.warning {
  border-left-color: var(--led-highlight);
  background: #fef9ec;
}

.led-callout strong,
.led-callout b {
  color: inherit;
}

/* Tabelas ------------------------------------------------------------ */
.led-table-wrapper {
  width: 100%;
  margin: 16px 0 20px;
  overflow-x: auto;
}

.led-table-wrapper table {
  width: 100%;
  margin-bottom: 0;
}

.led-table-wrapper th {
  white-space: nowrap;
}

/* Lista de campos CSV ----------------------------------------------- */
.led-field-list {
  margin-top: 10px;
}

.led-field-list > li {
  padding: 18px 0;
  border-bottom: 1px solid #e1e8ed;
}

.led-field-list > li:last-child {
  border-bottom: 0;
}

.led-field-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.led-field-header code {
  font-size: 0.95rem;
  font-weight: 700;
}

.led-required,
.led-optional {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
}

.led-required {
  background: #0d6efd;
  color: #fff;
}

.led-optional {
  border: 1px solid #adb5bd;
  background: #f8f9fa;
  color: #343a40;
}

/* Sidebar ------------------------------------------------------------ */
#led-sidebar {
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  width: var(--led-sidebar-width);
  height: calc(100vh - var(--navbar-height));
  overflow-y: auto;
  z-index: 1030;
  box-sizing: border-box;
  background: var(--led-sidebar-bg);
  color: var(--led-sidebar-text);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  transition: transform 0.3s ease;
}

#led-sidebar::-webkit-scrollbar {
  width: 5px;
}

#led-sidebar::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-heading {
  padding: 14px 20px 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.35);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

#led-sidebar .nav,
#led-sidebar .subnav {
  list-style: none;
  margin: 0;
  padding: 0;
}

#led-sidebar .nav {
  padding: 10px 0;
}

#led-sidebar .nav li {
  margin: 0;
}

#led-sidebar .nav > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 20px;
  border-left: 3px solid transparent;
  color: #e2ecf5;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
}

#led-sidebar .nav > li > a:hover {
  background: var(--led-sidebar-hover);
  color: #fff;
}

#led-sidebar .nav > li.active > a,
#led-sidebar .nav > li > a.active {
  border-left-color: var(--led-sidebar-active);
  background: rgba(230, 126, 34, 0.15);
  color: var(--led-sidebar-active);
}

.nav-chevron {
  opacity: 0.6;
  font-size: 9px;
  transition: transform 0.25s;
}

.nav-chevron.open {
  transform: rotate(180deg);
}

#led-sidebar .subnav {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

#led-sidebar .subnav.open {
  max-height: 800px;
}

#led-sidebar .subnav li a {
  display: block;
  padding: 6px 20px 6px 32px;
  border-left: 3px solid transparent;
  color: #9fbdd4;
  font-size: 12px;
  font-weight: 400;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

#led-sidebar .subnav li a::before {
  content: "–";
  margin-right: 6px;
  opacity: 0.5;
  font-size: 10px;
}

#led-sidebar .subnav li a:hover {
  background: var(--led-sidebar-hover);
  color: #fff;
}

#led-sidebar .subnav li a.active {
  border-left-color: var(--led-sidebar-active);
  color: var(--led-sidebar-active);
}

/* Botões flutuantes -------------------------------------------------- */
#sidebar-toggle,
#back-to-top {
  border: 0;
  color: #fff;
  cursor: pointer;
}

#sidebar-toggle {
  display: none;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1050;
  width: 50px;
  height: 50px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--led-primary);
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

#back-to-top {
  display: none;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1050;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--led-highlight);
  font-size: 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

#back-to-top.visible {
  display: flex;
}

.bi {
  vertical-align: -0.125em;
}

/* Modal ------------------------------------------------------------- */
.led-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  background: rgba(44, 62, 80, 0.7);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.led-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.led-modal-container {
  width: min(90%, 550px);
  max-height: 90vh;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.led-modal-overlay.active .led-modal-container {
  transform: translateY(0);
}

.led-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 4px solid var(--led-highlight);
  background: var(--led-primary);
  color: #fff;
}

.led-modal-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: "Merriweather", Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
}

.led-modal-close-btn {
  display: flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.led-modal-close-btn:hover {
  color: var(--led-sidebar-active);
}

.led-modal-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 24px;
  color: var(--led-text);
  font-family: "Merriweather", Georgia, serif;
  font-size: 17px;
  line-height: 1.8;
}

.led-modal-body .led-callout {
  font-size: 16px;
  line-height: 1.7;
}

.led-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid #e1e8ed;
  background: var(--led-light);
}

.led-modal-btn-primary {
  padding: 10px 24px;
  border: 0;
  background: var(--led-accent);
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}

.led-modal-btn-primary:hover {
  background: var(--led-primary);
}

/* Responsividade ----------------------------------------------------- */
@media (max-width: 991px) {
  #led-sidebar {
    transform: translateX(-100%);
  }

  #led-sidebar.open {
    transform: translateX(0);
  }

  #led-main {
    margin-left: 0;
    padding: 24px 18px 80px;
  }

  #led-progress {
    left: 0;
  }

  #sidebar-toggle {
    display: flex;
  }
}

@media (max-width: 575px) {
  #led-main {
    padding-right: 14px;
    padding-left: 14px;
    font-size: 14px;
  }

  .led-section h1 {
    font-size: 1.5rem;
  }

  .led-modal-header,
  .led-modal-body,
  .led-modal-footer {
    padding-right: 18px;
    padding-left: 18px;
  }

  .led-modal-body {
    font-size: 15px;
  }
}
