/* Estilos base */
html,
body {
    overscroll-behavior: none; /* bloquea el rebote de scroll */
    padding-top: 80px;
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    overflow-x: hidden;
    background: linear-gradient(135deg, #2c3e50, #6c8ea0);
}

/*!header!*/
.header {
    background: linear-gradient(135deg, #2c3e50, #6c8ea0);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    height: 160px;
    margin: 0;
    /* 🔧 quita cualquier margen por defecto */
}

.header-title {
    margin-bottom: 1rem;
    font-size: 1.8rem;
    color: #ffffff;
    /* Asegura contraste */
}

/* -------------------------------------- */
/* FLAGS (Language selector)              */
/* -------------------------------------- */
.language-selector {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    display: flex;
    gap: 0.5rem;
    z-index: 1001;
}

.language-flag {
    width: 30px;
    height: 20px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s;
    border-radius: 2px;
    overflow: hidden;
}

.language-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.language-flag:hover {
    transform: scale(1.15);
}

.language-flag.active {
    box-shadow: 0 0 0 2px white;
}

/* -------------------------------------- */
/* NAVBAR                                 */
/* -------------------------------------- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Centra los 5 botones */
    gap: 2rem;
    /* Separación entre home, botones y link */
    width: 100%;
    max-width: 1000px;
    padding: 0 2rem;
    box-sizing: border-box;
}

.nav-home-icon,
.nav-link-icon {
    color: white;
    font-size: 1.3rem;
    text-decoration: none;
    padding: 0.6rem;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.nav-home-icon:hover,
.nav-link-icon:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.nav-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    /* Separación uniforme entre los 5 botones */
    flex-wrap: nowrap;
}

.nav-buttons::-webkit-scrollbar {
    display: none;
    /* Oculta scrollbar en navegadores WebKit */
}

/* Botones individuales */
.nav-button {
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
    border: 2px solid rgba(255, 255, 255, 0.2);
    min-width: 120px;
    white-space: nowrap;
}

.nav-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Estilos para botones activos del navbar */
.nav-button.active {
    font-size: 1.1rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid white;
    box-shadow:
        0 0 0 3px rgba(110, 72, 170, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
    transform-origin: center center;
    padding: 0.8rem 1.8rem;
    animation: pulse 2s infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) scaleX(0);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) scaleX(1);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4), 0 4px 8px rgba(0, 0, 0, 0.2);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0), 0 4px 8px rgba(0, 0, 0, 0.2);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0), 0 4px 8px rgba(0, 0, 0, 0.2);
    }
}

.carousel-container {
    display: flex;
    justify-content: center;
    padding: 40px 0;
    /* padding igual arriba y abajo */
}

.carousel {
    position: relative;
    width: 100%;
    max-width: 600px;
    /* tamaño máximo igual para todas */
    aspect-ratio: 3/2;
    /* relación de aspecto fija y consistente */
    overflow: hidden;
    border-radius: 10px;
}

.carousel img {
    position: absolute;
    /* superpone las imágenes */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* rellena sin deformarse */
    opacity: 0;
    transition: opacity 1s ease-in-out;
    border-radius: 10px;
}

.carousel img.active {
    opacity: 1;
    /* sólo la imagen activa es visible */
    z-index: 1;
}

/*!Secciones!*/
.section {
    background-color: rgb(255, 255, 255);
    /* Fondo blanco para contraste */
    padding: 60px 6rem 2rem;
    scroll-margin-top: 140px;
    margin: 0 auto 2rem;
    width: 95%;
    max-width: 950px;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    scroll-margin-top: 180px;
}

.section a,
.education a {
    text-decoration: none;
}

/* Agrega margen interno a los elementos de las secciones generales */
.section .section-inner {
    padding: 0 2rem;
    box-sizing: border-box;
}

/* Excluye la sección de badges si es necesario */
.badges-section .section-inner {
    padding: 0;
    /* Sin margen lateral en badges */
}

/* Scroll suave para navegadores que lo soportan */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;

    }
}

/* Efecto decorativo opcional para las secciones */
.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: #2d7195;
}

/* Estilos para títulos de sección */
.section h2 {
    font-size: 2.2rem;
    margin: 0 0 1.5rem 0;
    color: #2c3e50;
    /* Azul oscuro */
    position: relative;
    padding-bottom: 15px;
    text-align: center;
    width: 100%;
}

/* Barra decorativa bajo el título */
.section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: #6c8ea0;
    border-radius: 2px;
}

