body {
  margin: 0;
  padding: 0;
  color: white;
  background-image: url("../img/background/background.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  font-family: "Source Code Pro", monospace;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
}

h1 {
  text-align: center;
  color: #ffcc00;
  animation: glow 2.5s ease-in-out infinite;
}

h2 {
  margin: 0;
  padding: 0;
  text-align: center;
  font-family: inherit;
  color: #00bcd4;
  transition: transform 0.5s ease;
  &:hover {
    transform: rotate3d(1, 1, 1, 10deg) scale(1.1);
  }
}

/* --- Sección del Encabezado (header) --- */
#encabezado_nav {
  position: fixed;
  top: 0;
  width: 100%;
  height: 60px;
  background-color: rgba(128, 128, 128, 0.479);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transition: top 0.3s ease;

  nav {
    display: flex;
    align-items: center;
    height: 100%;
  }

  .ul_encabezado {
    list-style: none;
    display: flex;
    justify-content: space-around;
    padding: 0;
    margin: 0;
    width: 100%;
  }

  .nav_item {
    position: relative;
  }

  .a_nav {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 20px;
    display: block;
  }

  .a_nav:hover {
    color: black;
    text-decoration: underline;
  }

  /* Submenú oculto por defecto */
  .submenu {
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
  }

  /* Mostrar submenú al hacer hover */
  .nav_item:hover .submenu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* --- Sección Principal (main) --- */
main {
  margin-top: 65px;

  #Description,
  #title-skills {
    font-family: inherit;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
  }

  #home {
    h3 {
      margin-bottom: 20px;
      text-align: center;
      font-family: inherit;
      color: #00bcd4;
      transition: transform 0.5s ease;
      &:hover {
        transform: rotate3d(1, 1, 1, 10deg) scale(1.1);
      }
    }
    display: grid;
    grid-template-columns: 4fr 4fr;
    grid-template-rows: 4fr 2fr;

    #home1,
    #home2 {
      background-color: rgba(0, 0, 0, 0.4);
      border-radius: 15px;
      padding: 15px;
      box-shadow: 0 0 15px rgba(173, 216, 230, 0.6);
      border: 1px solid rgba(255, 255, 255, 0.2);
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      animation: fadeIn 1s ease-out forwards;
    }

    #home1 {
      grid-column: 1/2;
      grid-row: 1/2;
      margin-top: 20px;
      margin-left: 70px;
      margin-right: 15px;
    }

    #home2 {
      grid-column: 2/2;
      grid-row: 1/2;
      margin-top: 20px;
      margin-right: 70px;
      margin-left: 15px;
    }

    a {
      transition: transform 0.4s ease;
      display: inline-block;
      &:hover {
        transform: scale(1.1);
        font-weight: bold;
      }
    }

    ul {
      list-style-position: inside;
      padding: 0;
      margin: 0;
      li {
        transition: color 0.4s ease, transform 0.6s ease-in-out;
        &:hover {
          color: rgba(255, 0, 0, 0.562);
          font-weight: bold;
          transform: translateX(-30px) scale(1.1);
        }
      }
    }
  }
}

/* --- Sección de Habilidades (Skills) --- */
#title-skills {
  font-size: 2.5em;
  font-weight: 700;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
  text-align: center;
}

#div_programingSkills {
  width: 95%;
  overflow: hidden;
  position: relative;
  padding: 20px 0 85px 0;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.7) 30%,
    rgba(255, 255, 255, 0.7) 70%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.7) 30%,
    rgba(255, 255, 255, 0.7) 70%,
    transparent
  );

  .carousel-track {
    display: flex;
    gap: 70px;
    animation: scroll-left 40s linear infinite;
    white-space: nowrap;
    padding: 20px 0;
    will-change: transform;
  }

  &:hover .carousel-track {
    animation-play-state: paused;
  }

  .skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 220px;
    transition: transform 0.4s ease-in-out;
    flex-shrink: 0;
    position: relative;
    &:hover .dropdown-menu {
      display: block;
    }
  }

  .titulo,
  .descripcion {
    display: none;
  }

  .img {
    width: 200px;
    height: 100px;
    border-radius: 25px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    padding: 10px;
    cursor: pointer;
    transition: transform 0.4s ease-in-out;
  }

  .skill-item:hover .img {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.8);
  }

  .dropdown-menu {
    display: none;
    position: absolute;
    bottom: -100px;
    background-color: #2a2a2a;
    padding: 10px;
    border-radius: 10px;
    color: #f0f0f0;
    z-index: 10;
    text-align: left;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.5s ease-in-out forwards;
    box-sizing: border-box;

    p {
      margin: 5px 0;
      font-size: 0.9em;
      line-height: 2;
      text-align: center;
    }

    strong {
      color: #fff;
    }
  }
}

/* --- Sección de Artículo (article) --- */
article {
  h4 {
    font-family: "Times New Roman", Times, serif;
    font-size: 1rem;
    color: red;
    margin-top: 50px;
    padding: 0;
    text-align: center;
  }

  #Links {
    display: flex;
    justify-content: center;
    gap: 70px;
    padding-bottom: 30px;
    transition: transform 1s ease;

    .img1,
    .img2,
    .img3,
    .img4 {
      transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
      &:hover {
        transform: scale(1.1);
        font-weight: bold;
      }
    }
  }
}

/* --- Sección del Pie de Página (footer) --- */
footer {
  width: 50%;
  padding: 20px;

  h3 {
    font-family: inherit;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
    transition: transform 0.5s ease;
    margin-bottom: 20px;
    &:hover {
      transform: scale(1.1);
    }
  }

  .inputs {
    all: unset;
    padding: 15px;
    margin: 15px;
    height: 30px;
    width: 80%;
    background-color: rgba(128, 128, 128, 0.39);
    border-radius: 12px;
    border: 0px 2px 2px 2px rgba(0, 0, 0, 0.4);
    transition: border 0.3s ease-in-out;
    &:hover {
      box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
      transform: scale(1.01);
      transition: all 0.4s ease-in-out;
    }
    &:focus {
      outline: 2px solid red;
    }
  }

  textarea.inputs {
    height: 5em;
    font-family: inherit;
  }

  #inputButton {
    margin: 15px;
    height: 30px;
    background-color: brown;
    cursor: pointer;
    width: 80%;
    transition: transform 0.5s ease;
    &:hover {
      transform: scale(1.1);
      font-weight: bold;
    }
  }
}

/* --- Keyframes --- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-80px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes rotate {
  0% {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(90deg);
  }
  100% {
    transform: rotateY(0deg);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes glow {
  0% {
    text-shadow: 0 0 5px #00bcd4;
  }
}

@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-2250px);
  }
}

@media (max-width: 768px) {
  .carousel-track {
    gap: 50px;
  }
  .skill-item {
    width: 180px;
  }
  .skill-item .img {
    width: 150px;
  }
  .dropdown-menu {
    bottom: -160px;
  }
}
