:root {
    --shadow: #222;
    --darkgray: #333;
    --gray: #444;
    --lightgray: #555;
    --white: #fff;
    --blue: #04c0fe;
    --font: #D1D5DB;
    --bg: #020617;
}

@keyframes opacity {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

nav ul li a {
    position: relative;
    display: inline-block;
    padding: 0 16px;
    color: white;
    text-decoration: none;
}

nav ul li a.active {
    color: var(--blue);
}

nav ul li a::after {
    content: "";
    position: absolute;
    bottom: -10px;
    /* No sale de la caja */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 2px;
    opacity: 0;
    background: var(--blue);
    border-radius: 4px;
    transition: opacity 0.3s ease;
}

nav ul li a.active::after {
    opacity: 1;
    box-shadow: 0 0 8px var(--blue),
        0 0 16px var(--blue),
        0 0 24px var(--blue);
}

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    background-image: url(../images/bg.webp);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

* {
    box-sizing: border-box;
    margin: 0;
    font-family: "Montserrat", sans-serif;
    /* letter-spacing: .1em; */
    text-decoration: none;
    color: var(--font);
}

.blueTitle {
    margin: 20px 0;
    font-size: 3em;
    text-align: start;
    color: var(--blue);
}

.p-1 {
    padding: 1%;
}

.m-8 {
    margin: 8% 0%;
}

.m-20 {
    margin: 20px;
}

.styleBox,
details {
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 3px 0 var(--blue);
}

/* ----------GENERALES---------- */

header,
main,
footer,
body {
  display: flex;
}

header nav { display: flex; }
header nav ul { display: flex; }

@media (max-width: 768px) {
  header nav { display: grid; }
  header nav ul { display: grid; }
}


html,
body {
    height: 100%;
}

section p {
    text-align: justify;
}

main {
    flex-grow: 1;
    flex-direction: column;
    padding: 8rem 15% 0;
}

body {
    background-attachment: fixed;
    flex-direction: column;
}

body::-webkit-scrollbar {
    background-color: var(--shadow);
}

body::-webkit-scrollbar-thumb {
    background: #453347;
    border-radius: 20px;
    border: 5px solid var(--shadow);
}

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;

}

section {
    margin-bottom: 20px;
}

a {
    color: var(--font);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--blue);
}

.breadcrumb-item+.breadcrumb-item::before {
    color: var(--font);
}

/* ----------HEADER---------- */

header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    z-index: 1000;
}

header nav {
    width: 100%;
    padding: 10px;
    border: 1px solid #020617;
    border-radius: 50px;
    background-color: #020617ab;
    backdrop-filter: blur(10px);
}

header nav a {
    padding: 10px 0;
    transition: 0.5s;
}

header nav a:hover {
    color: #04d4fe;
    transition: 0.5s;
}

header nav ul {
    justify-content: space-around;
    gap: 15px;
    width: 100%;
    padding: 0;
}

