/* shared.css — Módulo de Electrónica · Laboratorio Tech */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #07111f;
  --bg-soft: #0d1b2a;
  --panel: rgba(15, 23, 42, 0.8);
  --panel-strong: #0f172a;
  --card: rgba(15, 23, 42, 0.78);
  --card-strong: #111827;
  --line: rgba(148, 163, 184, 0.18);
  --primary: #38bdf8;
  --primary-strong: #2563eb;
  --secondary: #22c55e;
  --text: #e2e8f0;
  --muted: #b6c4d9;
  --accent: #7dd3fc;
  --grad: linear-gradient(135deg, #0f172a 0%, #1d4ed8 38%, #0ea5e9 100%);
  --grad-soft: linear-gradient(135deg, rgba(56,189,248,0.20), rgba(34,197,94,0.12));
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, 'Segoe UI', Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(34,211,238,0.28), transparent 18%),
    radial-gradient(circle at top right, rgba(59,130,246,0.24), transparent 22%),
    radial-gradient(circle at bottom right, rgba(16,185,129,0.18), transparent 18%),
    linear-gradient(180deg, #020912 0%, #071827 35%, #081d2d 100%);
  background-size: auto, auto, auto, auto;
  background-position: 0 0, 0 0, 0 0, 0 0;
  background-attachment: fixed, fixed, fixed, fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
  mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("../logo-sena-negro-jpg-2022-removebg-preview.png") center 54% / min(42vw, 420px) auto no-repeat;
  filter: brightness(0) invert(1);
  opacity: 0.1;
}

/* ── Header ── */
header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(7,17,31,0.85), rgba(18,56,89,0.72));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: white;
  padding: 0 0 82px;
  border-bottom: 1px solid rgba(125,211,252,0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 12px 30px rgba(2,6,23,0.18);
}

header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.08) 0%, transparent 58%),
    radial-gradient(circle at 80% 20%, rgba(34,197,94,0.15) 0%, transparent 50%);
  pointer-events: none;
}

header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 52px;
  background: #07111f;
  clip-path: ellipse(58% 100% at 50% 100%);
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 36px 24px 0;
  position: relative;
  z-index: 1;
}

.header-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  padding: 10px 16px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  transition: transform 0.25s ease, background 0.25s ease;
}

.back-link:hover {
  background: rgba(255,255,255,0.18);
  transform: translateX(-3px);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  opacity: 0.82;
  margin-bottom: 12px;
  font-weight: 700;
  color: #dbeafe;
}

h1 {
  font-size: clamp(2rem, 3vw, 3.3rem);
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.08;
  letter-spacing: -0.06em;
  /* Efecto Cristal Líquido EXTREMO */
  background: linear-gradient(90deg,
    #06b6d4 0%,
    #a5f3fc 15%,
    #67e8f9 30%,
    #dbeafe 45%,
    #06b6d4 60%,
    #0891b2 75%,
    #0e7490 90%,
    #06b6d4 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: liquidCrystalFlow 5s ease-in-out infinite;
  filter: drop-shadow(0 8px 20px rgba(56, 189, 248, 0.6)) 
          drop-shadow(0 4px 12px rgba(14, 165, 233, 0.5));
}

.lead {
  font-size: 1.02rem;
  line-height: 1.8;
  max-width: 700px;
  color: rgba(226,232,240,0.92);
}

/* ── Content wrapper ── */
.content {
  max-width: 980px;
  margin: -42px auto 60px;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

/* ── Illustration card ── */
.illustration {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(10, 18, 30, 0.68));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(125,211,252,0.2);
  border-radius: 22px;
  box-shadow: 0 22px 60px rgba(15,23,42,0.2), inset 0 1px 0 rgba(255,255,255,0.08), 0 0 18px rgba(56,189,248,0.08);
  margin-bottom: 18px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  animation: slideUp 0.45s ease both;
  perspective: 1200px;
}

.illustration::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(148,163,184,0.08) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(148,163,184,0.08) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 100%);
}

.illustration::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 50%, rgba(14,165,233,0.08) 100%);
  pointer-events: none;
  border-radius: 22px;
}

.illustration svg {
  position: relative;
  z-index: 1;
  max-width: 100%;
  height: auto;
  max-height: 260px;
  filter: drop-shadow(0 24px 30px rgba(2, 6, 23, 0.45)) drop-shadow(0 10px 14px rgba(14, 165, 233, 0.2)) brightness(1) saturate(1.12);
  transform: perspective(1200px) translateZ(20px);
  transition: transform 0.2s ease-out, filter 0.2s ease-out;
}

