/* CSS Optimizado para Portafolio - Reemplazo ligero de Tailwind */
/* Pesa ~15KB vs ~200KB+ de Tailwind completo */

/* Reset básico y variables CSS */
:root {
  --purple-400: #c084fc;
  --purple-500: #a855f7;
  --purple-600: #9333ea;
  --purple-700: #7c3aed;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --black: #000000;
  --green-400: #4ade80;
  --orange-400: #fb923c;
  --red-400: #f87171;
  --cyan-400: #22d3ee;
  --amber-400: #fbbf24;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--black);
}

body {
  font-family: ui-sans-serif, system-ui, sans-serif;
  line-height: 1.5;
  color: var(--white);
  background-color: var(--black);
  -webkit-font-smoothing: antialiased;
}

/* Utilidades de layout */
.container { 
  max-width: 64rem; 
  margin: 0 auto; 
  padding: 0 1.5rem; 
}

.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Espaciado */
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Espaciado específico para skills grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 2rem;
}

@media (min-width: 768px) {
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem;
  }
}

.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-24 { padding-top: 6rem; padding-bottom: 6rem; }

.m-4 { margin: 1rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Posicionamiento */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-4 { top: 1rem; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }

/* Dimensiones */
.w-full { width: 100%; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-12 { width: 3rem; }
.h-full { height: 100%; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-12 { height: 3rem; }
.min-h-screen { min-height: 100vh; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-md { max-width: 28rem; }

/* Bordes y esquinas */
.border { border-width: 1px; }
.border-t { border-top-width: 1px; }
.border-white\/10 { border-color: rgba(255, 255, 255, 0.1); }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* Colores de fondo */
.bg-black { background-color: var(--black); }
.bg-white { background-color: var(--white); }
.bg-gray-800 { background-color: var(--gray-800); }
.bg-gray-900 { background-color: var(--gray-900); }

/* Gradientes */
.gradient-bg {
  background: radial-gradient(ellipse at top, rgba(147, 51, 234, 0.2) 0%, var(--black) 50%, var(--black) 100%);
}

.gradient-text {
  background: linear-gradient(to right, var(--white), var(--purple-400), var(--blue-400));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-purple-blue {
  background: linear-gradient(to right, var(--purple-400), var(--blue-400));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Tipografía */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-center { text-align: center; }
.text-left { text-align: left; }

.text-white { color: var(--white); }
.text-gray-300 { color: var(--gray-300); }
.text-gray-400 { color: var(--gray-400); }
.text-purple-400 { color: var(--purple-400); }
.text-blue-400 { color: var(--blue-400); }
.text-transparent { color: transparent; }

/* Efectos y transiciones */
.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
}

.hover-scale:hover {
  transform: scale(1.1);
}

.blur-effect {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Efectos de glassmorphism */
.glass {
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-card {
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(156, 163, 175, 0.2);
  transition: all 0.3s ease;
}

.glass-card:hover {
  background: rgba(31, 41, 55, 0.6);
  border-color: rgba(168, 85, 247, 0.2);
  box-shadow: 0 10px 25px rgba(168, 85, 247, 0.1);
}

/* Navegación */
.nav {
  position: fixed;
  top: 1rem;
  left: 0;
  right: 0;
  z-index: 50;
  max-width: 42rem;
  margin: 0 auto;
}

.nav-content {
  margin: 0 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(17, 24, 39, 0.7);
  padding: 1rem 1.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-link {
  position: relative;
  font-size: 0.875rem;
  color: var(--gray-300);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--white);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -0.25rem;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(to right, var(--purple-400), var(--blue-400));
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Secciones principales */
.hero {
  position: relative;
  display: flex;
  min-height: 90vh;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  height: 100%;
  width: 100%;
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  transform: rotate(12deg);
  background: linear-gradient(to bottom right, rgba(147, 51, 234, 0.1), rgba(59, 130, 246, 0.1));
  filter: blur(120px);
}

/* Tarjetas de proyectos y skills con mejor espaciado */
.project-card, .skill-card {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.07), transparent);
  padding: 0.125rem;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
}

.project-card:hover, .skill-card:hover {
  border-color: rgba(168, 85, 247, 0.2);
  box-shadow: 0 20px 25px rgba(168, 85, 247, 0.05);
}

/* Tarjetas mejoradas para About section */
.about-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.05), transparent);
  padding: 0.125rem;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  min-height: 280px;
}

.about-card:hover {
  border-color: rgba(168, 85, 247, 0.3);
  box-shadow: 0 25px 50px rgba(168, 85, 247, 0.1);
  transform: translateY(-5px);
}

.card-content {
  position: relative;
  height: 100%;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.9);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.skill-icon {
  display: flex;
  height: 3rem;
  width: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: linear-gradient(to bottom right, rgba(168, 85, 247, 0.2), rgba(59, 130, 246, 0.2));
  transition: transform 0.3s ease;
  color: var(--white);
}

.skill-card:hover .skill-icon,
.about-card:hover .skill-icon {
  transform: scale(1.1);
}

/* Tags de tecnología */
.tech-tag {
  display: inline-block;
  border-radius: 9999px;
  border: 1px solid rgba(168, 85, 247, 0.2);
  background: rgba(168, 85, 247, 0.1);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--purple-400);
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(to right, var(--purple-600), var(--blue-600));
  color: var(--white);
}

.btn-primary:hover {
  background: linear-gradient(to right, var(--purple-700), var(--blue-500));
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(168, 85, 247, 0.2);
}

/* Elementos de contacto mejorados */
.contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgba(17, 24, 39, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.contact-item:hover {
  background: rgba(31, 41, 55, 0.6);
  border-color: rgba(168, 85, 247, 0.2);
  transform: translateY(-2px);
}

.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: linear-gradient(to bottom right, rgba(168, 85, 247, 0.15), rgba(59, 130, 246, 0.15));
  color: var(--purple-400);
  flex-shrink: 0;
}

/* Contenedor de descripción del footer centrado */
.footer-description {
  max-width: 28rem;
  margin: 0 auto;
  text-align: center;
  text-align: center;
  font-size: 0.875rem;
  color: var(--gray-400);
  line-height: 1.6;
}

/* Enlaces sociales mejorados con mejor espaciado */
.social-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--gray-300);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  min-width: 120px;
  justify-content: center;
}