/* Contenedor de contenido */
.section-content {
    max-width: 800px;
    padding: 0 2rem;
    text-align: left;
    margin: 0 auto;
}

/* Estilos para texto */
.section p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #000;
    /* Azul-gris para texto legible */
    margin-bottom: 1.5rem;
    text-align: left;
}

/* Efecto hover para títulos */
.section:hover {
    transform: translateY(-5px);
    transition: transform 0.3s ease;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

/* Contenedor principal */
#content-container {
    padding: 0 1rem;
    padding-top: 40px;
    /* Igual que body.padding-top */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

.badges-section {
    padding: 2rem;
    margin: 2rem auto;
    width: 95%;
    max-width: 1200px;
    /* antes 3000px, ahora un límite más razonable */
    text-align: center;
    background: #fff;
    box-sizing: border-box;
    /* para que padding y border no aumenten el tamaño total */
    overflow-x: auto;
    /* si llegara a desbordarse, permite scroll horizontal */
}


.badges-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    justify-items: center;
}

.badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px;
    border: 4px solid #6c8ea0;
    ;
    /* borde más grueso y color llamativo */
    border-radius: 15px;
    /* un poco más redondeado */
    width: 300px;
    height: 250px;
    background-color: #fff;
    /* opcional: fondo blanco */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    /* un poco de sombra para más impacto */
    transition: border-color 0.4s ease;
    /* Transición para el borde */

}


.badge-img {
    width: 140px;
    height: auto;
    margin-bottom: 0.1rem;
    transition: transform 0.3s ease;
    cursor: pointer;
    padding-top: 20px;
}

/* Agrandar imagen al pasar el ratón */
.badge:hover .badge-img {
    transform: scale(1.4);
    z-index: 10;
    position: relative;
}

.badge:hover {
    border-color: #ff9800;
    /* Color final cuando haces hover */
}


.badge-name {
    text-decoration: none;
    color: #000;
    font-weight: 500;
    transition: color 0.3s ease, transform 0.3s ease;
    padding-top: 40px;

}

.badge-img.enlarged {
    transform: scale(1.8);
    z-index: 9999;
    position: relative;
}

.badge-name:hover {
    color: #0056b3;
    transform: scale(1.05);
}


/*EDUCATION*/

/* h3 en la sección de educación */
#education h3 {
    font-size: 1.4rem;
    margin: 0 0 1rem 0;
    position: relative;
    padding-bottom: 8px;
    text-align: center;

    /* Ajuste para que la barra ocupe el mismo espacio que el texto */
    display: inline-block;
}

/* Centrar el contenedor del h3 */
#education .section-content {
    text-align: center;
    /* Esto centra el inline-block */
}

/* Barra decorativa igual al ancho del texto */
#education h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: #6c8ea0;
    border-radius: 2px;
}



#education h4 {
    font-size: 1rem;
    color: #666;
    /* Gris oscuro */
    margin-bottom: 0.5rem;
    font-weight: bold;
}

#education p {
    font-size: 1rem;
    color: #000;
    /* Gris oscuro / azul-grisaceo */
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Opcional: listas más limpias y legibles */
#education ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

#education li {
    margin-bottom: 0.3rem;
    color: #000;
    font-size: 1rem;
    text-align: left;
}

/* WEBS Y BOTS */
/* 🧩 Contenedor de subsección */
.subsection-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

/* 🏷️ Título de subsección */
.subsection-title {
  font-size: 1.6rem;
  margin: 3rem 0 1.5rem;
  color: #000;
  text-align: center;
}

.subsection-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  margin: 10px auto 0;
  background: linear-gradient(90deg, #2d7195, #6c8ea0, #2d7195);
  border-radius: 2px;
}

/* 🧱 Grid flexible de proyectos (centrado perfecto) */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); /* más ancho */
  gap: 2rem;
  justify-content: center;  /* 🔹 centra las columnas dentro del grid */
  justify-items: center;    /* 🔹 centra cada elemento */
  align-items: center;
  margin: 3rem auto 5rem;
  width: 100%;
  max-width: 700px;         /* 🔹 evita que se extienda demasiado */

}

/* ⚪ Elemento clicable (envoltorio del círculo + nombre) */
.project-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.project-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background-color: #f5f7fa;
  border: 2px solid #2d7195;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* 🔹 Para que la imagen no se salga del círculo */
  transition: all 0.3s ease;
}

/* Imagen dentro del círculo */
.project-img {
  width: 90%;
  height: 90%;
  object-fit: cover; /* 🔹 Asegura que la imagen llene bien el círculo */
  transition: transform 0.3s ease;
}

