
/* =========================================================
   NAMESPACE AUTÓNOMO: Actividad Liderazgo Módulo I
   Compatible con Moodle 4.x + Bootstrap 5
   Sin JavaScript — Tabs y Modales 100% CSS
   ========================================================= */

.actividad-liderazgo-wrapper {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #212529;
  line-height: 1.6;
  background: #f8f9fa;
  border-radius: 0.75rem;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.actividad-liderazgo-wrapper *,
.actividad-liderazgo-wrapper *::before,
.actividad-liderazgo-wrapper *::after {
  box-sizing: border-box;
}

/* ---------------------------------------------------------
   TABS TRADICIONALES FUNCIONALES CON RADIO BUTTONS
   --------------------------------------------------------- */
.actividad-liderazgo-wrapper .al-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.actividad-liderazgo-wrapper .al-tabs-nav {
  display: flex;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 1.5rem;
  gap: 0.5rem;
  background: transparent;
}

.actividad-liderazgo-wrapper .al-tab-label {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  margin-bottom: -1px;
  border: 1px solid transparent;
  border-top-left-radius: 0.375rem;
  border-top-right-radius: 0.375rem;
  color: #0d6efd;
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  background: transparent;
}

.actividad-liderazgo-wrapper .al-tab-label:hover {
  border-color: #e9ecef #e9ecef #dee2e6;
  color: #0a58ca;
}

#al-tab-instrucciones:checked ~ .al-tabs-nav label[for="al-tab-instrucciones"],
#al-tab-recursos:checked ~ .al-tabs-nav label[for="al-tab-recursos"] {
  color: #495057;
  background-color: #fff;
  border-color: #dee2e6 #dee2e6 #f8f9fa;
  font-weight: 600;
}

.actividad-liderazgo-wrapper .al-panel {
  display: none;
  animation: alFadeIn 0.3s ease;
}

#al-tab-instrucciones:checked ~ .al-tabs-content .al-panel-instrucciones,
#al-tab-recursos:checked ~ .al-tabs-content .al-panel-recursos {
  display: block;
}

@keyframes alFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------
   SECCIÓN RECURSOS — TIMELINE IDÉNTICO A LA IMAGEN
   --------------------------------------------------------- */
.actividad-liderazgo-wrapper .al-timeline {
  position: relative;
  padding-left: 3.5rem;
}

.actividad-liderazgo-wrapper .al-timeline::before {
  content: "";
  position: absolute;
  left: 1.25rem;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #e9ecef;
  border-radius: 3px;
}

.actividad-liderazgo-wrapper .al-timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.actividad-liderazgo-wrapper .al-timeline-item:last-child {
  margin-bottom: 0;
}

.actividad-liderazgo-wrapper .al-timeline-item::before {
  content: "";
  position: absolute;
  left: -2.5rem;
  top: 0.5rem;
  width: 3px;
  height: calc(100% + 2rem);
  border-radius: 3px;
}

