/* ===== VARIABLES CSS ===== */
:root {
  --bg: #0b0b0f;
  --surface: #14141c;
  --surface-2: #101018;
  --surface-3: rgba(20, 20, 28, 0.95);
  --fg: #e9e9f1;
  --muted: #b7b7c6;
  --stroke: #222434;
  --brand1: #a06bff;
  --brand2: #ffb84d;
  --brand3: #f07cd9;
  --purple: #8a2be2;
  --gold: #daa520;
}

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

html, body {
  background: var(--bg) !important;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: var(--fg);
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Imagen de fondo global */
html::before,
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('/images/fondo.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  z-index: -2;
  opacity: 0.3;
  pointer-events: none;
}

/* Asegurar que todas las páginas tengan el fondo */
.home-container,
.vision-container,
.services-container,
.contacto-container,
.portfolio-container {
  position: relative;
  z-index: 3;
  min-height: 100vh;
}

/* Fondo específico para la home */
.home-container {
  background: var(--bg);
  position: relative;
}

.home-container::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('/images/fondo.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  z-index: -2;
  opacity: 0.3;
  pointer-events: none;
}

/* Fondo para otras páginas */
.vision-container,
.services-container,
.contacto-container,
.portfolio-container {
  background: var(--bg);
  position: relative;
}

.vision-container::before,
.services-container::before,
.contacto-container::before,
.portfolio-container::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('/images/fondo.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  z-index: -2;
  opacity: 0.3;
  pointer-events: none;
}

/* ===== CAPA DE CÁPSULAS ANIMADAS ===== */
.animated-capsules {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.capsule {
  position: absolute;
  padding: 8px 16px;
  background: rgba(138, 43, 226, 0.2);
  border: 1px solid rgba(218, 165, 32, 0.4);
  border-radius: 25px;
  color: rgba(218, 165, 32, 0.8);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  animation: floatCapsule 20s linear infinite;
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
  z-index: 2;
}

.capsule:nth-child(1) {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.capsule:nth-child(2) {
  top: 30%;
  right: 20%;
  animation-delay: -5s;
}

.capsule:nth-child(3) {
  top: 60%;
  left: 5%;
  animation-delay: -10s;
}

.capsule:nth-child(4) {
  top: 80%;
  right: 10%;
  animation-delay: -15s;
}

.capsule:nth-child(5) {
  top: 20%;
  left: 50%;
  animation-delay: -7s;
}

.capsule:nth-child(6) {
  top: 70%;
  right: 40%;
  animation-delay: -12s;
}

@keyframes floatCapsule {
  0% { 
    transform: translateY(0px) translateX(0px) scale(1); 
    opacity: 0.4; 
  }
  25% { 
    transform: translateY(-20px) translateX(10px) scale(1.1); 
    opacity: 0.7; 
  }
  50% { 
    transform: translateY(-10px) translateX(-5px) scale(0.9); 
    opacity: 0.5; 
  }
  75% { 
    transform: translateY(-30px) translateX(8px) scale(1.05); 
    opacity: 0.6; 
  }
  100% { 
    transform: translateY(0px) translateX(0px) scale(1); 
    opacity: 0.4; 
  }
}

/* ===== HEADER ===== */
.zc-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  transition: all 0.3s ease;
}

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

.zc-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.zc-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: white;
  transition: all 0.3s ease;
}

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

.zc-brand__logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.zc-brand__name {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.zc-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.zc-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.zc-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
  transition: left 0.5s;
}

.zc-link:hover::before {
  left: 100%;
}

.zc-link:hover {
  color: #d4af37;
  background: rgba(212, 175, 55, 0.1);
  transform: translateY(-2px);
}

.zc-link.active {
  color: #d4af37;
  background: rgba(212, 175, 55, 0.15);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

/* ===== CONTENIDO PRINCIPAL ===== */
main,
.site-main {
  position: relative;
  z-index: 10;
}

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

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(138, 43, 226, 0.2);
  border: 1px solid rgba(218, 165, 32, 0.4);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-size: 0.9rem;
  color: var(--gold);
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(138, 43, 226, 0.2);
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--fg);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.gradient-text {
  background: linear-gradient(135deg, var(--purple) 0%, var(--gold) 50%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.hero-subtitle {
  font-size: 1.3rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 3rem;
}

.hero-subtitle strong {
  color: var(--gold);
  font-weight: 600;
}

/* ===== SECCIONES GENERALES ===== */
section {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
  width: 100%;
  box-sizing: border-box;
}

/* Mejora de contraste para secciones */
.services-preview,
.technologies-section,
.why-choose-us,
.main-cta {
  background: var(--surface-3);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  margin: 2rem auto;
  padding: 4rem 2rem;
  backdrop-filter: blur(15px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-width: 1200px;
  width: calc(100% - 4rem);
  box-sizing: border-box;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--fg);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.section-header p {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== CARDS Y SERVICIOS ===== */
.services-carousel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.service-preview-card {
  background: rgba(16, 16, 24, 0.9);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 2.5rem;
  text-align: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(15px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.service-preview-card:hover {
  transform: translateY(-10px);
  border-color: rgba(218, 165, 32, 0.4);
  box-shadow: 0 20px 50px rgba(138, 43, 226, 0.3);
}

.service-preview-card h3 {
  font-size: 1.3rem;
  color: var(--fg);
  margin-bottom: 1rem;
  font-weight: 600;
}

.service-preview-card p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

/* ===== TECNOLOGÍAS ===== */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.tech-category {
  background: rgba(16, 16, 24, 0.9);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 2rem;
  backdrop-filter: blur(15px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.tech-category h3 {
  color: var(--gold);
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 600;
}

.tech-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tech-item {
  background: rgba(138, 43, 226, 0.2);
  color: var(--gold);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.9rem;
  border: 1px solid rgba(218, 165, 32, 0.3);
  transition: all 0.3s ease;
  font-weight: 500;
}

.tech-item:hover {
  background: rgba(218, 165, 32, 0.2);
  color: var(--purple);
  transform: scale(1.05);
}

/* ===== FEATURES ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: rgba(16, 16, 24, 0.9);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 2.5rem;
  text-align: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(15px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.feature-card:hover {
  transform: translateY(-8px);
  border-color: rgba(218, 165, 32, 0.4);
  box-shadow: 0 25px 50px rgba(138, 43, 226, 0.3);
}

.feature-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--gold) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: white;
  box-shadow: 0 0 30px rgba(138, 43, 226, 0.4);
}

.feature-card h3 {
  font-size: 1.4rem;
  color: var(--fg);
  margin-bottom: 1rem;
  font-weight: 600;
}

.feature-card p {
  color: var(--muted);
  line-height: 1.6;
}

/* ===== CTA SECTION ===== */
.main-cta {
  text-align: center;
  background: var(--surface-3);
  border: 2px solid rgba(138, 43, 226, 0.2);
}

.cta-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(138, 43, 226, 0.2);
  border: 1px solid rgba(218, 165, 32, 0.4);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  color: var(--gold);
  margin-bottom: 2rem;
}

.cta-features {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.cta-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
}

.cta-feature svg {
  color: var(--gold);
}

/* ===== BOTONES ===== */
.hero-buttons {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--purple) 0%, var(--gold) 100%);
  color: white;
  box-shadow: 0 0 30px rgba(138, 43, 226, 0.4);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

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

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 50px rgba(138, 43, 226, 0.6);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 10px rgba(138, 43, 226, 0.2);
}

.btn-secondary {
  background: transparent;
  color: var(--gold);
  border: 2px solid var(--gold);
  box-shadow: 0 0 20px rgba(218, 165, 32, 0.2);
}

.btn-secondary:hover {
  background: rgba(218, 165, 32, 0.1);
  color: var(--purple);
  border-color: var(--purple);
  transform: translateY(-3px);
  box-shadow: 0 20px 50px rgba(218, 165, 32, 0.4);
}

/* ===== CÓDIGO FLOTANTE ===== */
.floating-code {
  position: absolute;
  top: 35%;
  right: 5%;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(138, 43, 226, 0.4);
  border-radius: 15px;
  padding: 1.5rem;
  backdrop-filter: blur(15px);
  animation: float 6s ease-in-out infinite;
  z-index: 25;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.code-block {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.9rem;
}

.code-line {
  margin-bottom: 0.5rem;
}

.code-keyword { color: var(--purple); }
.code-variable { color: var(--gold); }
.code-string { color: #50c878; }
.code-function { color: #ff6b6b; }

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

/* ===== FOOTER ===== */
footer {
  position: relative;
  z-index: 50;
  background: rgba(11, 11, 15, 0.98);
  border-top: 1px solid var(--stroke);
  padding: 3rem 0 2rem;
  color: var(--muted);
  backdrop-filter: blur(15px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

footer .max-w-7xl {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

footer h3,
footer h4 {
  color: var(--fg);
  font-weight: 600;
  margin-bottom: 1rem;
}

footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--fg);
}

footer .text-center {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--stroke);
  margin-top: 2rem;
  color: rgba(185, 185, 195, 0.7);
}

/* ===== FORMULARIOS ===== */
input, textarea {
  font-family: inherit;
  outline: none;
}

input::placeholder, textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Spinner de carga */
.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== MENÚ MÓVIL ===== */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.mobile-menu-toggle span {
  width: 100%;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .services-preview,
  .technologies-section,
  .why-choose-us,
  .main-cta {
    width: calc(100% - 2rem);
    margin: 2rem 1rem;
  }
  
  .section-content {
    padding: 0 1rem;
  }
}

@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .floating-code {
    position: static;
    margin: 2rem auto 0;
    max-width: 400px;
  }
  
  .services-preview,
  .technologies-section,
  .why-choose-us,
  .main-cta {
    width: calc(100% - 2rem);
    margin: 2rem 1rem;
    padding: 3rem 1.5rem;
  }
  
  .services-carousel,
  .tech-grid,
  .features-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .zc-container {
    padding: 0 1rem;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .zc-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: right 0.3s ease;
    z-index: 1000;
    border-left: 1px solid rgba(218, 165, 32, 0.2);
  }
  
  .zc-nav.active {
    right: 0;
  }
  
  .zc-link {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    width: 100%;
    text-align: center;
    border-radius: 10px;
    margin: 0.5rem 0;
  }
  
  .zc-brand__name {
    font-size: 1.25rem;
  }
  
  .zc-brand__logo {
    width: 35px;
    height: 35px;
  }
  
  .hero-section {
    padding: 6rem 1rem 2rem;
  }
  
  section {
    padding: 3rem 1rem;
  }
  
  .services-preview,
  .technologies-section,
  .why-choose-us,
  .main-cta {
    width: calc(100% - 1rem);
    padding: 2rem 1rem;
    margin: 1rem 0.5rem;
  }
  
  .hero-buttons {
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  
  .hero-btn {
    width: 100%;
    max-width: 300px;
  }
  
  .cta-features {
    flex-direction: column;
    align-items: center;
  }
  
  .services-carousel,
  .tech-grid,
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .tech-items {
    justify-content: center;
  }
  
  .valor-card {
    margin: 0 auto;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .section-header h2 {
    font-size: 1.8rem;
  }
  
  .services-preview,
  .technologies-section,
  .why-choose-us,
  .main-cta {
    width: calc(100% - 0.5rem);
    margin: 1rem 0.25rem;
    padding: 1.5rem 0.75rem;
  }
  
  .zc-nav {
    gap: 0.25rem;
  }
  
  .zc-link {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }
}

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

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

.mb-4 {
  margin-bottom: 2rem;
}

.mt-4 {
  margin-top: 2rem;
}

/* ===== PARTÍCULAS ANIMADAS DORADAS ===== */
.floating-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, #d4af37 0%, transparent 70%);
  border-radius: 50%;
  animation: float 10s infinite ease-in-out;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

.particle:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; }
.particle:nth-child(2) { top: 70%; left: 80%; animation-delay: 2s; }
.particle:nth-child(3) { top: 50%; left: 40%; animation-delay: 4s; }
.particle:nth-child(4) { top: 20%; left: 70%; animation-delay: 6s; }
.particle:nth-child(5) { top: 80%; left: 15%; animation-delay: 8s; }

@keyframes float {
  0%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-20px) scale(1.3);
    opacity: 1;
  }
}