/* =========================================
   ESTILOS GENERALES Y RESET
   ========================================= */
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background-color: #0d0d0d;
  color: #f5f5f5;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

h1,
h2,
h3 {
  color: #ffffff;
}

a {
  color: #4e8cff;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  text-decoration: underline;
  color: #6ea3ff;
}

.cargo-h1 {
  display: block;
  font-size: 1.2rem;
  color: #bbb;
  margin-top: 5px;
  font-weight: 400;
}

/* =========================================
   NAVBAR MEJORADA (RESPONSIVE & UX)
   ========================================= */
.navbar {
  position: sticky;
  top: 0;
  background-color: rgba(13, 13, 13, 0.98);
  padding: 15px 0;
  z-index: 1000;
  border-bottom: 1px solid #222;
  backdrop-filter: blur(10px);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center; /* Centrado en Desktop */
  align-items: center;
  padding: 0 1rem;
}

.menu-toggle {
  display: none; /* Oculto en PC */
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.nav-links a:hover {
  color: #4e8cff;
  background: rgba(78, 140, 255, 0.1);
  text-decoration: none;
}

/* =========================================
   HEADER / PERFIL
   ========================================= */
.perfil {
  text-align: center;
  padding: 3rem 2rem;
  background: #111;
  border-bottom: 1px solid #222;
}

/* NOTA: .perfil-img ha sido reemplazado por la animación .flip-card más abajo,
   pero mantenemos estilos genéricos si los hubiera. */

.ubicacion {
  font-size: 0.9rem;
  color: #888;
  margin-top: 0.5rem;
}

.social-links {
  margin-top: 1rem;
}

.social-links a {
  margin: 0 0.5rem;
  font-size: 0.9rem;
  background: #1a1a1a;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
}

.social-links a:hover {
  border-color: #4e8cff;
  background: #222;
  text-decoration: none;
}

/* =========================================
   SECCIONES Y CARDS
   ========================================= */
section {
  padding: 3rem 2rem;
  border-bottom: 1px solid #222;
  max-width: 1200px;
  margin: 0 auto;
}

/* Tags de Tecnologías */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.tags span {
  background: #1e1e2f;
  color: #fff;
  padding: 8px 16px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  border: 1px solid #333;
}

/* Tarjetas de Experiencia / Formación */
.card {
  background: #1a1a1a;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid #333;
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: #4e8cff;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 10px;
}

.card-header h3 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.4;
}

.años {
  background-color: #4e8cff;
  color: #fff;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.card p {
  margin: 0 0 10px 0;
  color: #ccc;
  font-size: 0.95rem;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* =========================================
   SECCIÓN DE PROYECTOS (GRID VISUAL)
   ========================================= */
.proyectos-grid {
  display: grid;
  /* Minmax 280px para que no se rompa en móviles pequeños */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 1rem;
}

.proyecto-card {
  background: #1a1a1a;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #333;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.proyecto-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border-color: #4e8cff;
}

/* Banner General */
.card-banner {
  height: 180px;
  width: 100%;
  background: #222;
  position: relative;
}

/* Estilo para imágenes que rellenan el banner (NexCore) */
.card-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Estilo para banner con ícono (GitHub) */
.card-banner.con-icono {
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-banner.con-icono i {
  font-size: 5rem;
  color: rgba(255, 255, 255, 0.9);
  transition: transform 0.3s ease;
}

.proyecto-card:hover .card-banner.con-icono i {
  transform: scale(1.1) rotate(-5deg);
  color: #ffffff;
}

/* Contenido de la tarjeta */
.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-content h3 {
  margin-top: 0;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 1rem 0;
}

.tech-tag {
  background: rgba(78, 140, 255, 0.1);
  color: #4e8cff;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  border: 1px solid rgba(78, 140, 255, 0.2);
}

.btn-proyecto {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #4e8cff;
  color: white !important;
  padding: 0.8rem;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.3s;
}

.btn-proyecto:hover {
  background-color: #356ac3;
  text-decoration: none;
}

/* =========================================
   FOOTER
   ========================================= */
footer {
  background: #050505;
  padding: 4rem 1rem 2rem;
  border-top: 1px solid #333;
  margin-top: 4rem;
  color: #ccc;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  text-align: center;
}

.footer-section h3 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

.footer-section h3::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: #4e8cff;
  margin: 8px auto 0;
  border-radius: 2px;
}

.footer-links {
  list-style: none;
  padding: 0;
}
.footer-links li {
  margin-bottom: 0.8rem;
}
.footer-links a {
  color: #bbb;
  transition: color 0.3s;
}
.footer-links a:hover {
  color: #4e8cff;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 1rem;
}

.social-icons a {
  font-size: 1.4rem;
  color: #fff;
  background: #1f1f1f;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.social-icons a:hover {
  background: #4e8cff;
  transform: translateY(-5px);
}

.footer-bottom {
  text-align: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #222;
  font-size: 0.85rem;
  color: #666;
}

/* Botón Volver Arriba */
.btn-subir {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #4e8cff;
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  z-index: 999;
  transition: transform 0.3s, background 0.3s;
}

.btn-subir:hover {
  transform: translateY(-5px);
  background: #356ac3;
}

/* =========================================
   MEDIA QUERIES (MÓVIL)
   ========================================= */
@media (max-width: 768px) {
  /* Navegación Móvil */
  .nav-container {
    justify-content: flex-end;
  }

  .menu-toggle {
    display: block;
    z-index: 1001;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%; /* Oculto inicialmente */
    width: 70%;
    height: 100vh;
    background: #111;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    border-left: 1px solid #333;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    font-size: 1.2rem;
    padding: 1rem 2rem;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid #222;
  }

  /* Ajustes Generales */
  section {
    padding: 3rem 1.5rem;
  }
  h1 {
    font-size: 1.8rem;
  }
  .cargo-h1 {
    font-size: 1rem;
  }
  /* Ajustes para la animación en móvil si fuera necesario */
}

/* =========================================
   ANIMACIÓN FLIP CARD (MONEDA 3D)
   ========================================= */

/* Contenedor principal de la "moneda" */
.flip-card {
  background-color: transparent;
  width: 140px; /* Tamaño de la foto */
  height: 140px;
  perspective: 1000px; /* Profundidad 3D */
  margin: 0 auto 1rem auto; /* Centrado */
}

/* El contenedor interno que gira */
.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Efecto rebote suave */
  transform-style: preserve-3d;
}

/* Acción de giro al pasar el mouse */
.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

/* Estilos comunes para ambas caras */
.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden; /* Safari */
  backface-visibility: hidden;
  border-radius: 50%; /* Forma circular */
  overflow: hidden;
  border: 3px solid #333; /* Borde del círculo */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* Cara FRONTAL (Foto Formal) */
.flip-card-front {
  background-color: #111;
}

/* Cara TRASERA (Foto Casual) */
.flip-card-back {
  background-color: #111;
  transform: rotateY(180deg);
}

/* Asegurar que las imágenes llenen el círculo */
.flip-card-front img,
.flip-card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
