/* danilopez25.es — LAB / Code Lab
   Adaptado a la view actual de code_lab_view.php
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  overflow-x: hidden;
  background: #05040b;
}

.container-fluid {
  padding-right: 0 !important;
  padding-left: 0 !important;
}

/* =========================================================
   PAGE
   ========================================================= */

.code-lab-page {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100vh;
  padding: 118px 20px 110px;

  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.code-lab-overlay {
  position: absolute;
  z-index: -2;
  inset: 0;

  background:
    radial-gradient(
      circle at 50% 5%,
      rgba(123, 92, 255, .18),
      transparent 32%
    ),
    radial-gradient(
      circle at 90% 62%,
      rgba(181, 108, 255, .08),
      transparent 28%
    ),
    rgba(4, 3, 10, .69);
}

/* =========================================================
   MAIN PANEL
   ========================================================= */

.code-lab-panel {
  position: relative;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 48px);

  overflow: hidden;

  border: 1px solid rgba(181, 108, 255, .22);
  border-radius: 24px;

  background: rgba(8, 7, 16, .79);

  box-shadow:
    0 36px 110px rgba(0, 0, 0, .52);

  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.code-lab-panel::before {
  content: "";

  position: absolute;
  top: 0;
  left: 13%;

  width: 74%;
  height: 1px;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(181, 108, 255, .74),
      transparent
    );
}

/* =========================================================
   BACK BUTTON
   ========================================================= */

.code-lab-toolbar {
  display: flex;
  width: 100%;
  justify-content: flex-start;
}

.code-lab-back {
  display: inline-flex;
  min-height: 38px;
  padding: 8px 14px;

  align-items: center;
  gap: 8px;

  border: 1px solid rgba(181, 108, 255, .34);
  border-radius: 999px;

  background: rgba(123, 92, 255, .08);

  color: #d9ccff;

  font-size: 13px;
  font-weight: 800;
  letter-spacing: .05em;

  text-decoration: none;

  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease;
}

.code-lab-back:hover {
  transform: translateX(-2px);

  border-color: rgba(181, 108, 255, .62);
  background: rgba(123, 92, 255, .16);

  color: #fff;
  text-decoration: none;
}

/* =========================================================
   HEADER
   ========================================================= */

.code-lab-head {
  max-width: 820px;
  margin: 4px auto clamp(42px, 4.5vw, 58px);

  color: #fff;
  text-align: center;
}

.code-lab-eyebrow {
  display: inline-flex;
  margin-bottom: 14px;

  align-items: center;
  gap: 8px;

  color: #b98aff;

  font-size: 12px;
  font-weight: 850;
  letter-spacing: .22em;

  text-transform: uppercase;
}

.code-lab-head h1 {
  margin: 0;

  color: #fff;

  font-size: clamp(40px, 5vw, 64px);
  font-weight: 900;
  line-height: .95;
  letter-spacing: .045em;

  text-transform: uppercase;

  text-shadow:
    0 0 10px rgba(255, 255, 255, .14),
    0 0 26px rgba(181, 108, 255, .44);
}

.code-lab-head p {
  margin: 18px 0 0;

  color: rgba(255, 255, 255, .72);

  font-size: clamp(14px, 1.6vw, 17px);
  line-height: 1.58;
}

.code-lab-head::after {
  content: "";

  display: block;

  width: 62px;
  height: 3px;

  margin: 20px auto 0;

  border-radius: 999px;

  background:
    linear-gradient(
      90deg,
      #7b5cff,
      #b56cff
    );

  box-shadow:
    0 0 17px rgba(181, 108, 255, .42);
}

/* =========================================================
   GRID
   ========================================================= */

.code-lab-grid {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 20px;
}

/* =========================================================
   CARDS
   ========================================================= */

.code-lab-card {
  position: relative;

  display: flex;

  min-width: 0;
  min-height: 430px;

  padding: 26px 24px 24px;

  flex-direction: column;
  align-items: center;

  overflow: hidden;

  border: 1px solid rgba(181, 108, 255, .34);
  border-radius: 20px;

  background:
    radial-gradient(
      circle at 50% 12%,
      rgba(123, 92, 255, .08),
      transparent 34%
    ),
    linear-gradient(
      145deg,
      rgba(19, 17, 31, .95),
      rgba(10, 9, 18, .94)
    );

  color: #fff;

  box-shadow:
    0 20px 52px rgba(0, 0, 0, .28);

  transition:
    transform .22s ease,
    border-color .22s ease,
    box-shadow .22s ease;
}

.code-lab-card::before {
  content: "";

  position: absolute;
  right: -70px;
  bottom: -90px;

  width: 220px;
  height: 220px;

  border-radius: 50%;

  background: rgba(123, 92, 255, .09);

  filter: blur(48px);

  pointer-events: none;
}

.code-lab-card:hover {
  transform: translateY(-4px);

  border-color: rgba(181, 108, 255, .56);

  box-shadow:
    0 28px 62px rgba(0, 0, 0, .36);
}

/* =========================================================
   CARD TOP
   ========================================================= */

.code-lab-card-top {
  position: relative;

  display: flex;
  width: 100%;
  min-height: 92px;

  align-items: flex-start;
  justify-content: center;
}

.code-lab-number {
  position: absolute;
  top: 0;
  left: 0;

  color: #9f56ff;

  font-size: 14px;
  font-weight: 900;
  letter-spacing: .08em;
}

.code-lab-icon {
  position: relative;
  z-index: 1;

  display: grid;

  width: 82px;
  height: 82px;

  place-items: center;

  border: 1px solid rgba(181, 108, 255, .6);
  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      rgba(123, 92, 255, .13),
      rgba(8, 7, 16, .45)
    );

  color: #a95cff;

  font-size: 32px;

  box-shadow:
    inset 0 0 24px rgba(123, 92, 255, .09),
    0 0 24px rgba(123, 92, 255, .08);
}

