/********************************************************
 *                      RESET & BASE                    *
 ********************************************************/
 * {
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
  scroll-behavior: smooth;
}
html, body {
  font-family: 'Montserrat', sans-serif;
  background-color: #e8f2fc; 
  color: #333;
  line-height: 1.5;
  overflow-x: hidden; /* Ocultamos scroll horizontal */
  min-height: 100vh;
}
a {
  text-decoration: none;
  color: inherit;
}
h1, h2, h3, h4, h5 {
  margin-bottom: 10px;
  font-weight: 600;
}
section {
  padding: 60px 20px;
}
.container {
  max-width: 1080px;
  margin: 0 auto;
}

/********************************************************
 *                 ANIMACIONES CSS                      *
 ********************************************************/
@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  0% { transform: scale(0.7); opacity: 0; }
  80% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes floatBubble {
  0% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-30px) translateX(10px); }
  100% { transform: translateY(0) translateX(0); }
}
@keyframes fadeInTooltip {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
/* Burbujas del header (en portafolio normal) */
@keyframes bubbleExplode {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

/********************************************************
 *          BOTÓN SCROLL TO TOP (FLOTANTE)              *
 ********************************************************/
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #0a74da;
  color: #fff;
  width: 50px; 
  height: 50px;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
}
.scroll-top.show {
  opacity: 1;
  visibility: visible;
}

/********************************************************
 *                     HEADER (WAVES)                   *
 ********************************************************/
header {
  position: relative;
  background: linear-gradient(135deg, #0a74da, #0c569c);
  color: #fff;
  text-align: center;
  padding: 80px 20px;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 80%, 60% 95%, 0% 100%);
}
header .header-content {
  position: relative;
  z-index: 2; 
  max-width: 800px;
  margin: 0 auto;
}
header h1 {
  font-size: 2.8rem;
  margin-bottom: 20px;
}
header p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}
/* Burbujas decorativas en el header */
.bubble {
  position: absolute;
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  animation: floatBubble 6s infinite ease-in-out;
  z-index: 1;
  cursor: pointer; 
}
.bubble:nth-child(1) {
  top: 30%;
  left: 15%;
  animation-delay: 0.2s;
}
.bubble:nth-child(2) {
  top: 10%;
  left: 70%;
  animation-delay: 0.6s;
  width: 80px; 
  height: 80px;
}
.bubble:nth-child(3) {
  top: 50%;
  left: 85%;
  width: 40px; 
  height: 40px;
  animation-delay: 1s;
}
.explode {
  animation: bubbleExplode 0.3s forwards;
}
/* Particles.js contenedor */
#particles-js {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 1; 
  pointer-events: none;
}

/********************************************************
 *       TÍTULOS DE SECCIONES => CENTRADOS (h2)         *
 ********************************************************/
.section-title {
  text-align: center;
  font-size: 2rem;
  color: #0a74da;
  margin-bottom: 40px;
  position: relative;
  font-weight: 600;
}
.section-title::after {
  content: "";
  width: 60px;
  height: 3px;
  background: #0a74da;
  display: block;
  margin: 10px auto 0;
  border-radius: 2px;
}

/********************************************************
 *                     SECCIÓN PERFIL                   *
 ********************************************************/
.profile {
  margin-top: -60px; 
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  padding: 40px 30px;
  position: relative;
  animation: fadeIn 1.5s ease forwards;
}
.profile h2 {
  color: #0a74da;
  margin-bottom: 20px;
  text-align: center;
}
.profile p {
  color: #555;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0;
}

/********************************************************
 *              EXPERIENCIA (TIMELINE)                  *
 ********************************************************/
.timeline {
  position: relative;
  margin: 0 auto;
  max-width: 800px;
}
.timeline-item {
  display: flex;
  align-items: flex-start;
  position: relative;
  margin-bottom: 40px;
}
.timeline-item:last-child {
  margin-bottom: 0;
}
.timeline-year {
  position: absolute;
  left: 0;
  top: 12px;
  transform: translateX(-105%);
  background: #0a74da;
  color: #fff;
  padding: 4px 8px;
  font-size: 0.9rem;
  border-radius: 10px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.circle {
  position: absolute;
  left: 50px;
  top: 16px;
  width: 14px;
  height: 14px;
  background: #0c569c;
  border-radius: 50%;
  z-index: 1;
}
.timeline-line {
  position: absolute;
  left: 57px;
  top: 24px;
  height: calc(100% - 24px);
  width: 2px;
  background: #ccc;
  z-index: 0;
}
.timeline-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  margin-left: 80px;
  flex-grow: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  animation: popIn 0.7s ease forwards;
}
.timeline-content h3 {
  margin-bottom: 5px;
  font-size: 1.2rem;
  color: #0a74da;
  text-align: center;
}
.timeline-content h4 {
  margin-bottom: 10px;
  font-size: 1rem;
  color: #666;
  text-align: center;
}
.timeline-content p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #555;
}

