/* Fondo con partículas */
#particles-js {
  height: 100vh;
  width: 100%;
  position: fixed;
  z-index: -1;
}

/* Spotlight Reveal */
#spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(29, 78, 216, 0.15),
    transparent 40%
  );
}

/* Tema y tipografía */
body {
  background: #020617;
  color: #e2e8f0;
  font-family: "Martel Sans", sans-serif;
  margin: 0;
  padding: 0;
}

/* Layout dos columnas */
.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
  min-height: 100vh;
  align-items: start; /* Asegura que el sticky funcione correctamente */
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 80px 32px 32px 32px;
  /* border-right: 1px solid rgba(148, 163, 184, 0.2); Eliminado para concepto abierto */
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Alineado arriba */
  align-items: center; /* Centrado horizontal */
  text-align: center; /* Centrado de texto */
  overflow-y: auto;
}

.content {
  padding: 80px 32px;
}

.sidebar nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center; /* Asegura que los links estén centrados */
}

.brand img {
  width: 300px;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.5);
}

.brand h1 {
  margin: 12px 0 4px;
  font-size: 24px;
  color: #e2e8f0;
}

.brand p {
  margin: 0 0 24px;
  color: #94a3b8;
}

.sidebar nav a {
  color: #94a3b8;
  text-decoration: none;
  font-weight: 600;
}

.sidebar nav a:hover,
.activo {
  color: #38bdf8;
}

/* Redes Sociales Sidebar */
.social-sidebar {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 32px;
}

.social-sidebar a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.5rem;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-sidebar a:hover {
  color: #38bdf8;
  text-shadow: 0 0 10px #38bdf8;
  transform: scale(1.1);
}

/* Estilos de navegación y layout base */

/* Sobre mí */
.sobre-mi {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  text-align: center;
  padding: 40px 0;
}

.contenido {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 800px;
  background: rgba(2, 6, 23, 0.6);
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(6px);
}

.avatar img {
  width: 150px;
  height: 150px;
  border-radius: 12px;
  border: 2px solid #38bdf8;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

.texto h2,
.texto h3 {
  color: #38bdf8;
}

.texto p {
  text-align: justify;
  color: #e2e8f0;
}

.habilidades {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.habilidades img {
  width: 48px;
  height: 48px;
  transition: all 0.3s ease;
}

.habilidades img:hover {
  transform: translateY(-8px) scale(1.1);
  filter: drop-shadow(0 0 10px #38bdf8);
}

.content section {
  margin-bottom: 100px; /* Separación generosa entre secciones */
}

/* Experiencia (Timeline) */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 40px auto 80px auto; /* Margen inferior extra para el timeline */
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: rgba(56, 189, 248, 0.3);
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
  padding-left: 20px;
}

.timeline-marker {
  position: absolute;
  top: 6px;
  left: -5px;
  width: 12px;
  height: 12px;
  background: #020617;
  border: 2px solid #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
  z-index: 1;
}

.timeline-content h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #e2e8f0;
}

.timeline-content .company {
  display: block;
  font-size: 1rem;
  color: #38bdf8;
  font-weight: 600;
  margin-top: 4px;
}

.timeline-content .period {
  display: block;
  font-size: 0.875rem;
  color: #94a3b8;
  margin-bottom: 12px;
}

.timeline-content p {
  color: #cbd5e1;
  line-height: 1.6;
  margin: 0;
}

/* Proyectos (Grid Cards) */
.section-title {
  color: #e2e8f0;
  font-size: 2rem;
  margin-bottom: 40px;
  text-align: left;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem; /* 32px para espacio vertical y horizontal */
  row-gap: 3rem; /* Mayor espacio vertical extra para seguridad */
  margin-bottom: 40px; /* Asegurar espacio extra al final del grid */
}

.project-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  padding: 24px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  height: 100%;
  min-height: 100px; /* Altura mínima para evitar colapsos */
  margin-bottom: 20px; /* Margen inferior extra para cada tarjeta */
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Para que el footer se vaya al fondo */
  
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: #38bdf8;
  box-shadow: 0 10px 30px -10px rgba(56, 189, 248, 0.3);
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.project-top i {
  color: #38bdf8;
  font-size: 40px;
}

.project-content h3 {
  color: #e2e8f0;
  font-size: 1.5rem;
  margin: 0 0 12px;
}

.project-description p {
  color: #94a3b8;
  font-size: 1rem;
  line-height: 1.6;
}

.project-tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin-top: auto;
}

.project-tech-list li {
  color: #38bdf8;
  font-family: monospace;
  font-size: 0.875rem;
}

/* Contacto */
.titulo-contacto {
  color: #38bdf8;
  text-align: left;
  font-size: 2rem;
  font-weight: bold;
}

#form-contacto {
  width: 100%;
  max-width: 560px;
  margin: 24px 0;
  padding: 20px;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.input-container {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  margin-bottom: 15px;
}

.input-container i {
  color: #e2e8f0;
  margin-right: 10px;
}

#form-contacto input,
#form-contacto textarea {
  flex: 1;
  width: calc(100% - 20px);
  border: none;
  background: transparent;
  color: #e2e8f0;
  outline: none;
  font-size: 16px;
  padding: 8px;
  text-align: left;
}

#form-contacto textarea {
  resize: none;
  height: 100px;
}

#form-contacto input::placeholder,
#form-contacto textarea::placeholder {
  color: rgba(226, 232, 240, 0.6);
}

.btn-enviar {
  width: 100%;
  background: #0ea5e9;
  color: #0b1220;
  font-size: 16px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s, background 0.3s;
}

.btn-enviar:hover {
  background: #38bdf8;
  transform: scale(1.02);
}

#form-contacto input:focus,
#form-contacto textarea:focus {
  border: 2px solid #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

/* Responsive */
@media (max-width: 992px) {
  .layout {
    grid-template-columns: 300px 1fr;
    gap: 0;
    padding: 0;
  }
}
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding: 32px;
  }
  .content {
    padding: 32px;
  }
  .sobre-mi {
    min-height: auto;
  }
}
