@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;500;700&display=swap');

/* RESET GENERAL */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
}

body {
  margin: 0;
  background-color: #000;
  color: white;
  overflow-x: hidden;
}

/* ───────────── PANTALLA PROYECTOS ───────────── */
.pantalla-proyectos {
  min-height: 100vh;
  background: linear-gradient(180deg, #000814 0%, #001d3d 100%);
  padding: 60px 20px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.titulo-proyectos {
  font-size: 2.8rem;
  font-weight: 700;
  color: #ffd60a;
  text-align: center;
  margin-bottom: 10px;
  text-shadow: 0 0 20px rgba(255, 214, 10, 0.5);
  animation: fadeInDown 0.8s ease;
}

.subtitulo-proyectos {
  font-size: 1.15rem;
  font-weight: 300;
  color: #ccc;
  text-align: center;
  margin-bottom: 45px;
  animation: fadeInUp 0.8s ease;
}

/* ───────────── GRID DE PROYECTOS ───────────── */
.grid-proyectos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
  width: 100%;
  max-width: 1200px;
  margin-bottom: 35px;
}

/* ───────────── TARJETA DE PROYECTO ───────────── */
.tarjeta-proyecto {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  animation: fadeIn 0.6s ease;
}

.tarjeta-proyecto:hover {
  transform: translateY(-8px);
  border-color: #003cff;
  box-shadow: 0 10px 30px rgba(0, 60, 255, 0.4);
}

.imagen-proyecto {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
  background-color: #111;
}

.imagen-proyecto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.tarjeta-proyecto:hover .imagen-proyecto img {
  transform: scale(1.1);
}

/* Overlay al pasar el ratón */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 60, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tarjeta-proyecto:hover .overlay {
  opacity: 1;
}

.btn-ver {
  background: #ffd60a;
  color: #000;
  border: none;
  padding: 11px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 214, 10, 0.4);
}

.btn-ver:hover {
  background: #ffed4e;
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 214, 10, 0.6);
}

/* ───────────── INFO DEL PROYECTO ───────────── */
.info-proyecto {
  padding: 18px;
}

.info-proyecto h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #ffd60a;
  margin-bottom: 7px;
}

.info-proyecto .tipo {
  font-size: 0.9rem;
  color: #aaa;
  font-weight: 300;
}