/********************************************************
 *                    EDUCACIÓN                         *
 ********************************************************/
.education {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
.education-item {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  animation: fadeIn 1s ease forwards;
}
.education-item h3 {
  color: #0c569c;
  margin-bottom: 8px;
  font-size: 1.1rem;
  text-align: center;
}
.education-item p {
  color: #555;
  line-height: 1.4;
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.education-link {
  color: #0c569c;
  text-decoration: none;
  transition: color 0.3s, text-decoration 0.3s;
  cursor: pointer;
}
.education-link:hover {
  color: #0a74da;
  text-decoration: underline;
}

/********************************************************
 *      CERTIFICACIONES / CURSOS (GRID)                 *
 ********************************************************/
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 30px;
}
.cert-item {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-align: center;
  animation: popIn 0.8s ease forwards;
}
.cert-item h3 {
  color: #0a74da;
  margin-bottom: 8px;
  font-size: 1.1rem;
}
.cert-item p {
  color: #555;
  font-size: 0.95rem;
}
.cert-item i {
  font-size: 2rem;
  color: #0c569c;
  margin-bottom: 10px;
}

/********************************************************
 *                    SKILLS                            *
 ********************************************************/
#skills .skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
  justify-items: center;
}
.skill-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 20px;
  width: 200px;
  text-align: center;
  animation: fadeIn 1s ease forwards;
}
.skill-card img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 10px;
}
.skill-card h3 {
  color: #0a74da;
  margin-bottom: 8px;
  font-size: 1rem;
}
.skill-card p {
  color: #555;
  margin: 0;
  font-size: 0.95rem;
}

/********************************************************
 *                    PROYECTOS                         *
 ********************************************************/
.projects-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}
.project-card {
  position: relative;
  width: 300px;
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  background-color: #fff;
  animation: popIn 0.8s ease forwards;
}
.project-card img {
  width: 100%; 
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.project-card:hover img {
  transform: scale(1.1);
}
.overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s;
  text-align: center;
  padding: 0 10px;
}
.project-card:hover .overlay {
  opacity: 1;
}
.overlay h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: #fffc;
}
.overlay p {
  font-size: 1rem;
  color: #ddd;
  margin-bottom: 10px;
}
.overlay a {
  background: #ffcc00;
  color: #000;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.3s;
}
.overlay a:hover {
  background: #ffc400;
}

/********************************************************
 *        CONTACTO & IDIOMAS (GRID 3x2)                 *
 ********************************************************/
#contact-languages .contact-languages-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 20px;
  align-items: stretch;
}
.box-item {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.3s;
  animation: fadeIn 1s ease forwards;
  min-height: 80px;
  position: relative;
}
.box-item:hover {
  transform: translateY(-5px);
}
.box-item i {
  font-size: 1.5rem;
  color: #0c569c;
}
.box-item h3, .box-item p, .box-item span {
  margin: 0;
  color: #555;
  font-size: 1rem;
  text-align: center;
}
.location-bar {
  grid-column: 1 / span 2;
}
/* Tooltip en el correo */
.email-link {
  position: relative;
  cursor: pointer;
}
.email-link:hover::after {
  content: "Envíame un correo";
  position: absolute;
  left: 50%;
  bottom: 120%;
  transform: translateX(-50%);
  background: #0a74da;
  color: #fff;
  padding: 5px 8px;
  font-size: 0.8rem;
  border-radius: 5px;
  white-space: nowrap;
  animation: fadeInTooltip 0.4s forwards;
}

/********************************************************
 *                      FOOTER                          *
 ********************************************************/
footer {
  text-align: center;
  padding: 20px 0;
  font-size: 0.9rem;
  color: #666;
  margin-top: 40px;
}

/********************************************************
 *      MODO JUEGO => OCULTAR PORTAFOLIO, BLOQUEAR SCROLL
 ********************************************************/
body.minigame-mode {
  overflow: hidden; /* Bloquea scroll en todo el body */
}
body.minigame-mode header,
body.minigame-mode main, /* si tuvieras main, lo ocultas */
body.minigame-mode footer,
body.minigame-mode section {
  display: none; /* oculta secciones normales */
}

/* Contenedor del juego fullscreen */
.game-container {
  display: none; 
  position: fixed; 
  top: 0; left: 0;
  width: 100vw; 
  height: 100vh;
  background: #fff;
  overflow: hidden; 
}
body.minigame-mode .game-container {
  display: block;
}

