/* ===== VARIABLES Y RESET ===== */
:root {
  --matrix-green: #00ff41;
  --matrix-dark-green: #008f11;
  --matrix-black: #000000;
  --matrix-light-black: #0a0a0a;
  --matrix-gray: #0f0f0f;
  --neon-glow: 0 0 5px var(--matrix-green), 0 0 10px var(--matrix-green), 0 0 15px var(--matrix-green), 0 0 20px var(--matrix-dark-green);
  --font-primary: 'Courier New', Courier, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--matrix-black);
  color: var(--matrix-green);
  font-family: var(--font-primary);
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== LAYOUT Y CONTENEDORES ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 100px 0;
  position: relative;
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 60px;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: var(--neon-glow);
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background-color: var(--matrix-green);
  box-shadow: 0 0 10px var(--matrix-green);
}

/* ===== HEADER Y NAVEGACIÓN ===== */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.9);
  padding: 15px 0;
  box-shadow: 0 0 25px var(--matrix-green);
  z-index: 1000;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--matrix-green);
}

/* HEADER CENTRADO - H1 ARRIBA, NAV ABAJO */
.header-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.logo {
  font-size: 2rem;
  color: var(--matrix-green);
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: var(--neon-glow);
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo i {
  animation: pulse 2s infinite;
}

.nav {
  display: flex;
  gap: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--matrix-green);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 1.5px;
  text-shadow: 0 0 8px var(--matrix-green);
  transition: all 0.3s ease;
  padding: 8px 16px;
  border-radius: 4px;
}

.nav-link:hover {
  color: var(--matrix-black);
  background-color: var(--matrix-green);
  text-shadow: none;
  box-shadow: 0 0 15px var(--matrix-green);
}

/* ===== HERO SECTION ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 20px;
  position: relative;
}

.hero-content {
  max-width: 800px;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: 4px;
  text-shadow: var(--neon-glow);
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 40px;
  text-shadow: 0 0 10px var(--matrix-green);
}

/* ===== BOTONES ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 30px;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
  border: none;
  font-family: var(--font-primary);
  letter-spacing: 1.5px;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--matrix-green);
  color: var(--matrix-black);
  box-shadow: 0 0 15px var(--matrix-green);
}

.btn-primary:hover {
  background-color: var(--matrix-dark-green);
  box-shadow: 0 0 25px var(--matrix-green);
  transform: translateY(-3px);
}

.btn-hover-scale:hover {
  transform: scale(1.05);
}

/* ===== SOBRE MÍ ===== */
.about-content {
  display: flex;
  align-items: center;
  gap: 50px;
  margin-bottom: 60px;
}

.profile-container {
  flex: 0 0 300px;
}

.profile-img-wrapper {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--neon-glow);
}

.about-profile-img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.profile-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent 30%, var(--matrix-green) 100%);
  opacity: 0.2;
  transition: opacity 0.5s ease;
}

.profile-img-wrapper:hover .about-profile-img {
  transform: scale(1.05);
}

.profile-img-wrapper:hover .profile-overlay {
  opacity: 0.4;
}

.about-text-container {
  flex: 1;
  text-align: center; /* TEXTO CENTRADO */
}

.about-text {
  font-size: 1.2rem;
  line-height: 1.8;
  margin-bottom: 40px;
  text-align: center; /* TEXTO CENTRADO */
}

.about-text strong {
  color: var(--matrix-dark-green);
  text-shadow: 0 0 5px var(--matrix-green);
}

/* ICONOS CENTRADOS */
.about-icons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  justify-items: center; /* CENTRA LOS ITEMS EN LA GRID */
}

.icon-item {
  text-align: center;
  padding: 30px 20px;
  border-radius: 8px;
  background: rgba(0, 255, 65, 0.05);
  border: 1px solid rgba(0, 255, 65, 0.2);
  transition: all 0.3s ease;
  max-width: 300px; /* ANCHO MÁXIMO PARA MEJOR CENTRADO */
  width: 100%;
}

.icon-item:hover {
  transform: translateY(-10px);
  box-shadow: var(--neon-glow);
  background: rgba(0, 255, 65, 0.1);
}

.icon-item i {
  margin-bottom: 20px;
  color: var(--matrix-green);
  text-shadow: 0 0 10px var(--matrix-green);
  font-size: 2.5rem;
}

.icon-item h3 {
  margin-bottom: 15px;
  font-size: 1.3rem;
}

/* ===== HABILIDADES ===== */
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-width: 800px;
  margin: 0 auto;
}

.skill {
  padding: 20px;
  border-radius: 8px;
  background: rgba(0, 255, 65, 0.05);
  border: 1px solid rgba(0, 255, 65, 0.2);
  transition: all 0.3s ease;
}

.skill:hover {
  box-shadow: var(--neon-glow);
  background: rgba(0, 255, 65, 0.1);
}

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.skill-header h3 {
  font-size: 1.2rem;
}

