/**
 * EduDaat — Ayuda / manuales
 */

/* ---------- Botón Ayuda (barra superior) ---------- */
/*
 * Por encima del contenido de página (margin-bottom negativo del tema),
 * pero por debajo del modal Bootstrap (backdrop 1050 / modal 1055)
 * para no tapar el botón cerrar de las modales.
 */
body.auth-panel .breadcrumbs {
  position: relative;
  z-index: 1020;
  overflow: visible;
}

body.auth-panel .breadcrumbs .container,
body.auth-panel .breadcrumbs__bar,
body.auth-panel .breadcrumbs__actions,
body.auth-panel .breadcrumbs .dropdown {
  overflow: visible;
  position: relative;
  z-index: inherit;
}

/* Con modal abierta, la cinta no compite con el diálogo */
body.modal-open .breadcrumbs,
body.modal-open .breadcrumbs .dropdown,
body.modal-open .ayuda-dropdown {
  z-index: 1 !important;
}

.breadcrumbs__actions {
  flex-shrink: 0;
}

.breadcrumbs__help {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  background: transparent;
  color: #149ddd;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  padding: 0.2rem 0.15rem;
}

.breadcrumbs__help::after {
  display: none;
}

.breadcrumbs__help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: linear-gradient(145deg, #1aa3e8 0%, #0d7fb8 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(20, 157, 221, 0.35);
}

.breadcrumbs__help-icon i {
  font-size: 1.25rem;
  line-height: 1;
}

.breadcrumbs__help:hover,
.breadcrumbs__help:focus {
  color: #0e2442;
}

.breadcrumbs__help:hover .breadcrumbs__help-icon,
.breadcrumbs__help:focus .breadcrumbs__help-icon {
  filter: brightness(1.06);
  box-shadow: 0 6px 16px rgba(20, 157, 221, 0.45);
}

.ayuda-dropdown {
  min-width: 15.5rem;
  border: 0;
  border-radius: 12px;
  padding: 0.4rem 0;
  box-shadow: 0 12px 32px rgba(14, 36, 66, 0.16);
  margin-top: 0.5rem !important;
  /* Por encima del contenido; por debajo de .modal (1055) */
  z-index: 1030 !important;
}

/* Con strategy fixed, Popper posiciona respecto al viewport */
.dropdown-menu.ayuda-dropdown[data-bs-popper],
.ayuda-dropdown.show {
  z-index: 1030 !important;
}

.ayuda-dropdown .dropdown-header {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6c7a89;
  font-weight: 700;
}

.ayuda-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  font-weight: 500;
  color: #0e2442;
}

.ayuda-dropdown .dropdown-item i {
  color: #149ddd;
  font-size: 1.15rem;
}

.ayuda-dropdown .dropdown-item:hover,
.ayuda-dropdown .dropdown-item:focus {
  background: #eef7fc;
  color: #0e2442;
}

.ayuda-dropdown__row .dropdown-item {
  white-space: normal;
}

.ayuda-dropdown__row:hover {
  background: #f7fbfe;
}

/* ---------- Índice de ayuda ---------- */
.ayuda-hero {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(20, 157, 221, 0.18), transparent 45%),
    linear-gradient(135deg, #0e2442 0%, #163a63 55%, #1a527a 100%);
  color: #fff;
}

.ayuda-hero__icon {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1.6rem;
}

.ayuda-hero__title {
  font-family: "Plus Jakarta Sans", "Raleway", sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.ayuda-hero__lead {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  max-width: 42rem;
}

.ayuda-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem 1.2rem 1.1rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e4eaf1;
  box-shadow: 0 8px 24px rgba(14, 36, 66, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  color: inherit;
}

.ayuda-card:hover {
  transform: translateY(-3px);
  border-color: #b9dcf0;
  box-shadow: 0 14px 28px rgba(20, 157, 221, 0.14);
  color: inherit;
}

.ayuda-card__badge {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0d7fb8;
  background: #e8f5fc;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  margin-bottom: 0.85rem;
}

.ayuda-card__icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e8f5fc, #d5eef9);
  color: #149ddd;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.ayuda-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0e2442;
  margin-bottom: 0.4rem;
}