/* Efecto hover: zoom suave en la imagen */
.project-circle:hover .project-img {
  transform: scale(1.1);
}

.project-circle:hover {
  background-color: #2d7195;
  color: #fff;
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(45, 113, 149, 0.3);
}

/* 🏷️ Nombre debajo del círculo */
.project-name {
  margin-top: 1.25rem;
  font-size: 1rem;
  color: #000000;
  font-weight: 700;
  text-align: center;
}

/* 🧭 Espaciado extra antes de la primera subsección */
.section-content .subsection-title:first-of-type {
  margin-top: 4rem;
}

/* Contenedor general: divide en 2 columnas */
.techpool-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    /* Esto hace que ambos stacks tengan misma altura */
    gap: 2rem;
    flex-wrap: wrap;
}

/* Cada stack ocupa el 50% */
.tech-stack {
    flex: 1 1 45%;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Añade espacio arriba y abajo */
}

.tech-stack h3 {
    margin-top: 0.5rem;
    /* O ajusta a tu gusto */
    margin-bottom: 1rem;
}

.tech-logos:hover {
    border-color: #ff9800;
    /* Color final cuando haces hover */
}

/* Contenedor de logos en filas de 2 */
.tech-logos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.69rem;
    justify-items: center;
    align-content: space-between;
    /* distribuye filas verticalmente */
    grid-auto-rows: 1fr;
    /* filas crecen para ocupar espacio */
    padding: 1rem;
    border: 4px solid #6c8ea0;
    border-radius: 15px;
    transition: border-color 0.4s ease;
    height: 100%;
    /* crecerá igual que el otro stack */
    flex-grow: 1;
    padding-top: 10%;
    padding-bottom: 10%;
}


/* Centrar la última fila si tiene un solo elemento */
.tech-logos> :nth-last-child(1):nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
}

.tech-logo {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: grayscale(0%);
    transition: transform 0.3s ease;
    padding: 5%;
    flex-direction: column;
    /* Asegura que el texto quede debajo de la imagen */
}

.tech-logo img {
    width: 100px;
    height: 100px;
    /* ajusta esto según lo que prefieras */
    aspect-ratio: 1;
    /* asegura que sea siempre cuadrado */
    object-fit: contain;
    transition: transform 0.3s ease;
}


.tech-logo:hover {
    transform: scale(1.1);
}

.tech-name {
    opacity: 0;
    transition: opacity 0.3s ease;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #000000;
    font-size: 1.3rem;
        white-space: nowrap;
}

/* Mostrar nombre al hacer hover */
.tech-logo:hover .tech-name {
    opacity: 1;
}

.techpool-container h3 {
    font-size: 2rem;
    font-weight: bold;
    color: #000;
}

/*!CV!*/
/* ===== CV MODAL ===== */
.cvModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    /* reemplazado el anterior */
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    height: 90%;
    margin: 2% auto;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Botón cerrar */
.close-btn {
    position: absolute;
    top: 3px;
    left: 82%;
    background-color: transparent;
    z-index: 2100;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    color: #ff0000;
}

/* Botón ver CV */
.view-cv-btn {
    display: block;
    /* Para que ocupe toda la fila y pueda centrarse */
    margin: 1rem auto;
    /* Márgenes superior e inferior de 1rem, automáticos a los lados para centrarlo */
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #2c3e50, #6c8ea0);
    color: white;
    font-size: 1rem;
    cursor: pointer;
}