.skill-percentage {
  font-weight: bold;
  color: var(--matrix-dark-green);
  text-shadow: 0 0 5px var(--matrix-green);
}

.progress-bar {
  height: 10px;
  background-color: var(--matrix-gray);
  border-radius: 5px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--matrix-dark-green), var(--matrix-green));
  border-radius: 5px;
  width: 0;
  transition: width 1.5s ease-in-out;
}

/* ===== PROYECTOS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  justify-items: center; /* CENTRA LAS TARJETAS DE PROYECTOS */
}

.project-card {
  height: 300px;
  perspective: 1000px;
  width: 100%;
  max-width: 350px; /* ANCHO MÁXIMO PARA MEJOR CENTRADO */
}

.project-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.project-card:hover .project-card-inner {
  transform: rotateY(180deg);
}

.project-card-front,
.project-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.project-card-front {
  background-color: var(--matrix-light-black);
  border: 1px solid rgba(0, 255, 65, 0.3);
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

.project-card-back {
  background-color: var(--matrix-black);
  border: 1px solid var(--matrix-green);
  transform: rotateY(180deg);
  box-shadow: var(--neon-glow);
}

.project-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  color: var(--matrix-green);
  text-shadow: 0 0 10px var(--matrix-green);
}

.project-card h3 {
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.project-card p {
  margin-bottom: 20px;
}

/* ===== DESCARGAS ===== */
.downloads-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  justify-content: center;
  max-width: 800px;
  margin: 0 auto;
  justify-items: center; /* CENTRA LOS ITEMS DE DESCARGA */
}

.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  background: rgba(0, 255, 65, 0.05);
  border: 1px solid rgba(0, 255, 65, 0.2);
  border-radius: 8px;
  text-decoration: none;
  color: var(--matrix-green);
  transition: all 0.3s ease;
  gap: 15px;
  flex: 1;
  flex-basis: 0;
  min-width: 300px;
  height: 120px;
}

.download-item:hover {
  box-shadow: var(--neon-glow);
  background: rgba(0, 255, 65, 0.1);
  transform: translateY(-5px);
}

.download-icon {
  font-size: 2rem;
  color: var(--matrix-green);
  text-shadow: 0 0 10px var(--matrix-green);
}

.download-info {
  flex: 1;
  text-align: left;
}

.download-info h3 {
  margin-bottom: 5px;
}

.download-arrow {
  color: var(--matrix-green);
  font-size: 1.2rem;
  align-self: center;
  margin-left: auto;
  margin-right: 10px;
}

/* ===== CONTACTO ===== */
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: start;
}

.contact-info {
  text-align: center;
}

.contact-text {
  font-size: 1.3rem;
  margin-bottom: 30px;
}

.contact-text a {
  color: var(--matrix-green);
  text-decoration: none;
  transition: all 0.3s ease;
}

.contact-text a:hover {
  text-shadow: var(--neon-glow);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: 2px solid var(--matrix-green);
  border-radius: 50%;
  color: var(--matrix-green);
  text-decoration: none;
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.social-link:hover {
  background-color: var(--matrix-green);
  color: var(--matrix-black);
  box-shadow: var(--neon-glow);
  transform: translateY(-5px);
}

.contact-form {
  background: rgba(0, 255, 65, 0.05);
  border: 1px solid rgba(0, 255, 65, 0.2);
  border-radius: 10px;
  padding: 30px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  background: var(--matrix-light-black);
  border: 1px solid var(--matrix-green);
  border-radius: 4px;
  color: var(--matrix-green);
  font-family: var(--font-primary);
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  box-shadow: var(--neon-glow);
}

/* ===== FOOTER CENTRADO ===== */
.footer {
  background: rgba(0, 0, 0, 0.9);
  padding: 30px 0;
  text-align: center;
  border-top: 1px solid var(--matrix-green);
  box-shadow: 0 0 20px var(--matrix-green);
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.footer-links a {
  color: var(--matrix-green);
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-links a:hover {
  text-shadow: var(--neon-glow);
}

/* ===== ANIMACIONES ===== */
@keyframes pulse {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.fade-in {
  animation: fadeIn 1s ease;
}

.fade-in-up {
  animation: slideInUp 0.8s ease;
}

/* ===== EFECTO MATRIX CANVAS ===== */
.matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: #000;
  pointer-events: none;
  opacity: 0.7;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 20px;
  }
  
  .nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .about-content {
    flex-direction: column;
    text-align: center;
  }
  
  .profile-container {
    flex: none;
    max-width: 250px;
    margin: 0 auto;
  }
  
  .contact-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .footer-container {
    flex-direction: column;
    gap: 20px;
  }
  
  .about-icons {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .about-icons {
    grid-template-columns: 1fr;
  }
  
  .nav {
    flex-direction: column;
    align-items: center;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 10px;
  }
}