:root {
    --course-radius: 0.75rem;
    --course-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    --course-border: #e3e7ee;
    --course-bg: #ffffff;
    --course-muted: #7a7a7a;
    --course-muted-soft: #f6f7fb;
    --course-accent: #cf2732;
    --course-accent-soft: rgba(255, 109, 64, 0.12);
    --course-success: #29c99b;
    --course-success-soft: rgba(41, 201, 155, 0.1);
    --course-info: #318fc4;
    --course-info-soft: rgba(49, 143, 196, 0.12);
    --course-upcoming: #e7a100;
    --course-upcoming-soft: rgba(231, 161, 0, 0.12);
    --course-danger: #d50202;
    --course-suscribe: #e30b05;
    --course-suscribe-hover: #cf2732;
}

/* Contenedor general */
.my-courses {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
    font-family: "Lato", Arial, sans-serif;
}

.my-courses-title {
    margin: 0 0 0.25rem;
    font-size: 1.8rem;
    font-weight: 700;
    color: #000;
}

.my-courses-subtitle {
    margin: 0 0 1.5rem;
    color: var(--course-muted);
    font-size: 0.95rem;
}

.my-courses-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 0;
}

.my-courses-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.my-courses-count {
    margin: 0;
    font-size: 0.9rem;
    color: var(--course-muted);
}

/* Rejilla de tarjetas */
.my-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 380px));
    gap: 1.5rem;
    width: 100%;
    justify-content: flex-start;
}

.box-item-inner {
    height: 100%;
}

.box-item-inner.is-hidden {
    display: none !important;
}


/* Tarjeta */
.my-course-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--course-bg);
    border: 1px solid var(--course-border);
    border-radius: var(--course-radius);
    box-shadow: var(--course-shadow);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.my-course-card:hover {
    transform: translateY(-2px);
    border-color: var(--course-accent-soft);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

/* Header de tarjeta */
.my-course-card-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem 0;
}

.my-course-status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.my-course-status.is-in-progress {
    background: var(--course-info-soft);
    color: var(--course-info);
    width: 7em;
}

.my-course-status.is-completed {
    background: var(--course-success-soft);
    color: var(--course-success);
}

.my-course-status.is-upcoming {
    background: var(--course-upcoming-soft);
    color: var(--course-upcoming);
}

.my-course-status.is-new {
    background: var(--course-accent-soft);
    color: var(--course-accent);
}

.my-course-area {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--course-muted);
}

.my-course-area .fa {
    font-size: 0.9rem;
}

/* Cuerpo */
.my-course-card-body {
    padding: 0.5rem 1rem 0.75rem;
}

.my-course-title {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #000;
}

.my-course-description {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: var(--course-muted);
}

/* Meta */
.my-course-meta {
    /* list-style: none; */
    margin: 0 0 0.5rem;
    /* padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    font-size: 0.95rem;
    color: var(--course-muted); */
}

.my-course-meta li {
    /* display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0; */
    font-size: 14px !important;
}

.my-course-meta .fa {
    font-size: 0.95rem;
}

/* Footer: progreso + acciones */
.my-course-card-footer {
    margin-top: auto;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid #edf0f5;
    background: #fcfdff;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.my-course-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.my-course-progress-bar {
    position: relative;
    flex: 1;
    height: 0.45rem;
    border-radius: 999px;
    background: var(--course-muted-soft);
    overflow: hidden;
}

.my-course-progress-bar-fill {
    position: absolute;
    inset: 0;
    width: var(--course-progress, 0%);
    max-width: 100%;
    background: linear-gradient(90deg, var(--course-info), var(--course-success));
    border-radius: inherit;
    transition: width 0.25s ease;
}

.my-course-progress-text {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--course-muted);
}

/* Botones */
.my-course-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* ── Botón principal ─────────────────────────────────────────── */
.btn-course-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.95rem;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    color: #e30b05;

  
    background: linear-gradient(
        to top,
        #e30b05 50%,  
        #ffffff 50%   
    );
    background-size:     100% 200%;  
    background-position: 0% 0%;      
    border-color: #e30b05;

    transition:
        background-position 0.35s ease-out,
        box-shadow          0.25s ease-out,
        transform           0.25s ease-out,
        border-color        0.25s ease-out;
}

