/* General Styles */
:root {
  scroll-behavior: smooth;
  --primary-color: #2c4a7c;
  --secondary-color: #47b2e4;
  --accent-color: #ff5a5f;
  --highlight-color: #A8DADC;
  --text-color: #4a5568;
  --light-bg: #f8f9fa;
  --dark-bg: #4a4a4a;
  --white: #ffffff;
  --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Highlight para textos importantes */
.highlight {
  display: inline-block;
  color: var(--secondary-color);
  font-size: 14px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  margin: 0 2px 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  vertical-align: middle;
  transition: all 0.3s ease;
}

.highlight:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Variante más pequeña para modales */
.project-modal .highlight {
  font-size: 12px;
  padding: 3px 8px;
  margin-bottom: 12px;
}

/* Variante para fondos oscuros */
.highlight.light {
  background-color: white;
  color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
  .highlight {
    font-size: 12px;
    padding: 3px 8px;
  }
  
  .project-modal .highlight {
    font-size: 11px;
    padding: 2px 6px;
  }
}

body {
  font-family: "Open Sans", sans-serif;
  color: #444444;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

a {
  color: #4154f1;
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: #717ff5;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Nunito", sans-serif;
}

section {
  padding: 60px 0;
  overflow: hidden;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  visibility: hidden;
  opacity: 0;
  right: 15px;
  bottom: 15px;
  z-index: 99999;
  background: #4154f1;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  transition: all 0.4s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top i {
  font-size: 24px;
  color: #fff;
}

.back-to-top:hover {
  background: #6776f4;
}

.back-to-top.active {
  visibility: visible;
  opacity: 1;
}

/* Header */
.header {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  padding: 0;
  background-color: white;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header .logo img {
  max-height: 80px;
  margin: 10px 0;
}

/* Navigation */
.navbar {
  padding: 0;
}

.navbar ul {
  margin: 0;
  padding: 0;
  display: flex;
  list-style: none;
  align-items: center;
}

.navbar li {
  position: relative;
}

.navbar a,
.navbar a:focus {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 10px 30px;
  font-family: "Nunito", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #013289;
  white-space: nowrap;
  transition: 0.3s;
}

.navbar a:hover,
.navbar .active,
.navbar li:hover > a {
  color: #4154f1;
}

.home-icon i.bi {
  font-size: 28px;
}

.mobile-nav-toggle {
  color: #012970;
  font-size: 28px;
  cursor: pointer;
  display: none;
  line-height: 0;
  transition: 0.5s;
}

@media (max-width: 991px) {
  .mobile-nav-toggle {
    display: block;
  }
  
  .navbar ul {
    display: none;
  }
  
  .header .logo img {
    max-height: 60px;
  }
}

.navbar-mobile {
  position: fixed;
  overflow: hidden;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  background: rgba(1, 22, 61, 0.9);
  transition: 0.3s;
  z-index: 999;
}

.navbar-mobile .mobile-nav-toggle {
  position: absolute;
  top: 15px;
  right: 15px;
  color: #fff;
}

.navbar-mobile ul {
  display: block;
  position: absolute;
  top: 55px;
  right: 15px;
  bottom: 15px;
  left: 15px;
  padding: 10px 0;
  border-radius: 10px;
  background-color: #fff;
  overflow-y: auto;
  transition: 0.3s;
}

.navbar-mobile a,
.navbar-mobile a:focus {
  padding: 10px 20px;
  font-size: 15px;
  color: #012970;
}

.navbar-mobile a:hover,
.navbar-mobile .active,
.navbar-mobile li:hover > a {
  color: #4154f1;
}

/* Projects Section */
.projects-section {
  padding: 80px 0;
  background-color: var(--light-bg);
  margin-top: 80px;
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

.section-header h2 {
  font-size: 40px;
  font-weight: 900;
  color: var(--secondary-color);
  margin-bottom: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.underline {
  width: 180px;
  height: 4px;
  background-color: var(--secondary-color);
  margin: 0 auto;
}

.project-card {
  display: flex;
  background-color: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 40px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 90%;
  height: 340px;
  margin-left: auto;
  margin-right: auto;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.project-image {
  flex: 0 0 40%;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.05);
}

.project-content {
  flex: 0 0 60%;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-title {
  margin-bottom: 15px;
  line-height: 1.2;
}

.project-title .dark {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-color);
}

.project-title .light {
  display: block;
  font-size: 32px;
  font-weight: 400;
  color: var(--secondary-color);
}

.project-description {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-color);
  margin-bottom: 20px;
  text-align: justify;
  margin-right: 10%;
}

.btn-ver-mas {
  display: inline-block;
  background-color: var(--accent-color);
  color: var(--white);
  text-decoration: none;
  padding: 10px 25px;
  border-radius: 50px;
  font-weight: 600;
  align-self: flex-start;
  transition: all 0.3s ease;
  margin-bottom: 25px;
}

.btn-ver-mas:hover {
  background-color: #e04347;
  transform: translateY(-3px);
  color: var(--white);
}

/* Project Modal Styles */
.project-modal {
  display: none;
  position: fixed;
  z-index: 1050;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.3s ease-in-out;
}

.project-modal-content {
  background-color: var(--white);
  margin: 5% auto;
  padding: 0;
  width: 70%;
  max-width: 900px;
  border-radius: 15px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: slideIn 0.4s ease-out;
  overflow: hidden;
}

.project-modal-header {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 25px 30px;
  position: relative;
}

.project-modal-header h2 {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 42px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}

.project-modal-body {
  padding: 30px;
  color: var(--text-color);
  text-align: justify;
}

.project-modal-body h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.project-modal-body p {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 30px;
}

.close-modal {
  position: absolute;
  right: 25px;
  top: 20px;
  color: var(--white);
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  z-index: 10;
}

.close-modal:hover {
  color: #f8f9fa;
  transform: scale(1.1);
}

/* Estilos para el contenedor de medios */
.modal-media-container {
  margin-top: 20px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  background-color: #f8f9fa;
}

/* Galería de imágenes y video */
.modal-gallery {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 300px;
  max-height: 500px;
  overflow: hidden;
  background-color: #000;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
  display: none; /* Cambiado de flex a none cuando no está activo */
  align-items: center;
  justify-content: center;
}

.modal-slide.active {
  opacity: 1;
  z-index: 2;
  position: relative;
  height: auto;
  display: flex; /* Mostrar cuando está activo */
}

.modal-slide img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  display: block;
}

/* Estilos para diapositivas de video */
.video-slide {
  background-color: #000;
}

.video-slide.active {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
}

.video-slide video {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  display: block;
}

/* Controles de navegación para carrusel */
.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.7);
  color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all 0.3s ease;
  font-size: 20px;
}

.carousel-prev:hover,
.carousel-next:hover {
  background-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
  left: 15px;
}

.carousel-next {
  right: 15px;
}

/* Indicadores de diapositivas */
.slide-indicators {
  display: flex;
  justify-content: center;
  padding: 15px 0;
  background-color: #f8f9fa;
  border-radius: 0 0 12px 12px;
}

.indicator {
  width: 12px;
  height: 12px;
  background-color: #ccc;
  border-radius: 50%;
  margin: 0 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator.active {
  background-color: var(--accent-color);
  transform: scale(1.2);
}

/* Ocultar controles de navegación cuando solo hay una diapositiva */
.modal-gallery:only-child .carousel-prev,
.modal-gallery:only-child .carousel-next {
  display: none;
}

.slide-indicators:only-child {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 1921px) {
  .project-modal-content {
    max-width: 1000px;
  }
  
  .project-modal-header h2 {
    font-size: 48px;
  }
  
  .project-modal-body h3 {
    font-size: 28px;
  }
  
  .project-modal-body p {
    font-size: 20px;
  }
  
  .modal-gallery {
    min-height: 400px;
    max-height: 600px;
  }
  
  .modal-slide img,
  .video-slide video {
    max-height: 600px;
  }
}

@media (max-width: 1200px) {
  .project-modal-content {
    width: 80%;
  }
  
  .project-modal-header h2 {
    font-size: 36px;
  }
  
  .project-modal-body h3 {
    font-size: 22px;
  }
  
  .project-modal-body p {
    font-size: 16px;
  }
  
  .modal-gallery {
    min-height: 250px;
    max-height: 400px;
  }
  
  .modal-slide img,
  .video-slide video {
    max-height: 400px;
  }
}

@media (max-width: 768px) {
  .project-modal-content {
    width: 95%;
    margin: 10% auto;
  }
  
  .project-modal-header {
    padding: 20px;
  }
  
  .project-modal-header h2 {
    font-size: 28px;
  }
  
  .project-modal-body {
    padding: 20px;
  }
  
  .project-modal-body h3 {
    font-size: 18px;
  }
  
  .project-modal-body p {
    font-size: 15px;
    text-align: justify;
  }
  
  .close-modal {
    font-size: 24px;
    right: 15px;
    top: 15px;
  }
  
  .modal-gallery {
    min-height: 200px;
    max-height: 300px;
  }
  
  .modal-slide img,
  .video-slide video {
    max-height: 300px;
  }
  
  .carousel-prev,
  .carousel-next {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
  
  .indicator {
    width: 10px;
    height: 10px;
    margin: 0 5px;
  }
}

@media (max-width: 576px) {
  .project-modal-header h2 {
    font-size: 22px;
  }
  
  .project-modal-body h3 {
    font-size: 16px;
  }
  
  .project-modal-body p {
    font-size: 14px;
  }
  
  .modal-gallery {
    min-height: 150px;
    max-height: 250px;
  }
  
  .modal-slide img,
  .video-slide video {
    max-height: 250px;
  }
  
  .video-slide.active {
    aspect-ratio: 4/3; /* Mejor relación de aspecto para móviles */
  }
  
  .carousel-prev,
  .carousel-next {
    width: 25px;
    height: 25px;
    font-size: 14px;
  }
  
  .indicator {
    width: 8px;
    height: 8px;
    margin: 0 4px;
  }
  
  .slide-indicators {
    padding: 10px 0;
  }
}

@media (max-width: 375px) {
  .project-modal-header h2 {
    font-size: 20px;
  }
  
  .project-modal-body h3 {
    font-size: 14px;
  }
  
  .project-modal-body p {
    font-size: 13px;
  }
  
  .modal-gallery {
    min-height: 120px;
    max-height: 200px;
  }
  
  .modal-slide img,
  .video-slide video {
    max-height: 200px;
  }
}

/* Footer */
.footer {
  font-size: 14px;
  background-color: #e6f0fa;
  padding: 0;
}

.footer-top {
  padding: 40px 0 20px 0;
}

.footer .logo {
  display: block;
  text-align: left;
  margin-bottom: 20px;
}

.footer-logo-img {
  max-height: 80px;
  width: auto;
}

.footer h4 {
  font-size: 16px;
  font-weight: 600;
  color: #0a2463;
  position: relative;
  margin-bottom: 15px;
}

.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links ul li {
  padding: 5px 0;
}

.footer-links ul li a {
  color: #5e7ca1;
  transition: 0.3s;
  display: inline-block;
  line-height: 1;
}

.footer-links ul li a:hover {
  color: #0a2463;
  text-decoration: underline;
}

.footer-contact p {
  line-height: 24px;
  color: #5e7ca1;
}

.footer-contact strong {
  color: #0a2463;
}

.footer-bottom {
  padding: 20px 0;
  background-color: #4a4a4a;
  color: #fff;
  text-align: center;
}

.footer-bottom .copyright {
  margin-bottom: 5px;
}

.footer-bottom .credits {
  font-size: 13px;
}

.footer-bottom .credits a {
  color: #fff;
  opacity: 0.8;
}

.footer-bottom .credits a:hover {
  opacity: 1;
}

/* Responsive Styles */
@media (min-width: 1921px) {
  .container {
    max-width: 1600px;
  }
  
  .project-title .dark,
  .project-title .light {
    font-size: 38px;
  }
  
  .project-description {
    font-size: 18px;
  }
  
  .project-modal-content {
    max-width: 1000px;
  }
  
  .project-modal-header h2 {
    font-size: 38px;
  }
  
  .project-modal-body h3 {
    font-size: 24px;
  }
  
  .project-modal-body p {
    font-size: 18px;
  }
}

@media (max-width: 1200px) {
  .project-title .dark,
  .project-title .light {
    font-size: 28px;
  }
  
  .project-content {
    padding: 25px;
  }
  
  .project-modal-content {
    width: 80%;
  }
}

@media (max-width: 991px) {
  .project-card {
    flex-direction: column;
    height: auto; /* Eliminar altura fija */
    width: 95%; /* Aumentar ligeramente el ancho */
    margin-bottom: 30px;
  }
  
  .project-image {
    flex: 0 0 auto; /* Cambiar de 100% a auto */
    height: 250px; /* Altura fija para la imagen */
    width: 100%;
  }
  
  .project-content {
    flex: 1 0 auto; /* Permitir que el contenido crezca */
    width: 100%;
    padding: 25px;
  }
  
  .project-image img {
    border-radius: 20px 20px 0 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  /* Ajustar los highlights para que no se desborden */
  .highlight {
    font-size: 12px;
    padding: 3px 8px;
    margin: 0 2px 6px 0;
  }
}

@media (max-width: 768px) {
  .projects-section {
    padding: 60px 0;
    margin-top: 70px;
  }
  
  .section-header h2 {
    font-size: 28px;
  }
  
  .underline {
    width: 140px;
    height: 3px;
  }
  
  .project-card {
    width: 92%;
  }
  
  .project-image {
    height: 220px;
  }
  
  .project-title .dark,
  .project-title .light {
    font-size: 24px;
  }
  
  .project-description {
    font-size: 14px;
    margin-bottom: 15px;
    text-align: justify;
  }
  
  .btn-ver-mas {
    padding: 8px 20px;
    font-size: 14px;
    margin-bottom: 15px;
  }
  
  .project-modal-content {
    width: 95%;
    margin: 10% auto;
  }
  
  .project-modal-header {
    padding: 20px;
  }
  
  .project-modal-header h2 {
    font-size: 24px;
  }
  
  .project-modal-body {
    padding: 20px;
  }
  
  .project-modal-body h3 {
    font-size: 16px;
  }
  
  .project-modal-body p {
    font-size: 14px;
  }
  
  .close-modal {
    font-size: 24px;
    right: 15px;
    top: 15px;
  }
  
  .footer-top {
    text-align: center;
  }
  
  .footer .logo {
    text-align: center;
  }
  
  .footer-logo-img {
    margin: 0 auto;
  }
  
  .footer-links, .footer-contact {
    margin-top: 20px;
  }
  
  /* Mejorar la visualización de los highlights en móviles */
  .highlight {
    font-size: 11px;
    padding: 3px 7px;
    margin: 0 2px 5px 0;
    display: inline-block;
  }
}

@media (max-width: 576px) {
  .project-card {
    width: 100%;
    margin-bottom: 25px;
    border-radius: 15px;
  }
  
  .project-image {
    height: 180px;
    border-radius: 15px 15px 0 0;
  }
  
  .project-image img {
    border-radius: 15px 15px 0 0;
  }
  
  .project-content {
    padding: 18px 15px;
  }
  
  .project-title .dark,
  .project-title .light {
    font-size: 20px;
  }
  
  .project-description {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 12px;
  }
  
  .btn-ver-mas {
    padding: 7px 18px;
    font-size: 13px;
    margin-bottom: 10px;
  }
  
  .section-header {
    text-align: center;
    margin-bottom: 30px;
  }
  
  .section-header h2 {
    font-size: 24px;
  }
  
  .underline {
    width: 120px;
    height: 3px;
    margin: 0 auto;
  }
  
  /* Ajustar tamaño de los highlights para dispositivos muy pequeños */
  .highlight {
    font-size: 10px;
    padding: 2px 6px;
    margin: 0 2px 4px 0;
    letter-spacing: 0.3px;
  }
  
  /* Ajustes para el modal en pantallas muy pequeñas */
  .project-modal-header h2 {
    font-size: 20px;
  }
  
  .project-modal-body h3 {
    font-size: 14px;
  }
  
  .project-modal-body p {
    font-size: 13px;
  }
  
  .modal-gallery {
    height: 160px;
  }
  
  .carousel-prev,
  .carousel-next {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  
  .indicator {
    width: 8px;
    height: 8px;
    margin: 0 4px;
  }
}

/* Ajustes para dispositivos extremadamente pequeños */
@media (max-width: 360px) {
  .project-image {
    height: 160px;
  }
  
  .project-title .dark,
  .project-title .light {
    font-size: 18px;
  }
  
  .project-description {
    font-size: 12px;
  }
  
  .btn-ver-mas {
    padding: 6px 16px;
    font-size: 12px;
  }
  
  .highlight {
    font-size: 9px;
    padding: 2px 5px;
    margin: 0 1px 3px 0;
  }
  
  .modal-gallery {
    height: 140px;
  }
}