/* Líneas de color por item */
.actividad-liderazgo-wrapper .al-timeline-item.al-color-blue::before   { background: #6366f1; }
.actividad-liderazgo-wrapper .al-timeline-item.al-color-yellow::before { background: #f59e0b; }

/* Punto/nodo del timeline */
.actividad-liderazgo-wrapper .al-timeline-node {
  position: absolute;
  left: -3.0625rem;
  top: 0.25rem;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  border: 2px solid #fff;
  z-index: 2;
}

.actividad-liderazgo-wrapper .al-timeline-item.al-color-blue .al-timeline-node   { background: #6366f1; }
.actividad-liderazgo-wrapper .al-timeline-item.al-color-yellow .al-timeline-node { background: #f59e0b; }

/* Icono flotante a la izquierda */
.actividad-liderazgo-wrapper .al-timeline-icon {
  position: absolute;
  left: -3.75rem;
  top: 2.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.actividad-liderazgo-wrapper .al-timeline-item.al-color-blue .al-timeline-icon   { background: #6366f1; }
.actividad-liderazgo-wrapper .al-timeline-item.al-color-yellow .al-timeline-icon { background: #f59e0b; }

/* Card del recurso */
.actividad-liderazgo-wrapper .al-resource-card {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  position: relative;
}

/* Header de la card: badge + etiqueta */
.actividad-liderazgo-wrapper .al-resource-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.actividad-liderazgo-wrapper .al-resource-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: #6c757d;
  background: #f1f3f5;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-weight: 500;
}

.actividad-liderazgo-wrapper .al-resource-tag svg,
.actividad-liderazgo-wrapper .al-resource-tag .al-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
}

.actividad-liderazgo-wrapper .al-badge {
  display: inline-block;
  padding: 0.35em 0.85em;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 999px;
  background: #6c757d;
}

/* Título */
.actividad-liderazgo-wrapper .al-resource-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1d29;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

/* Descripción */
.actividad-liderazgo-wrapper .al-resource-desc {
  color: #495057;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.actividad-liderazgo-wrapper .al-resource-desc strong {
  color: #212529;
  font-weight: 600;
}

/* Botón outline redondeado */
.actividad-liderazgo-wrapper .al-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1.5px solid;
  border-radius: 999px;
  background-color: transparent;
  transition: all 0.2s ease-in-out;
}

.actividad-liderazgo-wrapper .al-btn-outline:hover {
  color: #fff;
}

/* Variantes de color para botones */
.actividad-liderazgo-wrapper .al-btn-blue {
  color: #6366f1;
  border-color: #6366f1;
}
.actividad-liderazgo-wrapper .al-btn-blue:hover {
  background-color: #6366f1;
  border-color: #6366f1;
}

.actividad-liderazgo-wrapper .al-btn-yellow {
  color: #f59e0b;
  border-color: #f59e0b;
}
.actividad-liderazgo-wrapper .al-btn-yellow:hover {
  background-color: #f59e0b;
  border-color: #f59e0b;
}

/* ---------------------------------------------------------
   SECCIÓN RECUERDA (fuera de tabs)
   --------------------------------------------------------- */
.actividad-liderazgo-wrapper .al-recuerda {
  margin-top: 2.5rem;
  padding: 1.25rem 1.5rem;
  background-color: #cff4fc;
  border-left: 5px solid #0dcaf0;
  border-radius: 0.5rem;
}

.actividad-liderazgo-wrapper .al-recuerda h5 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #055160;
  font-weight: 700;
  font-size: 1.15rem;
}

.actividad-liderazgo-wrapper .al-recuerda ul {
  margin-bottom: 0;
  padding-left: 1.25rem;
  color: #087990;
}

.actividad-liderazgo-wrapper .al-recuerda li {
  margin-bottom: 0.35rem;
}

/* ---------------------------------------------------------
   MODALES FUNCIONALES CON :TARGET (sin JS)
   --------------------------------------------------------- */
.actividad-liderazgo-wrapper .al-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1050;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.actividad-liderazgo-wrapper .al-modal:target {
  display: flex;
}

.actividad-liderazgo-wrapper .al-modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0,0,0,0.5);
  cursor: default;
  text-decoration: none;
}

.actividad-liderazgo-wrapper .al-modal-dialog {
  position: relative;
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 1rem 3rem rgba(0,0,0,0.175);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1060;
  animation: alModalIn 0.3s ease;
}

@keyframes alModalIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.actividad-liderazgo-wrapper .al-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
  border-top-left-radius: 0.75rem;
  border-top-right-radius: 0.75rem;
}

.actividad-liderazgo-wrapper .al-modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1d29;
}

.actividad-liderazgo-wrapper .al-modal-close {
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1;
  color: #6c757d;
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  transition: background 0.2s;
}

.actividad-liderazgo-wrapper .al-modal-close:hover {
  background: #e9ecef;
  color: #000;
}

.actividad-liderazgo-wrapper .al-modal-body {
  padding: 1.5rem;
}

.actividad-liderazgo-wrapper .al-modal-body p {
  margin-bottom: 1rem;
}

.actividad-liderazgo-wrapper .al-modal-body ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.actividad-liderazgo-wrapper .al-modal-body li {
  margin-bottom: 0.4rem;
}

.actividad-liderazgo-wrapper .al-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid #e9ecef;
  background: #f8f9fa;
  border-bottom-left-radius: 0.75rem;
  border-bottom-right-radius: 0.75rem;
}

/* Botón sólido para modales */
.actividad-liderazgo-wrapper .al-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
}

.actividad-liderazgo-wrapper .al-btn-primary {
  color: #fff;
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.actividad-liderazgo-wrapper .al-btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

.actividad-liderazgo-wrapper .al-btn-secondary {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

.actividad-liderazgo-wrapper .al-btn-secondary:hover {
  background-color: #5c636a;
  border-color: #565e64;
}

/* Utilidades */
.actividad-liderazgo-wrapper .al-text-muted { color: #6c757d; }
.actividad-liderazgo-wrapper .al-mb-0 { margin-bottom: 0 !important; }
.actividad-liderazgo-wrapper .al-mb-2 { margin-bottom: 0.75rem !important; }
.actividad-liderazgo-wrapper .al-mt-3 { margin-top: 1rem !important; }
.actividad-liderazgo-wrapper .al-d-grid { display: grid !important; }
.actividad-liderazgo-wrapper .al-gap-2 { gap: 0.5rem !important; }