.ayuda-card__desc {
  flex: 1;
  font-size: 0.9rem;
  color: #5c6b7a;
  margin-bottom: 1rem;
}

.ayuda-card__cta {
  font-size: 0.9rem;
  font-weight: 600;
  color: #149ddd;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.ayuda-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.ayuda-card__actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
}

.ayuda-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  border-radius: 999px;
  padding-inline: 0.9rem;
}

/* ---------- Visor de documento ---------- */
.ayuda-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  color: #149ddd;
  text-decoration: none;
}

.ayuda-back:hover {
  color: #0e2442;
}

.ayuda-rol-pill {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0d7fb8;
  background: #e8f5fc;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
}

.ayuda-sidebar {
  background: #fff;
  border: 1px solid #e4eaf1;
  border-radius: 14px;
  padding: 0.75rem 0.5rem;
  box-shadow: 0 6px 18px rgba(14, 36, 66, 0.05);
  position: sticky;
  top: 1rem;
}

.ayuda-sidebar__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6c7a89;
  padding: 0.25rem 0.85rem 0.5rem;
  margin: 0;
}

.ayuda-sidebar__item {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  border: 0 !important;
  border-radius: 10px !important;
  margin: 0.15rem 0.35rem;
  padding: 0.65rem 0.75rem !important;
  font-weight: 500;
  color: #0e2442;
}

.ayuda-sidebar__item i {
  color: #149ddd;
  font-size: 1.15rem;
}

.ayuda-sidebar__item.active {
  background: linear-gradient(135deg, #149ddd, #0d7fb8) !important;
  color: #fff !important;
}

.ayuda-sidebar__item.active i {
  color: #fff;
}

.doc-content {
  background: #fff;
  border: 1px solid #e4eaf1;
  border-radius: 16px;
  padding: 1.75rem 1.85rem 2rem;
  box-shadow: 0 8px 24px rgba(14, 36, 66, 0.06);
  max-width: 100%;
  overflow-x: auto;
  color: #243447;
  line-height: 1.65;
}

.doc-content > :first-child {
  margin-top: 0;
}

.doc-content h1 {
  font-family: "Plus Jakarta Sans", "Raleway", sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0e2442;
  margin-bottom: 0.75rem;
}

.doc-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #0e2442;
  margin-top: 1.75rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid #e8f0f7;
}

.doc-content h3 {
  font-size: 1.08rem;
  font-weight: 700;
  color: #163a63;
  margin-top: 1.25rem;
}

.doc-content p,
.doc-content li {
  font-size: 0.98rem;
}

.doc-content a {
  color: #149ddd;
  font-weight: 600;
}

.doc-content ul,
.doc-content ol {
  padding-left: 1.25rem;
}

.doc-content li + li {
  margin-top: 0.25rem;
}

.doc-content table {
  width: 100%;
  margin: 1em 0;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.doc-content table th,
.doc-content table td {
  border: 1px solid #dde5ee;
  padding: 0.65rem 0.75rem;
  vertical-align: top;
}

.doc-content table th {
  background: #f3f8fc;
  color: #0e2442;
  font-weight: 700;
}

.doc-content table tr:nth-child(even) td {
  background: #fafcfe;
}

.doc-content blockquote {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-left: 4px solid #149ddd;
  background: #f3f9fd;
  border-radius: 0 10px 10px 0;
  color: #3a4a5b;
}

.doc-content code {
  background: #eef3f8;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.doc-content pre {
  background: #0e2442;
  color: #e8f1f8;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  overflow-x: auto;
}

.doc-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.doc-content hr {
  border: 0;
  border-top: 1px solid #e4eaf1;
  margin: 1.5rem 0;
}

@media (max-width: 768px) {
  .breadcrumbs__help-label {
    display: none;
  }

  .ayuda-hero {
    flex-direction: column;
  }

  .doc-content {
    padding: 1.2rem 1.1rem 1.4rem;
  }

  .ayuda-sidebar {
    position: static;
  }
}