/* SQL no queda gris: mismo lenguaje visual */
.code-lab-card--sql .code-lab-icon {
  border-color: rgba(181, 108, 255, .6);
  background:
    radial-gradient(
      circle,
      rgba(123, 92, 255, .13),
      rgba(8, 7, 16, .45)
    );
  color: #a95cff;
}

/* =========================================================
   CARD COPY
   ========================================================= */

.code-lab-copy {
  display: flex;

  width: 100%;
  margin-top: 18px;

  flex: 1;
  flex-direction: column;
  align-items: center;

  text-align: center;
}

.code-lab-status {
  display: inline-flex;

  margin-bottom: 10px;

  align-items: center;
  gap: 7px;

  color: rgba(255, 255, 255, .46);

  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .09em;

  text-transform: uppercase;
}

.code-lab-status i {
  font-size: 7px;
}

.code-lab-status--active {
  color: #6bea95;
}

.code-lab-copy h2 {
  margin: 0;

  color: #fff;

  font-size: clamp(22px, 2.4vw, 29px);
  font-weight: 900;
  line-height: 1.12;
}

/* el título largo del Playground no rompe la tarjeta */
.code-lab-card--playground .code-lab-copy h2 {
  max-width: 100%;
  font-size: clamp(21px, 2.1vw, 27px);
}

.code-lab-copy > p {
  max-width: 360px;

  margin: 16px auto 0;

  color: rgba(255, 255, 255, .7);

  font-size: 14px;
  line-height: 1.62;
}

/* =========================================================
   CHIPS
   ========================================================= */

.code-lab-chips {
  display: flex;

  margin-top: 21px;

  justify-content: center;
  flex-wrap: wrap;

  gap: 7px;
}

.code-lab-chips span {
  padding: 6px 11px;

  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;

  background: rgba(255, 255, 255, .045);

  color: rgba(255, 255, 255, .76);

  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.2;
}

/* =========================================================
   ACTIONS
   ========================================================= */

.code-lab-actions {
  position: relative;
  z-index: 1;

  display: flex;

  width: 100%;

  margin-top: auto;
  padding-top: 29px;

  justify-content: center;
  flex-wrap: wrap;

  gap: 10px;
}

.code-lab-button {
  display: inline-flex;

  min-height: 44px;
  padding: 10px 18px;

  align-items: center;
  justify-content: center;

  gap: 8px;

  border-radius: 10px;

  font-size: 13px;
  font-weight: 850;

  text-decoration: none;

  transition:
    transform .18s ease,
    filter .18s ease,
    border-color .18s ease,
    background .18s ease;
}

.code-lab-button--primary {
  min-width: 170px;

  border: 1px solid rgba(181, 108, 255, .58);

  background:
    linear-gradient(
      135deg,
      #7547f3,
      #9e3ff1
    );

  color: #fff;

  box-shadow:
    0 9px 22px rgba(123, 92, 255, .2);
}

.code-lab-button--secondary {
  border: 1px solid rgba(181, 108, 255, .42);

  background: rgba(123, 92, 255, .07);

  color: #d9ccff;
}

.code-lab-button:hover {
  transform: translateY(-1px);

  color: #fff;

  text-decoration: none;
}

.code-lab-button--primary:hover {
  filter: brightness(1.08);
}

.code-lab-button--secondary:hover {
  border-color: rgba(181, 108, 255, .68);

  background: rgba(123, 92, 255, .17);
}

.code-lab-button--disabled {
  border: 1px solid rgba(255, 255, 255, .12);

  background: rgba(255, 255, 255, .04);

  color: rgba(255, 255, 255, .42);

  box-shadow: none;

  cursor: default;
}

.code-lab-back:focus-visible,
.code-lab-button:focus-visible {
  outline: 2px solid #c190ff;
  outline-offset: 3px;
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1100px) {
  .code-lab-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .code-lab-card {
    min-height: 410px;
  }

  .code-lab-card--playground {
    grid-column: 1 / -1;
  }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 760px) {
  .code-lab-page {
    padding: 94px 14px 90px;

    background-attachment: scroll;
  }

  .code-lab-panel {
    padding: 28px 18px;

    border-radius: 19px;
  }

  .code-lab-toolbar {
    margin-bottom: 20px;
  }

  .code-lab-grid {
    grid-template-columns: 1fr;
  }

  .code-lab-card,
  .code-lab-card--playground {
    grid-column: auto;

    min-height: 390px;
  }

  .code-lab-icon {
    width: 78px;
    height: 78px;

    font-size: 30px;
  }

  .code-lab-card-top {
    min-height: 88px;
  }
}

@media (max-width: 520px) {
  .code-lab-page {
    padding-right: 10px;
    padding-left: 10px;
  }

  .code-lab-panel {
    padding: 26px 12px;
  }

  .code-lab-head h1 {
    font-size: 42px;
  }

  .code-lab-card {
    min-height: 0;

    padding: 24px 18px 20px;
  }

  .code-lab-card-top {
    min-height: 78px;
  }

  .code-lab-icon {
    width: 72px;
    height: 72px;

    font-size: 28px;
  }

  .code-lab-number {
    font-size: 13px;
  }

  .code-lab-copy > p {
    font-size: 13.5px;
  }

  .code-lab-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .code-lab-button,
  .code-lab-button--primary {
    width: 100%;
  }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .code-lab-card,
  .code-lab-back,
  .code-lab-button {
    transition: none;
  }

  .code-lab-card:hover,
  .code-lab-back:hover,
  .code-lab-button:hover {
    transform: none;
  }
}
