/* Las tarjetas necesitan will-change para que la GPU las maneje */
.project-card {
  will-change: transform, opacity;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center; /* Centrar la parte superior de la imagen */
}

/* Texto "Ver más" sobre la imagen - oculto en desktop */
.project-overlay-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 77, 77, 0.9);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 2;
  display: none; /* Oculto en desktop por defecto */
}

/* Visible solo en móvil y tablet */
@media (max-width: 1024px) {
  .project-overlay-text {
    display: block; /* Visible en tablets */
    opacity: 1; /* Siempre visible en tablets */
    transform: translate(-50%, -50%);
    background: rgba(255, 77, 77, 0.95);
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .project-overlay-text {
    display: block; /* Visible en móviles */
    opacity: 1; /* Siempre visible en móvil */
    transform: translate(-50%, -50%);
    background: rgba(255, 77, 77, 0.95);
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .project-overlay-text {
    display: block; /* Visible en móviles pequeños */
    opacity: 1; /* Siempre visible en móviles pequeños */
    transform: translate(-50%, -50%);
    background: rgba(255, 77, 77, 0.95);
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }
}

/* Sección de proyectos con imagen de fondo */
.projects-grid-section {
  position: relative;
  overflow: hidden;
}

/* Grid: 1 columna, filas bien espaciadas */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;       /* una sola columna */
  gap: 24px;
  max-width: 840px;   /*------------------------tamaño de la tarjeta------------------------*/
  margin: 0 auto;
  padding: 4rem 0;                  /* padding reducido para altura automática */
  position: relative; /* Para posicionar la imagen de fondo */
  z-index: 2; /* Asegurar que esté encima del fondo */
}

/* Imagen de fondo fijo en la sección de proyectos */
.projects-background-image {
  position: fixed; /* Fijo en la ventana, no se mueve con scroll */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100vh; /* Altura completa de la ventana */
  object-fit: cover;
  object-position: center;
  opacity: 1; /* Opacidad alta para máxima visibilidad */
  z-index: -1; /* Detrás de todo el contenido */
  pointer-events: none; /* No interferir con interacciones */
}

/* Ocultar imagen de fondo en la página de inicio (hero) */
body#index .projects-background-image {
  display: none;
}

/* Asegurar que el hero esté por encima del fondo */
.hero {
  position: relative;
  z-index: 10; /* Por encima de la imagen de fondo fija */
}

/* Responsive optimizado para proyectos */
@media (max-width: 1024px) {
  .projects-grid {
    padding: 3rem 1.5rem;
    gap: 20px;
  }

  /* Reducir opacidad de la imagen de fondo en tablets */
  .projects-background-image {
    opacity: 0.08;
  }
}

@media (max-width: 768px) {
  .projects-grid {
    padding: 2rem 1rem;
    gap: 16px;
  }

  .project-card {
    margin: 0;
  }

  .project-image {
    height: 200px;
  }

  .project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center; /* Centrar la parte superior en tablets */
  }

  /* Ocultar imagen de fondo en móviles para mejor rendimiento */
  .projects-background-image {
    display: none;
  }

  /* Simplificar project-info para móvil/tablet */
  .project-info {
    padding: 0.8rem 1rem; /* Padding reducido */
    text-align: center;
  }

  /* Ocultar elementos específicos en móvil/tablet */
  .project-info h3,
  .project-info .project-url,
  .project-info .tech-tags,
  .project-info p,
  .project-info br {
    display: none;
  }

  /* Mostrar solo project-actions centrados */
  .project-actions {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin: 0 auto;
    max-width: 300px;
  }

  .project-content {
    padding: 1.5rem;
  }

  .project-title {
    font-size: 1.5rem;
  }

  .project-description {
    font-size: 0.5rem; /* Reducido de 1rem a 0.85rem */
    line-height: 1.4; /* Mejorar legibilidad */
  }

  .project-tech {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .tech-tag {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }

  /* Filtros responsive */
  .filter-buttons {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  /* Header responsive */
  .page-header {
    padding: 6rem 0 3rem;
  }

  .page-header h1 {
    font-size: 2.5rem;
  }

  .page-header p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .projects-grid {
    padding: 1rem 0.5rem;
    gap: 12px;
  }

  .project-image {
    height: 150px;
  }

  .project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center; /* Centrar la parte superior en móviles pequeños */
  }

  /* Simplificar project-info para móviles pequeños */
  .project-info {
    padding: 0.6rem 0.8rem; /* Padding más reducido */
    text-align: center;
  }

  /* Ocultar elementos específicos en móviles pequeños */
  .project-info h3,
  .project-info .project-url,
  .project-info .tech-tags,
  .project-info p,
  .project-info br {
    display: none;
  }

  /* Mostrar solo project-actions centrados */
  .project-actions {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin: 0 auto;
    max-width: 280px;
  }

  .project-content {
    padding: 1rem;
  }

  .project-title {
    font-size: 1.3rem;
  }

  .project-description {
    font-size: 0.65rem; /* Reducido de 0.9rem a 0.75rem */
    line-height: 1.3; /* Mejorar legibilidad */
  }

  .project-tech {
    gap: 0.3rem;
  }

  .tech-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }

  .filter-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .page-header {
    padding: 5rem 0 2rem;
  }

  .page-header h1 {
    font-size: 2rem;
  }
}





/* ---------------header---------- */

