/**
 * Cursos · HUD cyberpunk catalog (solo presentación)
 * negro / zinc / #FF3B30
 */

/* —— Terminal search —— */
.cursos-terminal {
  position: relative;
  display: flex;
  align-items: stretch;
  border: 1px solid #27272a;
  border-radius: 0.85rem;
  background: linear-gradient(180deg, #121214 0%, #09090b 100%);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.cursos-terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 59, 48, 0.06), transparent 40%);
  opacity: 0.8;
}
.cursos-terminal:focus-within {
  border-color: rgba(255, 59, 48, 0.45);
  box-shadow:
    0 0 0 1px rgba(255, 59, 48, 0.15),
    0 0 20px rgba(255, 59, 48, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.cursos-terminal-prefix {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.85rem 0 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #FF3B30;
  border-right: 1px solid #27272a;
  flex-shrink: 0;
  background: rgba(255, 59, 48, 0.04);
  z-index: 1;
}
.cursos-terminal-prefix .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FF3B30;
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.7);
}
.cursos-terminal input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.75rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: #e4e4e7;
  z-index: 1;
}
.cursos-terminal input::placeholder {
  color: #52525b;
  letter-spacing: 0.06em;
}
.cursos-terminal-hint {
  display: none;
  align-items: center;
  padding-right: 0.85rem;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #3f3f46;
  flex-shrink: 0;
  z-index: 1;
}
@media (min-width: 640px) {
  .cursos-terminal-hint { display: flex; }
}

/* —— Sector / day headers —— */
.curso-sector {
  margin-bottom: 2rem;
}
.curso-sector-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #27272a;
  position: relative;
}
.curso-sector-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 4.5rem;
  height: 2px;
  background: linear-gradient(90deg, #FF3B30, transparent);
  box-shadow: 0 0 10px rgba(255, 59, 48, 0.4);
}
.curso-sector-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.45rem;
  border-radius: 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #FF3B30;
  background: rgba(255, 59, 48, 0.1);
  border: 1px solid rgba(255, 59, 48, 0.35);
  flex-shrink: 0;
}
.curso-sector-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f4f4f5;
}
.curso-sector-meta {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #71717a;
  flex-shrink: 0;
}

/* —— Course cards —— */
.curso-card {
  text-align: left;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  border-radius: 1.1rem;
  border: 1px solid #27272a;
  background:
    linear-gradient(165deg, rgba(24, 24, 27, 0.98) 0%, rgba(9, 9, 11, 0.99) 100%);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.2s ease,
    box-shadow 0.25s ease;
  animation: curso-card-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform;
}
.curso-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(#FF3B30, #FF3B30) top left / 12px 2px no-repeat,
    linear-gradient(#FF3B30, #FF3B30) top left / 2px 12px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)) bottom right / 10px 1px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)) bottom right / 1px 10px no-repeat;
  opacity: 0.45;
  z-index: 0;
}
.curso-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 59, 48, 0.45);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.4),
    0 0 24px rgba(255, 59, 48, 0.12),
    inset 0 0 0 1px rgba(255, 59, 48, 0.08);
}
.curso-card:hover::before {
  opacity: 0.85;
}
.curso-card:active {
  transform: translateY(-1px) scale(0.99);
}

.curso-card-top {
  height: 3px;
  flex-shrink: 0;
  background: linear-gradient(90deg, #FF3B30, rgba(255, 59, 48, 0.2));
  box-shadow: 0 0 12px rgba(255, 59, 48, 0.45);
  position: relative;
  z-index: 1;
}
.curso-card.is-offline .curso-card-top {
  background: #3f3f46;
  box-shadow: none;
  opacity: 0.5;
}

.curso-card-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.1rem 1.15rem 1.15rem;
  min-height: 0;
}