/* ───────────── MODAL ───────────── */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.92);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.modal-contenido {
  background: linear-gradient(135deg, #001d3d 0%, #000814 100%);
  padding: 38px;
  border-radius: 15px;
  max-width: 800px;
  width: 90%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  border: 2px solid #003cff;
  box-shadow: 0 10px 50px rgba(0, 60, 255, 0.5);
  animation: slideUp 0.4s ease;
}

.cerrar {
  position: absolute;
  top: 12px;
  right: 22px;
  color: #ffd60a;
  font-size: 2.3rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cerrar:hover {
  color: #ffed4e;
  transform: scale(1.2);
}

.modal-contenido h2 {
  color: #ffd60a;
  font-size: 1.9rem;
  margin-bottom: 9px;
}

.tipo-modal {
  color: #aaa;
  font-size: 0.95rem;
  margin-bottom: 18px;
  font-weight: 300;
}

.imagen-modal {
  width: 100%;
  border-radius: 10px;
  margin: 18px 0;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.video-modal {
  width: 100%;
  border-radius: 10px;
  margin: 18px 0;
}

.descripcion-modal {
  color: #ddd;
  font-size: 1.05rem;
  line-height: 1.7;
  text-align: justify;
}

/* ───────────── BOTÓN VOLVER ───────────── */
.volver {
  display: inline-block;
  margin-top: 35px;
  background-color: #003399;
  color: white;
  padding: 13px 32px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 51, 153, 0.4);
}

.volver:hover {
  background-color: #001f66;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 51, 153, 0.6);
}

/* ───────────── ANIMACIONES ───────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ───────────── RESPONSIVE: SMARTPHONES ───────────── */
@media screen and (max-width: 767px) {
  .pantalla-proyectos {
    padding: 35px 15px 70px;
  }

  .titulo-proyectos {
    font-size: 1.8rem;
  }

  .subtitulo-proyectos {
    font-size: 0.95rem;
    margin-bottom: 28px;
  }

  .grid-proyectos {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .imagen-proyecto {
    height: 200px;
  }

  .info-proyecto h3 {
    font-size: 1.15rem;
  }

  .modal-contenido {
    padding: 28px 18px;
    width: 95%;
  }

  .modal-contenido h2 {
    font-size: 1.4rem;
  }

  .descripcion-modal {
    font-size: 0.95rem;
  }

  .volver {
    padding: 11px 23px;
    font-size: 0.85rem;
  }

  .btn-ver {
    padding: 10px 24px;
    font-size: 0.9rem;
  }
}

/* ───────────── RESPONSIVE: TABLETS ───────────── */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .pantalla-proyectos {
    padding: 50px 18px 75px;
  }

  .grid-proyectos {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }

  .titulo-proyectos {
    font-size: 2.3rem;
  }

  .subtitulo-proyectos {
    font-size: 1.05rem;
  }

  .imagen-proyecto {
    height: 220px;
  }

  .modal-contenido {
    padding: 32px 25px;
  }
}

/* ───────────── RESPONSIVE: PC Y PORTÁTILES ───────────── */
@media screen and (min-width: 1024px) {
  .grid-proyectos {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ───────────── SCROLL PERSONALIZADO ───────────── */
.modal-contenido::-webkit-scrollbar {
  width: 9px;
}

.modal-contenido::-webkit-scrollbar-track {
  background: #001d3d;
  border-radius: 10px;
}

.modal-contenido::-webkit-scrollbar-thumb {
  background: #003cff;
  border-radius: 10px;
}

.modal-contenido::-webkit-scrollbar-thumb:hover {
  background: #0052ff;
}

/* ───────────── MEJORAS PROYECTO IA ───────────── */
.btn-detalle-completo {
  display: inline-block;
  margin-top: 1.4rem;
  padding: 11px 26px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd60a, #ffed4e);
  color: #000;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(255, 214, 10, 0.45);
}

.btn-detalle-completo:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(255, 214, 10, 0.7);
  background: linear-gradient(90deg, #ffed4e, #fff3a1);
}

.detalle-proyecto-ia {
  margin-top: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  width: 100%;
  max-width: 1100px;
}

.bloque-ia h2 {
  font-size: 1.5rem;
  margin-bottom: 0.7rem;
  color: #ffd60a;
}

.bloque-ia p,
.bloque-ia ul {
  font-size: 0.93rem;
  line-height: 1.7;
  color: #eee;
}

.bloque-ia ul {
  margin-left: 1.1rem;
  margin-top: 0.4rem;
}

.bloque-ia ul li {
  margin-bottom: 0.3rem;
}

.arquitectura-ia {
  margin: 0.9rem 0;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 60, 255, 0.4);
  text-align: center;
  font-size: 0.9rem;
}

.grid-funciones-ia {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.4rem;
  margin-top: 0.9rem;
}

.card-funcion-ia {
  padding: 1.1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
}

.card-funcion-ia h3 {
  margin-bottom: 0.5rem;
  color: #ffd60a;
  font-size: 1.05rem;
}

.card-funcion-ia p {
  font-size: 0.88rem;
  color: #ddd;
}

.video-ia {
  width: 100%;
  max-width: 720px;
  border-radius: 10px;
  margin-top: 0.9rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.acciones-ia {
  margin-top: 2.3rem;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-contacto-ia {
  display: inline-block;
  background-color: #003399;
  color: #fff;
  padding: 11px 26px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 51, 153, 0.5);
}

.btn-contacto-ia:hover {
  background-color: #001f66;
  transform: translateY(-3px);
  box-shadow: 0 6px 22px rgba(0, 51, 153, 0.7);
}

@media screen and (max-width: 767px) {
  .detalle-proyecto-ia {
    padding: 0 5px;
  }

  .bloque-ia h2 {
    font-size: 1.3rem;
  }

  .grid-funciones-ia {
    grid-template-columns: 1fr;
  }
}