.social-link:hover {
  background: rgba(31, 41, 55, 0.8);
  border-color: rgba(168, 85, 247, 0.3);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(168, 85, 247, 0.15);
}

/* Contenedor de enlaces sociales con mejor separación */
.social-links-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Botón de volver arriba mejorado */
.back-to-top-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: linear-gradient(to bottom right, rgba(168, 85, 247, 0.2), rgba(59, 130, 246, 0.2));
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: var(--white);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.back-to-top-btn:hover {
  background: linear-gradient(to bottom right, rgba(168, 85, 247, 0.3), rgba(59, 130, 246, 0.3));
  border-color: rgba(168, 85, 247, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(168, 85, 247, 0.2);
}

.back-to-top-btn:active {
  transform: translateY(-1px);
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background-color: var(--black);
}

::-webkit-scrollbar-thumb {
  background-color: var(--gray-800);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--gray-700);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--gray-800) var(--black);
}

/* Selection */
::selection {
  background-color: rgba(168, 85, 247, 0.2);
  color: var(--purple-400);
}

/* Responsive */
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:flex-row { flex-direction: row; }
  .md\:text-4xl { font-size: 2.25rem; }
  .md\:text-5xl { font-size: 3rem; }
  .md\:text-6xl { font-size: 3.75rem; }
  .md\:text-xl { font-size: 1.25rem; }
  
  /* Mejor espaciado para about cards en desktop */
  .about-card {
    min-height: 320px;
  }
}

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

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Animación sutil para elementos interactivos */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.back-to-top-btn:hover {
  animation: pulse 2s infinite;
}

/* Utilidades adicionales específicas del diseño */
.pointer-events-none { pointer-events: none; }
.overflow-hidden { overflow: hidden; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.space-y-24 > * + * { margin-top: 6rem; }

.leading-relaxed { line-height: 1.625; }

.opacity-30 { opacity: 0.3; }
.group:hover .group-hover\:text-purple-400 { color: var(--purple-400); }
.group:hover .group-hover\:text-blue-400 { color: var(--blue-400); }
.group:hover .group-hover\:text-orange-400 { color: var(--orange-400); }
.group:hover .group-hover\:text-green-400 { color: var(--green-400); }
.group:hover .group-hover\:text-red-400 { color: var(--red-400); }
.group:hover .group-hover\:text-cyan-400 { color: var(--cyan-400); }