/* ========================================
   VARIABLES Y CONFIGURACIÓN GLOBAL
   ======================================== */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --dark-bg: #0a0a0a;
  --dark-surface: #1a1a1a;
  --dark-surface-2: #2a2a2a;
  --light-bg: #ffffff;
  --light-surface: #f8f9fa;
  --light-surface-2: #e9ecef;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --text-primary-light: #212529;
  --text-secondary-light: #6c757d;
  --accent: #667eea;
  --success: #00f2fe;
  --warning: #f5576c;
}

[data-theme="light"] {
  --bg-color: var(--light-bg);
  --surface-color: var(--light-surface);
  --surface-color-2: var(--light-surface-2);
  --text-color: var(--text-primary-light);
  --text-color-secondary: var(--text-secondary-light);
  --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --bg-color: var(--dark-bg);
  --surface-color: var(--dark-surface);
  --surface-color-2: var(--dark-surface-2);
  --text-color: var(--text-primary);
  --text-color-secondary: var(--text-secondary);
  --shadow: rgba(0, 0, 0, 0.5);
}

/* ========================================
   RESET Y ESTILOS BASE
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
  transition: all 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ========================================
   LOADER
   ======================================== */
.loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.loader {
  width: 60px;
  height: 60px;
  position: relative;
  animation: rotate 1.5s linear infinite;
}

.loader span {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--primary-gradient);
  opacity: 0.8;
  animation: pulse 2s ease-in-out infinite;
}

.loader span:nth-child(2) {
  animation-delay: -1s;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0);
    opacity: 0.5;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ========================================
   NAVEGACIÓN
   ======================================== */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1rem 0;
  background: var(--bg-color);
  backdrop-filter: blur(10px);
  z-index: 1000;
  transition: all 0.3s ease;
}

nav.scrolled {
  background: var(--surface-color);
  box-shadow: 0 5px 20px var(--shadow);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-gradient);
  transition: width 0.3s ease;
}

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

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.theme-toggle:hover {
  transform: rotate(180deg);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem 2rem;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.1;
  z-index: -1;
}

.hero-bg::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: var(--primary-gradient);
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(30px, -30px) rotate(120deg);
  }
  66% {
    transform: translate(-20px, 20px) rotate(240deg);
  }
}

.hero-content {
  max-width: 1200px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
  animation: slideInLeft 1s ease;
}

.hero-text .gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-text p {
  font-size: 1.25rem;
  color: var(--text-color-secondary);
  margin-bottom: 2rem;
  animation: slideInLeft 1s ease 0.2s both;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: slideInLeft 1s ease 0.4s both;
}

.btn {
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
  background: transparent;
  color: var(--text-color);
  border: 2px solid var(--accent);
}

.btn-secondary:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-3px);
}

.hero-image {
  position: relative;
  animation: slideInRight 1s ease;
}

.hero-image-wrapper {
  position: relative;
  width: 100%;
  height: 500px;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}



/* ========================================
   ANIMACIONES
   ======================================== */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========================================
   ABOUT SECTION
   ======================================== */
.about {
  padding: 5rem 2rem;
  background: var(--surface-color);
}

.section-title {
  text-align: center;
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: var(--primary-gradient);
  border-radius: 2px;
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.about-content p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-color-secondary);
  margin-bottom: 2rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.skill-card {
  background: var(--surface-color-2);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.skill-card:hover::before {
  opacity: 0.1;
}

.skill-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 30px var(--shadow);
}

.skill-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
}

.skill-name {
  font-weight: 600;
  position: relative;
  z-index: 1;
}

/* ========================================
SERVICES SECTION
======================================== */
.services {
  padding: 5rem 2rem;
}

.services-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.service-card {
  background: var(--surface-color);
  padding: 2.5rem;
  border-radius: 20px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--primary-gradient);
  border-radius: 20px;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.service-card:hover::before {
  opacity: 1;
}

