/* Estilos generales del navbar */
/* Reset de márgenes y paddings globales */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  font-family: Futura, sans-serif;
}

section {
  width: 100%;
  max-width: 100vw;
}

.navbar {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background-color: #ffffff;
  z-index: 10;
}

.navbar-left a {
  color: #00171F;
  font-size: 24px;
  text-decoration: none;
  font-family: "futura", sans-serif;
  font-weight: bold;
  position: relative; /* Añadido para que el ::after funcione correctamente */
}

.navbar-right a {
  color: #00171F;
  margin: 0 15px;
  text-decoration: none;
  font-size: 20px;
  font-family: "futura", sans-serif;
  font-weight: bold;
  position: relative;
  padding: 10px 15px;
  display: inline-block;
  z-index: 0;
}

.navbar-right a:hover {
  color: #952b2b;
}

/* Estilos para el botón de menú en móviles */
.navbar-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.navbar-toggle .bar {
  width: 25px;
  height: 3px;
  margin: 4px 0;
  background-color: #00171F;
}

/* Estilos de la sección about */
.about {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 80px 20px; /* Reducido el padding horizontal en móviles */
  width: 100%;
}

#about {
  margin-top: 80px;
  width: 100%;
}

.about-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin-top: 75px;
  width: 100%;
  max-width: 100%;
}

.h2-about, .p-about {
  padding: 15px;
}

/* Contenedor de la foto */
.photo-container {
  position: relative;
  width: 90px;
  height: 110px;
  border-radius: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  border-style: solid;
  border-width: 2px;
  box-shadow: 5px 5px 1px 1px rgba(255, 99, 99, 0.42);
}

.profile-photo {
  position: absolute;
  object-fit: cover;
  border-radius: 12%;
  width: 100%;
  height: 100%;
}

/* Subrayado personalizado */
.navbar-right a::after {
  content: "";
  position: absolute;
  left: 30%; /* Ajustado para que quede centrado */
  bottom: 7px; /* Posición desde abajo */
  width: 70%;
  height: 13px;
  background-color: #FFB300;
  z-index: -1;
}

.navbar-left a::after {
  content: "";
  position: absolute;
  left: 13%;
  bottom: -1px; /* Posición desde abajo */
  width: 90%;
  height: 13px;
  background-color: #FFB300;
  z-index: -1;
}

#dynamic-word {
  display: inline-block;
  width: 120px;
  text-align: center;
  color: #FF6363;
  font-weight: bold;
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.p-about {
  color: #393939;
  width: 100%;
  max-width: 550px;
  min-height: 100px;
  border: 2px solid #003459;
  border-radius: 15px;
  margin-bottom: 20px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 5px 5px 1px 1px rgba(255, 99, 99, 0.42);
  padding: 15px; /* Asegurar que haya padding */
}

.description-p-about {
  margin-top: 20px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
  max-width: 100%;
}

/* Portfolio */
#portfolio {
  background-color: #003459;
  padding: 80px 20px;
  text-align: center;
  margin-top: 80px;
  width: 100%;
  max-width: 100vw;
}

.portfolio-section-title {
  color: #FFBD69;
  font-size: 2rem;
  margin-bottom: 40px;
  padding-top: 10px;
  padding-bottom: 90px;
  position: relative;
  display: inline-block;
  z-index: 1;
}

#portfolio .portfolio-section-title::after {
  content: "";
  position: absolute;
  bottom: 85px;
  left: 10px;
  width: 100%;
  height: 20px;
  background-color: rgb(255, 99, 99);
  z-index: -1;
}

.portfolio-container {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  justify-items: center;
}

.portfolio-item {
  background-color: #ffffff;
  padding: 20px;
  border-radius: 10px;
  width: 100%;
  max-width: 350px;
  box-shadow: 5px 5px 0px #FF6363;
  transition: transform 0.3s ease-in-out;
  border: 3px solid #00171F;
}

.portfolio-item:hover {
  transform: scale(1.05);
}

.portfolio-item img {
  width: 100%;
  border-radius: 8px;
  border: 2px solid #00171F;
}

.p-portfolio-item {
  margin-top: 10px;
  font-size: 1.1rem;
  color: #00171F;
}

.desc-portfolio-item {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #6c6c6c;
}


/* Estilos generales del modal */
.modal {
  position: fixed;
  left: 0;
  bottom: -100%;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: bottom 0.5s ease-in-out;
  z-index: 11; /* Mayor que el navbar */
}

/* Contenido del modal */
.modal-content {
  background-color: #202040;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  position: relative;
  color: white;
}

/* Botón de cerrar */
.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
}

/* Estilos para los inputs y textarea */
input, textarea {
  width: 100%;
  padding: 8px;
  margin: 10px 0;
  border: none;
  border-radius: 5px;
}

/* Botones */
button {
  background-color: #FF6363;
  color: white;
  padding: 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 10px;
}

button:hover {
  background-color: #FFBD69;
}

/* Cuando el modal está activo */
.modal.show {
  bottom: 0;
}

.footer {
  background-color: #202040;
  color: #FFBD69;
  text-align: center;
  padding: 30px 20px;
  font-size: 1rem;
  width: 100%;
  max-width: 100vw;
}

.footer a {
  color: #FF6363;
  text-decoration: none;
  font-weight: bold;
}

.footer a:hover {
  color: #FFBD69;
}

/* Media queries para dispositivos móviles */
@media screen and (max-width: 768px) {
  .navbar-right {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    right: 0;
    background-color: #FFB300;
    width: 100%;
    text-align: center;
    padding: 10px 0;
  }

  .navbar-right a {
    margin: 10px 0;
  }

  .navbar-toggle {
    display: flex;
  }

  .navbar.active .navbar-right {
    display: flex;
  }

  /* Portfolio en móviles */
  .portfolio-grid {
    grid-template-columns: 1fr; /* Una sola columna */
  }

  .portfolio-item {
    width: 100%;
    max-width: 90%;
  }

  /* Ajustes a la sección about */
  .p-about {
    font-size: 16px;
    line-height: 1.5;
    padding: 15px 10px;
    height: auto; /* Altura automática */
    width: 90%; /* Reducir ancho */
    max-width: 100%;
  }

  .h2-about {
    font-size: 1.5rem;
    width: 100%;
  }

  #dynamic-word {
    width: 100px; /* Reducido para evitar desbordamiento */
  }

  /* Ajustes al footer */
  .footer {
    padding: 20px;
  }

  /* Asegurarse de que el modal no se vea en horizontal */
  .modal {
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.5s;
  }

  .modal.show {
    visibility: visible;
    opacity: 1;
  }
}

/* Para pantallas más pequeñas - ajustes adicionales */
@media screen and (max-width: 480px) {
  .p-about {
    width: 95%;
  }

  .portfolio-section-title {
    font-size: 1.5rem;
    padding-bottom: 60px;
  }

  #portfolio .portfolio-section-title::after {
    bottom: 55px;
    height: 15px;
  }
}

/* Para modo horizontal en móviles */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .modal {
    display: none;
  }

  .modal.show {
    display: none;
  }

  /* Ajuste de altura para secciones en horizontal */
  #about {
    min-height: auto;
    padding-top: 100px;
    padding-bottom: 50px;
  }

  .p-about {
    max-width: 80%;
  }
}
