@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

body {
  font-family: "Inter", sans-serif;
}

/* --- Animaciones de Entrada al Hacer Scroll --- */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Microinteracciones de Botones --- */
.hero-button {
  transition: transform 0.2s ease-out;
}

.hero-button:hover {
  transform: translateY(-4px);
}

/* Fondo con patrón de cuadrícula sutil */
.bg-grid-pattern {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* Estilo de fondo técnico para las imágenes de proyectos */
.bg-blueprint {
  background-color: #0f172a;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

.bg-blueprint-grid {
  background-image: radial-gradient(#3b82f6 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Navegación estilo cristal */
.glass-nav {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

.dark .glass-nav {
  background: rgba(15, 23, 42, 0.9);
}

/* Tarjetas estilo cristal */
.glass-card {
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: all 0.3s ease;
}

.dark .glass-card {
  background-color: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(71, 85, 105, 0.5);
}

/* Hover en tarjetas de habilidades */
.skill-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
  border-color: rgba(37, 99, 235, 0.5);
}

/* Transiciones para el Acordeón de Experiencia */
.accordion-content {
  transition:
    max-height 0.3s ease-in-out,
    opacity 0.3s ease-in-out;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.accordion-item.active .accordion-content {
  max-height: 500px;
  opacity: 1;
}

.accordion-item.active {
  border-color: #2563eb;
  background-color: rgba(37, 99, 235, 0.05);
}

.accordion-item.active .job-title {
  color: #2563eb;
}

.accordion-item.active .arrow-icon {
  transform: rotate(180deg);
  color: #2563eb;
}

/* --- Lightbox Gallery --- */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.95); /* bim-dark with opacity */
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-image {
  transform: scale(1);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
  border-radius: 50%;
  z-index: 10000;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(37, 99, 235, 0.8); /* bim-blue */
  transform: scale(1.1);
}

.lightbox-close {
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  font-size: 24px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  font-size: 20px;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

@media (max-width: 768px) {
  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.3);
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }
}

/* --- Hero Section Improvements --- */

/* Dynamic Background */
@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.bg-hero-animated {
  background: linear-gradient(-45deg, #0f172a, #1e293b, #0f172a, #0b1220);
  background-size: 400% 400%;
  position: relative;
  overflow: hidden;
  animation: gradientBG 15s ease infinite;
}

/* Overlay Pattern */
.hero-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
  pointer-events: none;
}

/* Floating Particles (Simulated with pseudo-elements for performance) */
@keyframes floatParticles {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(50px, 30px) rotate(10deg);
  }
  66% {
    transform: translate(-20px, 50px) rotate(-5deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

.hero-particles::before,
.hero-particles::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.1) 0%,
    transparent 70%
  );
  border-radius: 50%;
  animation: floatParticles 20s infinite linear;
  pointer-events: none;
}

.hero-particles::before {
  top: -10%;
  left: -10%;
  animation-duration: 25s;
}

.hero-particles::after {
  bottom: -10%;
  right: -10%;
  animation-duration: 30s;
  animation-direction: reverse;
}

/* Text Gradients */
.text-gradient-hero {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

.dark .text-gradient-hero {
  background: linear-gradient(135deg, #93c5fd 0%, #60a5fa 50%, #3b82f6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Button Glow */
.btn-glow {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  z-index: 1;
}

.btn-glow::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
  z-index: -1;
}

.btn-glow:hover::before {
  left: 100%;
}

.btn-glow:hover {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}