/* Barra superior en el minijuego */
.game-topbar {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 60px;
  background: #0a74da;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 10;
}
.hearts {
  display: flex;
  gap: 5px;
  font-size: 1.2rem;
}
.heart { 
  color: red; 
}
.score {
  font-size: 1.2rem;
  font-weight: bold;
}
.btn-exit-portfolio {
  background: #ffc400;
  color: #000;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

/* Área de juego (debajo del topbar) */
.game-play-area {
  position: absolute;
  top: 60px;
  left: 0;
  width: 100%;
  height: calc(100% - 60px);
  background: #fafafa;
  overflow: hidden;
}

/* Burbujas del minijuego */
.minigame-bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(10,116,218,0.2);
  cursor: pointer;
  animation: bubbleMove 4s linear forwards;
}
.minigame-bubble:hover {
  background: rgba(10,116,218,0.3);
}
@keyframes bubbleMove {
  0% { bottom: -60px; }
  100% { bottom: calc(100% - 60px); }
}

/* GAME OVER MENSAJE */
.game-over-msg {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 20px 30px;
  border-radius: 10px;
  text-align: center;
  display: none;
  z-index: 999;
}
.game-over-msg h2 {
  margin-bottom: 10px;
  font-size: 1.5rem;
}
.game-over-msg button {
  background: #ffc400;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
  font-weight: bold;
  color: #000;
}

/* ===========================================
   MEDIA QUERIES (RESPONSIVE ADAPTATIONS)
   =========================================== */

/* Medianos (tablets y pantallas pequeñas) */
@media (max-width: 992px) {
  header h1 {
    font-size: 2.2rem;
  }
  header p {
    font-size: 1rem;
    max-width: 90%;
  }
  .profile {
    margin-top: -40px;
    padding: 30px 20px;
  }
  .timeline-content {
    margin-left: 60px; /* Ajustamos para pantallas más pequeñas */
  }
}

/* Móviles (pantallas <= 768px) */
@media (max-width: 768px) {
  section {
    padding: 40px 10px;
  }
  header {
    clip-path: none; /* Opcional, puedes dejar la forma si deseas */
    padding: 60px 20px;
  }
  header h1 {
    font-size: 1.8rem;
  }
  .bubble:nth-child(2) {
    display: none; /* Puedes ocultar algunas burbujas si deseas menos saturación */
  }
  .bubble:nth-child(3) {
    display: none;
  }

  .education {
    grid-template-columns: 1fr;
  }
  .education-item {
    padding: 15px;
  }

  .projects-grid {
    flex-direction: column;
    align-items: center;
  }
  .project-card {
    width: 90%;
    max-width: 400px;
    height: 180px;
  }
  
  #contact-languages .contact-languages-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .location-bar {
    grid-column: auto; 
  }
  .box-item {
    flex-direction: column;
  }
  .box-item i {
    font-size: 1.2rem;
  }
  .box-item h3, .box-item p, .box-item span {
    font-size: 0.9rem;
  }
}

/* Extra-pequeños (pantallas <= 480px) */
@media (max-width: 480px) {
  header {
    padding: 50px 15px;
  }
  header h1 {
    font-size: 1.6rem;
    margin-bottom: 10px;
  }
  header p {
    font-size: 0.9rem;
  }
  .profile {
    margin-top: -30px; 
    padding: 20px;
  }
  .timeline-line {
    left: 45px; /* Ajustar línea para pantalla muy pequeña */
  }
  .circle {
    left: 38px;
  }
  .timeline-content {
    margin-left: 60px;
    padding: 15px;
  }
  .timeline-year {
    transform: translateX(-120%);
  }
  .project-card {
    width: 100%;
    max-width: 300px;
    height: 180px;
  }
  .box-item {
    min-height: auto;
    padding: 10px;
  }
  .education-item, .cert-item {
    padding: 15px;
  }
  .skill-card {
    width: 160px;
    padding: 15px;
  }
  .skill-card img {
    width: 50px;
    height: 50px;
  }
}



/* MODAL => Cubierta oscura y centrar contenido */
.email-modal {
  display: none; /* Oculto por defecto */
  position: fixed; 
  top: 0; 
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6); 
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.email-modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  position: relative;
  text-align: center;
}
/* Formulario dentro del modal (oculto inicialmente) */
.email-form {
  display: none; 
  margin-top: 20px;
  text-align: left;
}
.email-form label {
  display: block;
  margin-bottom: 5px;
}
.email-form input,
.email-form textarea {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  box-sizing: border-box;
}
/* Botones */
#openDefaultEmail,
#openForm {
  margin: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  background: #0a74da;
  color: #fff;
  font-weight: bold;
  transition: background 0.3s ease;
}
#openDefaultEmail:hover,
#openForm:hover {
  background: #094d95;
}
.email-form button[type="submit"] {
  background: #ffc400;
  border: none;
  padding: 8px 14px;
  margin-right: 10px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}
#cancelForm {
  background: #ccc;
  border: none;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}