.illustration:hover svg {
  transform: perspective(1200px) translateZ(42px);
  filter: drop-shadow(0 30px 40px rgba(2, 6, 23, 0.52)) drop-shadow(0 15px 18px rgba(14, 165, 233, 0.25)) brightness(1.02) saturate(1.14);
}

.illustration svg rect:first-of-type {
  fill: transparent;
  stroke: rgba(125, 211, 252, 0.26);
  stroke-width: 1.2;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.3));
}

.illustration svg * {
  vector-effect: non-scaling-stroke;
  filter: none;
}

.illustration svg text {
  letter-spacing: 0.04em;
  paint-order: stroke fill;
  stroke: rgba(10, 15, 26, 0.34);
  stroke-width: 0.6px;
  filter: drop-shadow(0 4px 8px rgba(56, 189, 248, 0.2));
}

.illustration svg text[fill="#64748b"],
.illustration svg text[fill="#1e3a8a"] {
  fill: #bae6fd !important;
}

.tabla-colores svg rect:first-of-type {
  fill: transparent;
  stroke: rgba(125, 211, 252, 0.26);
}

.tabla-colores svg line {
  stroke: #64748b;
}

.ilustracion-resistencia svg text {
  fill: #dbeafe !important;
}

/* Animación de cristal líquido - removida, ahora controlada por JavaScript */

/* ── Cards ── */
.card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.7), rgba(10, 18, 30, 0.66));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(125,211,252,0.18);
  border-radius: 18px;
  padding: 26px 28px;
  margin-bottom: 16px;
  box-shadow: 0 18px 44px rgba(15,23,42,0.18), inset 0 1px 0 rgba(255,255,255,0.08), 0 0 16px rgba(56,189,248,0.06);
  position: relative;
  overflow: hidden;
  animation: slideUp 0.45s ease both;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.16s; }
.card:nth-child(4) { animation-delay: 0.24s; }
.card:nth-child(5) { animation-delay: 0.32s; }

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(56,189,248,0.35);
  box-shadow: 0 24px 50px rgba(15,23,42,0.24);
}

.card h2 {
  color: #d9f3ff;
  margin-bottom: 12px;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: inline-block;
  /* Cristal líquido EXTREMAMENTE visible */
  background: linear-gradient(90deg,
    #38bdf8 0%,
    #a5f3fc 20%,
    #dbeafe 40%,
    #a5f3fc 60%,
    #38bdf8 80%,
    #0891b2 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: liquidCrystalFlow 4s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(56, 189, 248, 0.4))
          drop-shadow(0 2px 6px rgba(14, 165, 233, 0.3));
}

.card p {
  line-height: 1.85;
  color: var(--muted);
  font-size: 0.96rem;
  margin-bottom: 8px;
}

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

.card ul {
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 2;
}

.card em {
  font-style: italic;
  color: var(--accent);
}

.card iframe {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  display: block;
  margin: 12px auto 0;
  border: 1px solid rgba(56,189,248,0.3);
  box-shadow: 0 12px 28px rgba(15,23,42,0.2);
}

.video-container { width: 100%; }

.card p.video-reference {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
}

.video-reference a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.game-link-container {
  display: flex;
  justify-content: center;
  margin: 8px 0 28px;
}

.game-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: 1px solid rgba(186,230,253,0.42);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(125,211,252,0.08));
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 8px 24px rgba(2,132,199,0.18);
  color: white;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-link:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255,255,255,0.3), rgba(125,211,252,0.16));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.38), 0 12px 30px rgba(2,132,199,0.28);
}

.game-link:focus-visible {
  outline: 3px solid #a5f3fc;
  outline-offset: 3px;
}

.image-section {
  margin-bottom: 18px;
}

.image-placeholder {
  background: linear-gradient(180deg, rgba(15,23,42,0.9), rgba(15,23,42,0.76));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 36px rgba(15,23,42,0.18);
}

.image-placeholder svg {
  max-width: 100%;
  height: auto;
  max-height: 220px;
}

/* ── Animations ── */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Efecto de cristal líquido fluido EXTREMO */
@keyframes liquidCrystalFlow {
  0% {
    background-position: 0% 50%;
  }
  25% {
    background-position: 100% 50%;
  }
  50% {
    background-position: 200% 50%;
  }
  75% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .container { padding: 28px 16px 0; }
  .content { padding: 0 14px; margin-top: -28px; }
  .card { padding: 18px 16px; }
  .illustration { padding: 18px 14px; }
  h1 { font-size: 2rem; }
}