.btn-course-primary:hover {
    background-position: 0% 100%;    
    border-color: #e30b05;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(207, 39, 50, 0.45),
        0 0  0  3px rgba(207, 39, 50, 0.18);
}

.btn-course-primary:active {
    transform: scale(0.97) translateY(0);
    transition-duration: 0.1s;
}

.btn-course-suscribe {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.95rem;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    color: #0c6d80;

  
    background: linear-gradient(
        to top,
        #0c6d80 50%,  
        #ffffff 50%   
    );
    background-size:     100% 200%;
    background-position: 0% 0%;
    border-color: #0c6d80;

    transition:
        background-position 0.35s ease-out,
        box-shadow          0.25s ease-out,
        transform           0.25s ease-out,
        border-color        0.25s ease-out;
}

.btn-course-suscribe:hover {
    background-position: 0% 100%;
    border-color: #0c6d80;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(12, 109, 128, 0.45),
        0 0  0  3px rgba(12, 109, 128, 0.18);
}

.btn-course-suscribe:active {
    transform: scale(0.97) translateY(0);
    transition-duration: 0.1s;
}


.my-courses-empty {
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.95rem;
    color: var(--course-muted);
}

.section {
    max-width: 1200px;
    margin: 1rem auto 3rem auto !important;
    width: 95%;
}

/* ASIDE */
/* Encabezado "Mis cursos" + botón IA */
.courses-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.courses-title {
  font-weight: 700;
  color: #e30b05;
  font-size: 1.8rem;
  margin: 0;
}

/* Botón IA */
.btn-ia-tools {
  position: relative;
  font-weight: 500;
  border-radius: 12px;
  border: none;
  padding: 8px 30px;
  overflow: hidden;
  cursor: pointer;
  z-index: 1;
  background: linear-gradient(
    to top,
    #1c1c2e 50%,
    #ffffff 50%
  );
  background-size:     100% 200%;
  background-position: 0% 0%;
  color: #444;
  transition:
    background-position 0.35s ease-out,
    color               0.3s  ease-out,
    transform           0.25s ease-out;
}

.btn-ia-tools:hover {
  background-position: 0% 100%;
  color: #fff;
  transform: translateY(-2px);
}

.btn-ia-tools::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 3px;
  background: linear-gradient(270deg, #7f00ff, #e100ff, #00c3ff, #7f00ff);
  background-size: 300% 300%;
  animation: gradientMove 5s linear infinite;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}

@keyframes gradientMove {
  0%   { background-position: 0%   50%; }
  100% { background-position: 100% 50%; }
}

/* ✅ Click */
.btn-ia-tools:active {
  transform: scale(0.97);
}

/* Panel lateral IA */
/* ============================================================
   ia-panel — Rediseño UX/UI moderno
   Herramientas con IA — Panel lateral derecho
   Sin clases nuevas — solo nth-child y pseudo-elementos CSS
   ============================================================ */

/* ── Fondo oscuro con blur ── */
.ia-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1040;
}

.ia-panel-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

/* ══════════════════════════════════════
   PANEL CONTENEDOR
══════════════════════════════════════ */
.ia-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(400px, 100%);
  background: #f0f5fb;
  box-shadow: -6px 0 40px rgba(13, 42, 82, 0.18);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ia-panel.is-open {
  transform: translateX(0);
}

/* ══════════════════════════════════════
   HEADER — degradado metálico AI
══════════════════════════════════════ */
.ia-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.25rem 1.25rem;
  background: linear-gradient(135deg, #0d2a52 0%, #1565c0 55%, #00b4d8 100%);
  border-bottom: none;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Círculo decorativo fondo superior derecha */
.ia-panel-header::before {
  content: '';
  position: absolute;
  top: -35px;
  right: -35px;
  width: 130px;
  height: 130px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  pointer-events: none;
}

/* Nebulosa cian inferior */
.ia-panel-header::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 5%;
  width: 180px;
  height: 50px;
  background: rgba(0, 180, 216, 0.18);
  border-radius: 50%;
  filter: blur(18px);
  pointer-events: none;
}