.curso-card-name {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
  color: #fafafa;
  letter-spacing: 0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tech panel rows: día / hora / profe */
.curso-tech {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.85rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.55rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #27272a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.curso-tech-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 10px;
  line-height: 1.35;
  min-width: 0;
}
.curso-tech-key {
  flex-shrink: 0;
  width: 2.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #52525b;
}
.curso-tech-val {
  color: #a1a1aa;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* Big HUD count */
.curso-hud-count {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 0.75rem;
}
.curso-hud-num {
  font-size: 2.65rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: #FF3B30;
  text-shadow: 0 0 24px rgba(255, 59, 48, 0.35);
}
.curso-hud-label {
  margin-top: 0.35rem;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #71717a;
}
.curso-energy {
  width: 100%;
  height: 3px;
  margin-top: 0.85rem;
  border-radius: 999px;
  background: #18181b;
  overflow: hidden;
  border: 1px solid #27272a;
}
.curso-energy > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #b91c1c, #FF3B30 60%, #ff6b63);
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.5);
  transition: width 0.4s ease;
}

/* Offline / vacío */
.curso-card.is-offline {
  opacity: 0.72;
  background:
    linear-gradient(165deg, rgba(18, 18, 20, 0.9) 0%, rgba(9, 9, 11, 0.95) 100%);
  border-color: #1f1f22;
  filter: saturate(0.55);
}
.curso-card.is-offline:hover {
  opacity: 0.88;
  filter: saturate(0.75);
  border-color: #3f3f46;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.curso-card.is-offline .curso-card-name {
  color: #71717a;
}
.curso-card.is-offline .curso-hud-num {
  color: #3f3f46;
  text-shadow: none;
}
.curso-card.is-offline .curso-tech {
  background: rgba(0, 0, 0, 0.2);
  border-color: #1f1f22;
}
.curso-card.is-offline .curso-tech-val {
  color: #52525b;
}
.curso-card.is-offline .curso-energy > i {
  background: #3f3f46;
  box-shadow: none;
  width: 0 !important;
}
.curso-offline-tag {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.25rem 0.45rem;
  border-radius: 0.35rem;
  color: #52525b;
  background: #18181b;
  border: 1px solid #27272a;
}

@keyframes curso-card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Modal roster —— */
#curso-modal .pw-panel {
  border-color: #27272a;
  background: linear-gradient(165deg, #18181b, #0c0c0e);
}
.curso-modal-head-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #FF3B30;
  margin: 0 0 0.25rem;
  font-weight: 600;
}
#modal-curso-nombre {
  letter-spacing: 0.04em;
}
#modal-curso-count {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.curso-roster-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.75rem;
  background: rgba(9, 9, 11, 0.75);
  border: 1px solid #27272a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.curso-roster-row:hover {
  border-color: rgba(255, 59, 48, 0.3);
  box-shadow: 0 0 12px rgba(255, 59, 48, 0.06);
}
.curso-roster-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.55rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e4e4e7;
  background: linear-gradient(145deg, #27272a, #18181b);
  border: 1px solid #3f3f46;
}
.curso-roster-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f4f4f5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.curso-roster-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  color: #71717a;
  letter-spacing: 0.04em;
}
.curso-roster-tel {
  font-size: 11px;
  color: #a1a1aa;
  margin-top: 0.15rem;
}

/* Empty catalog */
.cursos-empty-hud {
  text-align: center;
  padding: 2.5rem 1.25rem;
  border: 1px dashed #27272a;
  border-radius: 1rem;
  background: rgba(9, 9, 11, 0.6);
  color: #71717a;
  font-size: 0.875rem;
}
.cursos-empty-hud .tag {
  display: block;
  margin-top: 0.4rem;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 59, 48, 0.55);
}

/* Grid */
.cursos-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}
@media (min-width: 640px) {
  .cursos-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}
@media (min-width: 1024px) {
  .cursos-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1280px) {
  .cursos-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .curso-card {
    animation: none;
  }
  .curso-card:hover {
    transform: none;
  }
}