/* Estilos para el page-header */
.page-header {
  background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
  padding: 8rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 90% 50%, rgba(255, 77, 77, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 90% 20%, rgba(255, 107, 107, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.page-header h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 0%, #ff4d4d 50%, #fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  
  /* 🔥 AQUÍ EL CAMBIO CLAVE */
  -webkit-text-stroke: 1px rgb(255, 255, 255);

  background-clip: text;
  position: relative;
  z-index: 2;
}

.page-header p {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* Estilos base */
body {
  background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.main-content {
  padding-top: 0px;
}

/* Estilos para el container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}



/* -------filtro fijo arriba------ */



/* Estilos para la projects-grid-section */
.projects-grid-section {
  padding: 2rem 0;
  min-height: auto;
  height: auto;
  position: relative;
}

/* Estilos para la sección de filtros fijos */
.filters-section {
  position: sticky;
  top: 2px;
  background: linear-gradient(180deg, rgba(26, 26, 26, 0.95) 0%, rgba(0, 0, 0, 0.9) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 77, 77, 0.2);
  z-index: 100;
  padding: 1rem 0;
}

.filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.filter-btn {
  padding: 0.8rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 77, 77, 0.2);
  border-radius: 25px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  margin-top: 10px;
}

.filter-btn:hover {
  background: rgba(255, 77, 77, 0.1);
  border-color: #ff4d4d;
  color: white;
  transform: translateY(-2px);
}

.filter-btn.active {
  background: #ff4d4d;
  color: white;
  border-color: #ff4d4d;
}

/* Responsive para filtros en móvil */
@media (max-width: 768px) {
  .filters-section {
    position: relative;
    top: 0;
    padding: 0.8rem 0;
  }

  .filters {
    gap: 0.5rem;
    padding: 0 15px;
  }

  .filter-btn {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    border-radius: 20px;
    margin-top: 5px;
  }
}

@media (max-width: 480px) {
  .filters {
    gap: 0.3rem;
    padding: 0 10px;
  }

  .filter-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
    border-radius: 15px;
    margin-top: 3px;
  }
}

/*---------------------------------------modal---------------------------------------*/

/* Estilos para el modal */
.project-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.project-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  position: relative;
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(0, 0, 0, 0.9) 100%);
  border: 1px solid rgba(255, 77, 77, 0.3);
  border-radius: 20px;
  max-width: 1200px;      /*------------------------tamaño del modal------------------------*/
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 77, 77, 0.2);
  border: 1px solid rgba(255, 77, 77, 0.3);
  color: white;
  font-size: 2rem;
  font-weight: bold;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
  line-height: 1;
  z-index: 1000;
  pointer-events: all;
  user-select: none;
}

.modal-close:hover {
  background: #ff4d4d;
  transform: rotate(90deg);
}

.modal-header {
  padding: 2rem 2rem 1rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 77, 77, 0.2);
}

.modal-header h2 {
  font-size: 2rem;
  color: #ff4d4d;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px rgba(255, 77, 77, 0.5);
}

.modal-header p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
}

.modal-body {
  padding: 2rem;
}

.modal-gallery {
  margin-bottom: 2rem;
}

.main-image {
  width: 100%;
  height: 500px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 15px;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 77, 77, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.main-image img {
  width: 100%;
  height: auto;
  min-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

/* Estilos para el scroll del main-image */
.main-image::-webkit-scrollbar {
  width: 8px;
}

.main-image::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.main-image::-webkit-scrollbar-thumb {
  background: rgba(255, 77, 77, 0.5);
  border-radius: 4px;
  transition: background 0.3s ease;
}

.main-image::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 77, 77, 0.8);
}

.thumbnail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.8rem;
  max-height: 200px;
  overflow-y: auto;
}

.thumbnail {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.thumbnail:hover {
  border-color: #ff4d4d;
  transform: scale(1.05);
}

.thumbnail.active {
  border-color: #ff4d4d;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.5);
}

.modal-info {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.modal-description,
.modal-highlights,
.modal-tech {
  background: rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  border-radius: 15px;
  border: 1px solid rgba(255, 77, 77, 0.2);
}

.modal-description h3,
.modal-highlights h3,
.modal-tech h3 {
  color: #ff4d4d;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.modal-description p {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

.modal-highlights ul {
  list-style: none;
  padding: 0;
}

.modal-highlights li {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
  position: relative;
}

.modal-highlights li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #ff4d4d;
  font-weight: bold;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-stack span {
  background: rgba(255, 77, 77, 0.2);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(255, 77, 77, 0.3);
}

/* Estilos para el botón Ver Detalle */
.project-detail-btn {
  background: linear-gradient(135deg, #ff4d4d 0%, #ff6b6b 100%);
  color: white !important;
  padding: 0.6rem 1.2rem;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: inline-block;
}

.project-detail-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
  transition: left 0.5s ease;
}

.project-detail-btn:hover::before {
  left: 100%;
}

.project-detail-btn:hover {
  background: linear-gradient(135deg, #e64444 0%, #ff4d4d 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 77, 77, 0.4);
  border-color: rgba(255, 77, 77, 0.3);
}

.project-detail-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(255, 77, 77, 0.3);
}

.modal-footer {
  padding: 2rem;
  border-top: 1px solid rgba(255, 77, 77, 0.2);
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.modal-btn {
  padding: 1rem 2rem;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.modal-btn.primary {
  background: #ff4d4d;
  color: white;
  border: 1px solid #ff4d4d;
}

.modal-btn.primary:hover {
  background: #ff6666;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 77, 77, 0.3);
}

.modal-btn.secondary {
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}