.ia-panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
  line-height: 1.25;
  position: relative; /* sobre el ::before/::after del header */
}

/* Subtítulo via CSS puro debajo del título */
.ia-panel-title::after {
  content: 'Potencia tu enseñanza con IA';
  display: block;
  font-size: 0.73rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 0.3rem;
  letter-spacing: 0.01em;
}

/* Botón cerrar × */
.ia-panel-close {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: background 0.2s ease, transform 0.25s ease, box-shadow 0.2s ease;
  position: relative;
}

.ia-panel-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

/* ══════════════════════════════════════
   BODY
══════════════════════════════════════ */
.ia-panel-body {
  padding: 1.25rem;
  overflow-y: auto;
  font-size: 0.9rem;
  flex: 1;
  background: #f0f5fb;
}

/* Scrollbar metálico */
.ia-panel-body::-webkit-scrollbar        { width: 4px; }
.ia-panel-body::-webkit-scrollbar-track  { background: transparent; }
.ia-panel-body::-webkit-scrollbar-thumb  {
  background: linear-gradient(180deg, #1565c0, #00b4d8);
  border-radius: 4px;
}

/* ── Intro box ── */
.ia-panel-intro {
  margin-bottom: 1.25rem;
  padding: 0.8rem 1rem;
  background: #ffffff;
  border-radius: 0.75rem;
  border-left: 3px solid #0ea5e9;
  box-shadow: 0 2px 10px rgba(13, 42, 82, 0.07);
  color: #475569;
  font-size: 0.85rem;
  line-height: 1.55;
}

/* ══════════════════════════════════════
   TOOLS LIST — tarjetas con color único
══════════════════════════════════════ */
.ia-tools-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* Eliminar margin-top heredado */
.ia-tools-list li + li {
  margin-top: 0;
}

/* ── Tarjeta base ── */
.ia-tools-list a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: #1e293b;
  background: #ffffff;
  border: 1.5px solid #e2eaf4;
  border-radius: 0.875rem;
  box-shadow: 0 2px 8px rgba(13, 42, 82, 0.05);
  position: relative;
  overflow: hidden;
  transition:
    transform      0.22s ease,
    box-shadow     0.22s ease,
    border-color   0.22s ease,
    background     0.22s ease;
}

/* Shimmer en hover (1-4) */
.ia-tools-list a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 55%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  transition: left 0.55s ease;
  pointer-events: none;
}

.ia-tools-list a:hover::before {
  left: 160%;
}

/* ── Ícono: pastilla cuadrada de color ── */
.ia-tools-list a > .fa {
  font-size: 1.05rem;
  width: 44px;
  height: 44px;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.ia-tools-list a:hover > .fa {
  transform: scale(1.12) rotate(-6deg);
}

/* ── Contenido texto ── */
.ia-tools-list a > div {
  flex: 1;
  min-width: 0;
}

.ia-tools-list a strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.2rem;
  transition: color 0.2s;
}

.ia-tools-list a > div > span {
  display: block;
  font-size: 0.77rem;
  color: #64748b;
  line-height: 1.4;
}

/* Hover base */
.ia-tools-list a:hover {
  transform: translateX(-3px) translateY(-1px);
  box-shadow: 0 6px 18px rgba(13, 42, 82, 0.1);
  background: #ffffff;
}

/* ══════════════════════════════════════
   COLOR POR HERRAMIENTA — nth-child
══════════════════════════════════════ */