/* Botón descargar */
.download-cv-btn {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: linear-gradient(135deg, #2c3e50, #6c8ea0);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
}


/* !PROYECTOS! */
.work-icon-container {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.work-icon {
    animation: spin 2s linear infinite;
    color: #ff9800;
    /* color naranja, cámbialo si quieres */
}

/* Animación de rotación */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* !Footer! */
.footer {
    background: linear-gradient(250deg, #2c3e50, #6c8ea0);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-title {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    position: relative;
    display: inline-block;
}

.footer-title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: #6c8ea0;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.social-icon {
    color: white;
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
}

.social-icon:hover {
    background: linear-gradient(135deg, #6e48aa, #9d50bb);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.social-icon:hover .tooltip {
    opacity: 1;
}

@media (max-width: 678px) {
  /* --------- Base / Body --------- */
  html, body {
    font-size: 14px;    /* reducir tamaño de fuente general */
    overflow-x: hidden;

  }

  /* --------- Header --------- */
  .header {
    height: 120px;       /* menos alto para móvil */
    padding: 0.5rem 0;
  }

  .header-title {
    font-size: 1.4rem;  /* título más pequeño */
    margin-bottom: 0.5rem;
    text-align: center;
  }

  /* --------- Language Selector (flags) --------- */
  .language-selector {
    top: 0.3rem;
    right: 0.2rem;
    gap: 0.3rem;
  }

  .language-flag {
    width: 18px;
    height: 12px;
  }
  .navbar {
    display: flex;
    flex-wrap: wrap;       /* permite solo dos filas */
    width: 100%;
    gap: 0.3rem;
    padding: 0 1rem;
    box-sizing: border-box;
    justify-content: center; /* centra todo */
  }

  /* Botones de sección */
  .nav-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    width: 100%;
    justify-content: center; /* centra las filas */
  }

  /* Todos los botones de sección iguales */
  .nav-button {
    flex: 0 0 calc((100% - 0.6rem) / 3); /* mismo ancho que fila 1 */
    min-width: 0;
    text-align: center;
    font-size: 0.85rem;
    padding: 0.4rem 0;
    box-sizing: border-box;
  }

  /* Ocultar botones home y link en móvil */
  .nav-home-icon,
  .nav-link-icon {
    display: none;
  }

  /* Ajuste para botones activos */
  .nav-button.active {
    font-size: 0.8rem;
    padding: 0.4rem 0;
  }

  /*CARROUSEL*/

    .carousel {
        position: relative;
        width: 80%;
    }

    .carousel-container {
        padding-top: 0px;
    }

   .section {
      width: calc(100% - 0.7rem);   /* ancho menor que 100% para dar espacio lateral */
      max-width: calc(100% - 0.7rem);
      margin: 0.5rem auto 1.5rem; /* centrado horizontal con auto y margen superior/inferior reducido */
      padding: 30px 1rem 20px;    /* padding interno reducido */
      border-radius: 15px;
      box-sizing: border-box;     /* importante para que padding no aumente el ancho */
  }

  .section .section-inner {
      padding: 0 0.5rem;          /* margen interno lateral reducido */
      box-sizing: border-box;
  }

  .section h2 {
      font-size: 1.6rem;
      padding-bottom: 10px;
  }

  .section h2::after {
      width: 60px;
      height: 3px;
  }

  .section-content {
      padding: 0 0.5rem;
      max-width: 100%;
      text-align: left;
  }

  .section p {
      font-size: 1rem;
      line-height: 1.5;
      text-align: center;
  }

  /*BADGES*/

   #content-container {
      padding: 0 0.5rem;
      padding-top: 20px;
      margin: 0 auto;
      gap: 1.5rem;
      width: 100%;
      box-sizing: border-box;
  }

  /* Sección de badges */
  .badges-section {
      padding: 1rem;
      margin: 1rem auto;
      width: calc(100% - 1rem);
      max-width: calc(100% - 1rem);
      overflow-x: hidden; /* evita scroll horizontal */
      box-sizing: border-box;
  }

  /* Grid de badges */
  .badges-grid {
      display: grid;
      grid-template-columns: 1fr; /* un badge por fila */
      gap: 1rem;
      justify-items: center;
      width: 100%;
  }

  /* Cada badge */
  .badge {
      width: 100%;        /* ocupa casi todo el ancho del contenedor */
      max-width: 300px;  /* limita tamaño máximo */
      height: auto;      /* ajusta la altura automáticamente */
      padding: 30px 20px;
      box-sizing: border-box;
    }

  /* Imagen del badge */
  .badge-img {
      width: 100px;
      height: auto;
      padding-top: 10px;
      margin-bottom: 0.5rem;
  }

  /* Ajustes de hover para móvil (opcional) */
  .badge:hover .badge-img {
      transform: scale(1.2); /* menos agresivo en móvil */
  }

  .badge-name {
      padding-top: 20px;
      font-size: 1.05rem;
  }

  .projects-grid {
    gap: 1rem;          /* reduce separación entre columnas y filas */
    max-width: 95%;     /* ocupa más ancho de pantalla sin desbordar */ 
    margin: 1rem auto 1rem; /* margen superior e inferior más compacto */

  }

  .project-circle {
    width: 100px;        /* círculo más pequeño */
    height: 100px;
  }

  .project-img {
    width: 85%;
    height: 85%;
  }

  .project-name {
    font-size: 0.9rem;   /* nombre un poco más pequeño */
    margin-top: 0.8rem;  /* reduce separación del círculo */
  }



  .section-content .subsection-title:first-of-type {
    margin-top: 1rem;
  }
}