/* Botón hamburguesa */
.nav-toggle {
    position: absolute;
    right: 12px;
    top: 12px;
    width: 40px;
    height: 40px;
    border: 1px solid #0b1222;
    border-radius: 10px;
    background: #020617ab;
    backdrop-filter: blur(10px);
    display: none;
    /* visible solo en móvil */
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    transition: transform .25s, opacity .25s;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ----------FOOTER---------- */

footer {
    flex-direction: column;
    padding: 20px;
}

.socialMedia {
    border-bottom: 1px solid var(--white);
}

.socialMedia i {
    font-size: 30px;
    margin: 10px;
}

.footerBottom,
.terms,
.footerBottom ul,
.terms span,
.footerBottom li,
.socialMedia {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 10px;
}

.footerBottom,
.socialMedia i {
    margin: 20px;
}

footer li:hover {
    text-decoration: underline;
}

/* ----------CONTACTO---------- */

.flexRow {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin: 20px 20px 20px 0;
}

.flexRow>div {
    width: 400px;
    padding: 10px;
}

.flexRow i {
    color: var(--bg);
    text-align: center;
    font-size: 1.2em;
    padding: 10px 15px;
    background-color: var(--blue);
    border-radius: 10px;
    margin-left: 20px;
    width: 140px;
    cursor: pointer;
    transition: 0.2s;

}

.flexRow i:hover {
    color: #02061789;
    transition: 0.2s;
}

.discord-block i {
    width: 5rem;
    margin-left: 20px;
}

/* ---------EJERCICIOS---------- */

section {
    flex-direction: column;
    align-items: center;
    width: 45%;
}

details {
    background-color: #020617;
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    transition: height 1s ease;
    display: flex;
    flex-direction: column;
}

details a {
    display: block;
}

summary {
    width: 100%;
}

.summaryBox {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.webLinks ul {
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.5rem;
}

.webLinks a {
    display: block;
    padding: 0.6rem;
    text-decoration: none;
    transition: background-color 0.2s;
}

.webLinks li:last-child {
    margin-bottom: 2rem;
}

.webLinks a:hover {
    color: var(--blue)
}

.websSection h2 {
    color: var(--blue);
}

details:not([open]) {
    height: auto;
}

details[open] {
    height: auto;
    overflow: hidden;
}

details:hover {
    cursor: pointer;
}

details>a {
    transition: opacity 1s ease;
}

details:not([open])>a {
    opacity: 0;
}

details[open]>a {
    opacity: 1;
}

details a:hover {
    text-decoration: underline;
}

.dobleColumn {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
}

.card {
    background-color: var(--bg);
    border-radius: 10px;
    box-shadow: 0 0 3px 0 var(--blue);
}

.card-title {
    color: var(--blue)
}

details {
    width: 100%;
}

section {
    width: 100%;
}


@media (max-width: 768px) {

  /* Barra superior con blur (soluciona la franja sin blur) */
  header{
    position: fixed;
    top: 0;
    left: 0;
    transform: none;
    width: 100%;
    height: 64px;
    padding: 0;
    z-index: 1200;

    display: flex;
    align-items: center;
    justify-content: flex-end;

    background: #020617ab;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #0b1222;
    padding-top: env(safe-area-inset-top);
  }

  /* Burger: que parezca burger */
  .nav-toggle{
    display: inline-flex;
    width: 46px;
    height: 46px;
    margin-right: 12px;

    border: 1px solid #0b1222;
    border-radius: 12px;
    background: #020617cc;
    backdrop-filter: blur(12px);

    align-items: center;
    justify-content: center;
    gap: 5px;

    z-index: 1201;
  }

  .nav-toggle span{
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 10px;
    transition: transform .25s ease, opacity .25s ease;
  }

  .nav-toggle.active span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
  .nav-toggle.active span:nth-child(2){ opacity: 0; }
  .nav-toggle.active span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

  /* Panel del menú: centrado y bonito (tipo sheet) */
  header nav{
    position: fixed;
    top: calc(64px + env(safe-area-inset-top));
    left: 0;
    right: 0;
    bottom: 0;

    display: grid;
    place-items: start center;

    background: rgba(2,6,23,.45);
    backdrop-filter: blur(10px);

    transform: translateY(-110%);
    transition: transform .25s ease;

    border-radius: 0;
    overflow: auto;
    z-index: 1200;
  }

  header nav.open{ transform: translateY(0); }

  /* Caja interior para que no quede “pegado” arriba */
  header nav ul{
    width: min(420px, 92vw);
    margin: 16px auto 24px;
    padding: 16px;
    display: grid;
    gap: 12px;

    border: 1px solid #0b1222;
    border-radius: 18px;
    background: #020617ab;
    backdrop-filter: blur(12px);
  }

  /* Links: ancho fijo centrado y con aire */
  header nav ul li { display: block; }

  header nav a{
    display: block;
    width: 100%;

    padding: 12px 16px;
    border-radius: 999px;

    border: 1px solid #0b1222;
    background: #020617d1;

    text-align: center;
    letter-spacing: .06em;
    font-size: 1rem;
  }

  /* Quita el “subrayado glow” en móvil o se ve raro */
  nav ul li a::after{ display: none; }

  /* Backdrop + bloquear scroll */
  body.nav-open{ overflow: hidden; touch-action: none; }
}