/* 1 · Planea con IA — Azul cielo */
.ia-tools-list li:nth-child(1) a > .fa {
  color: #0284c7;
  background: rgba(14, 165, 233, 0.12);
}
.ia-tools-list li:nth-child(1) a:hover {
  border-color: rgba(14, 165, 233, 0.45);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.18);
}
.ia-tools-list li:nth-child(1) a:hover strong { color: #0284c7; }

/* 2 · Rúbricas con IA — Violeta */
.ia-tools-list li:nth-child(2) a > .fa {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.11);
}
.ia-tools-list li:nth-child(2) a:hover {
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.18);
}
.ia-tools-list li:nth-child(2) a:hover strong { color: #6d28d9; }

/* 3 · Evaluaciones con IA — Ámbar */
.ia-tools-list li:nth-child(3) a > .fa {
  color: #d97706;
  background: rgba(245, 158, 11, 0.12);
}
.ia-tools-list li:nth-child(3) a:hover {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.18);
}
.ia-tools-list li:nth-child(3) a:hover strong { color: #b45309; }

/* 4 · Formatos y actas — Esmeralda */
.ia-tools-list li:nth-child(4) a > .fa {
  color: #059669;
  background: rgba(16, 185, 129, 0.11);
}
.ia-tools-list li:nth-child(4) a:hover {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.18);
}
.ia-tools-list li:nth-child(4) a:hover strong { color: #059669; }

/* ══════════════════════════════════════
   5 · TutorIA — ESPECIAL ✦
   Borde animado degradado + glow + badge
══════════════════════════════════════ */
.ia-tools-list li:nth-child(5) {
  margin-top: 0.6rem; /* separador visual extra */
}

.ia-tools-list li:nth-child(5) a {
  background: linear-gradient(135deg, #f7f8ff 0%, #eef1ff 100%);
  border-color: transparent;
  overflow: visible; /* necesario para el borde animado externo */
}

/* Borde animado degradado igual que btn-ia-tools */
.ia-tools-list li:nth-child(5) a::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(270deg, #7f00ff, #e100ff, #00c3ff, #7f00ff);
  background-size: 300% 300%;
  animation: iaBorderMove 4s linear infinite;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  left: 0; /* override el shimmer */
  width: 100%;
  height: 100%;
  top: 0;
  transition: none;
}

/* Cancelar shimmer solo para TutorIA (usa ::before para el borde) */
.ia-tools-list li:nth-child(5) a:hover::before {
  left: 0; /* no shimmer */
}

@keyframes iaBorderMove {
  0%   { background-position: 0%   50%; }
  100% { background-position: 100% 50%; }
}

/* Ícono TutorIA */
.ia-tools-list li:nth-child(5) a > .fa {
  color: #6366f1;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.14), rgba(0, 195, 255, 0.14));
}

/* Título TutorIA */
.ia-tools-list li:nth-child(5) a strong {
  color: #4f46e5;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Badge "Chat" via ::after del strong */
.ia-tools-list li:nth-child(5) a strong::after {
  content: 'Chat';
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  background: linear-gradient(135deg, #7c3aed, #00b4d8);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: 999px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  line-height: 1.6;
}

/* Hover TutorIA */
.ia-tools-list li:nth-child(5) a:hover {
  transform: translateX(-3px) translateY(-2px);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.28);
  background: linear-gradient(135deg, #f0f1ff 0%, #e8ecff 100%);
}

.ia-tools-list li:nth-child(5) a:hover > .fa {
  transform: scale(1.15) rotate(-6deg);
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
body.ia-panel-open {
  overflow: hidden;
}

@media (max-width: 576px) {
  .ia-panel {
    width: 100%;
  }

  .ia-panel-header {
    padding: 1.1rem 1rem 1rem;
  }

  .ia-panel-body {
    padding: 1rem;
  }
}

/* Responsive: en pantallas pequeñas centrar el header en dos líneas si es necesario */
@media (max-width: 576px) {
  .courses-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
}


/* Responsive */

@media (max-width: 768px) {
    .my-courses-header {
        align-items: flex-start;
    }

    .my-course-progress {
        flex-direction: column;
        align-items: flex-start;
    }

    .my-course-progress-text {
        font-size: 0.8rem;
    }

    .my-course-actions {
        width: 100%;
    }
}