.service-card:hover .service-icon,
.service-card:hover h3,
.service-card:hover p {
  color: #fff !important;
}

.service-card:hover .service-icon {
  -webkit-text-fill-color: #fff !important;
  background: none !important;
}

.service-card:hover {
  transform: translateY(-10px);
  background: var(--bg-color);
}

.service-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.service-card p {
  color: var(--text-color-secondary);
  line-height: 1.6;
}

/* ========================================
   PROJECTS SECTION
   ======================================== */
.projects {
  padding: 5rem 2rem;
  background: var(--surface-color);
}

.projects-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--bg-color);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px var(--shadow);
}

.project-image {
  width: 100%;
  height: 250px;
  background: var(--primary-gradient);
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.project-image::after {
  content: "Ver Proyecto";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: rgba(0, 0, 0, 0.7);
  padding: 0.5rem 1rem;
  border-radius: 5px;
}

.project-card:hover .project-image::after {
  opacity: 1;
}

.project-content {
  padding: 2rem;
}

.project-content h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.project-content p {
  color: var(--text-color-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tech-tag {
  background: var(--surface-color-2);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--text-color-secondary);
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s ease;
}

.project-link:hover {
  color: var(--text-color);
}

/* ========================================
   TESTIMONIALS SECTION
   ======================================== */
.testimonials {
  padding: 5rem 2rem;
}

.testimonials-container {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.testimonial-card {
  background: var(--surface-color);
  padding: 2.5rem;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 5px 20px var(--shadow);
}

.testimonial-text {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-color-secondary);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.testimonial-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.author-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-gradient);
}

.author-info h4 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.author-info p {
  font-size: 0.9rem;
  color: var(--text-color-secondary);
}

/* ========================================
   CONTACT SECTION
   ======================================== */
.contact {
  padding: 5rem 2rem;
  background: var(--surface-color);
}

.contact-container {
  max-width: 800px;
  margin: 0 auto;
}

.contact-form {
  background: var(--bg-color);
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 10px 30px var(--shadow);
}

.form-group {
  margin-bottom: 2rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.form-control {
  width: 100%;
  padding: 1rem;
  background: var(--surface-color);
  border: 2px solid transparent;
  border-radius: 10px;
  color: var(--text-color);
  font-family: inherit;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-color-2);
}

textarea.form-control {
  resize: vertical;
  min-height: 150px;
}

.contact-info {
  margin-top: 3rem;
  text-align: center;
}

.contact-info h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-link:hover {
  color: var(--accent);
}

/* ========================================
   FOOTER
   ======================================== */
footer {
  background: var(--dark-surface);
  color: var(--text-primary);
  padding: 3rem 2rem;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.social-link {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-color-2);
  border-radius: 50%;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: var(--primary-gradient);
  color: white;
  transform: translateY(-5px);
}

.download-cv {
  margin: 2rem 0;
}

/* ========================================
   ANIMACIONES ON SCROLL
   ======================================== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

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

/* ========================================
   PARTICLES EFFECT
   ======================================== */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.3;
  animation: particle-float 20s infinite linear;
}

@keyframes particle-float {
  from {
    transform: translateY(100vh) translateX(0);
  }
  to {
    transform: translateY(-100px) translateX(100px);
  }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: var(--surface-color);
    flex-direction: column;
    justify-content: center;
    transition: right 0.3s ease;
  }

  .nav-menu.active {
    right: 0;
  }

  .menu-toggle {
    display: block;
    z-index: 1001;
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-image {
    order: -1;
  }

  .hero-image-wrapper {
    height: 300px;
  }

  .hero-buttons {
    justify-content: center;
  }

  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .testimonials-container {
    grid-template-columns: 1fr;
  }

  .contact-form {
    padding: 2rem;
  }
}

@media (max-width: 480px) {
  .hero-text h1 {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .skill-card {
    padding: 1.5rem;
  }

  .services-grid,
  .projects-grid {
    gap: 1.5rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
}
