/* ============================================================
   CREO — AI Solutions How We Work Section
   BEM: Prefijo aiow- (AI Our Work)
   Adaptado del diseño original con 6 pasos
   ============================================================ */

.aiow-section {
  position: relative;
  background: var(--creo-navy, #0b173d);
  padding: 120px 0;
  overflow: hidden;
  color: var(--creo-light, #efe5cf);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.aiow-section.aiow-visible {
  opacity: 1;
}

.aiow-section .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 10;
}

/* Neural Network Background */
.aiow-neural {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.03;
  pointer-events: none;
}

.aiow-neural line,
.aiow-neural circle {
  stroke: var(--creo-light, #efe5cf);
}

/* Header */
.aiow-header {
  text-align: center;
  margin-bottom: 100px;
  opacity: 0;
  transform: translateY(-30px);
  transition: all 0.8s ease;
}

.aiow-section.aiow-visible .aiow-header {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}

.aiow-label {
  font-family: var(--font-body, 'Roboto', sans-serif);
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--creo-accent, #FF6A00);
  margin-bottom: 20px;
  font-weight: 500;
}

.aiow-title {
  font-family: var(--font-display, 'Montecatini', system-ui, serif);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  color: var(--creo-light, #efe5cf);
  margin-bottom: 24px;
  line-height: 1.1;
}

.aiow-subtitle {
  font-family: var(--font-body, 'Roboto', sans-serif);
  font-size: 1.25rem;
  color: var(--creo-light, #efe5cf);
  opacity: 0.7;
  max-width: 700px;
  margin: 0 auto;
  font-weight: 300;
  line-height: 1.6;
}

/* Process Container - 6 Cards Grid */
.aiow-container {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 80px;
}

@media (max-width: 1024px) {
  .aiow-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }
}

@media (max-width: 768px) {
  .aiow-section {
    padding: 80px 0;
  }

  .aiow-section .container {
    padding: 0 24px;
  }

  .aiow-container {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .aiow-title {
    font-size: 2.25rem;
  }

  .aiow-subtitle {
    font-size: 1rem;
  }
}

/* Step Card */
.aiow-card {
  position: relative;
  background: rgba(8, 16, 42, 0.5);
  border: 1px solid rgba(239, 229, 207, 0.1);
  border-radius: 24px;
  padding: 48px 36px;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: translateY(50px) scale(0.9) rotateX(10deg);
}

.aiow-section.aiow-visible .aiow-card {
  animation: aiowCardEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.aiow-card:nth-child(1) { animation-delay: 0.2s; }
.aiow-card:nth-child(2) { animation-delay: 0.35s; }
.aiow-card:nth-child(3) { animation-delay: 0.5s; }
.aiow-card:nth-child(4) { animation-delay: 0.65s; }
.aiow-card:nth-child(5) { animation-delay: 0.8s; }
.aiow-card:nth-child(6) { animation-delay: 0.95s; }

@keyframes aiowCardEntrance {
  0% {
    opacity: 0;
    transform: translateY(50px) scale(0.9) rotateX(10deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0deg);
  }
}

.aiow-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 106, 0, 0.05), rgba(255, 106, 0, 0));
  opacity: 0;
  transition: opacity 0.5s ease;
}

.aiow-card:hover::before,
.aiow-card.aiow-active::before {
  opacity: 1;
}

.aiow-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 106, 0, 0.3);
  box-shadow: 0 20px 60px rgba(255, 106, 0, 0.15);
}

.aiow-card.aiow-active {
  border-color: var(--creo-accent, #FF6A00);
  box-shadow: 0 0 40px rgba(255, 106, 0, 0.3);
}

/* Glow Effect */
.aiow-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 106, 0, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.aiow-card:hover .aiow-glow {
  opacity: 1;
}

/* Step Number */
.aiow-number {
  position: absolute;
  top: -20px;
  right: 30px;
  font-family: var(--font-display, 'Montecatini', system-ui, serif);
  font-size: 120px;
  font-weight: 800;
  color: var(--creo-accent, #FF6A00);
  opacity: 0.08;
  line-height: 1;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.aiow-card:hover .aiow-number {
  opacity: 0.15;
}

@media (max-width: 768px) {
  .aiow-number {
    font-size: 80px;
  }
}

/* Icon Container */
.aiow-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(255, 106, 0, 0.2), rgba(255, 106, 0, 0.05));
  border: 2px solid rgba(255, 106, 0, 0.3);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.aiow-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 106, 0, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

.aiow-card:hover .aiow-icon::before {
  width: 100px;
  height: 100px;
}

.aiow-icon svg {
  width: 32px;
  height: 32px;
  position: relative;
  z-index: 2;
  stroke: var(--creo-accent, #FF6A00);
}

/* Step Content */
.aiow-ctitle {
  font-family: var(--font-display, 'Montecatini', system-ui, serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--creo-light, #efe5cf);
  margin-bottom: 12px;
  line-height: 1.3;
}

.aiow-desc {
  font-family: var(--font-body, 'Roboto', sans-serif);
  font-size: 15px;
  color: var(--creo-light, #efe5cf);
  opacity: 0.7;
  line-height: 1.7;
  margin-bottom: 24px;
}

/* Timeline Tag */
.aiow-timeline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 106, 0, 0.1);
  border: 1px solid rgba(255, 106, 0, 0.2);
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font-body, 'Roboto', sans-serif);
  font-size: 13px;
  color: var(--creo-accent, #FF6A00);
  font-weight: 500;
  margin-bottom: 16px;
}

.aiow-timeline svg {
  width: 14px;
  height: 14px;
  stroke: var(--creo-accent, #FF6A00);
}

/* Tools */
.aiow-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.aiow-tool {
  background: rgba(239, 229, 207, 0.08);
  border: 1px solid rgba(239, 229, 207, 0.15);
  padding: 6px 12px;
  border-radius: 12px;
  font-family: var(--font-body, 'Roboto', sans-serif);
  font-size: 12px;
  color: var(--creo-light, #efe5cf);
  font-weight: 400;
  transition: all 0.3s ease;
}

.aiow-card:hover .aiow-tool {
  background: rgba(255, 106, 0, 0.1);
  border-color: rgba(255, 106, 0, 0.3);
}

/* Bottom Border Effect */
.aiow-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--creo-accent, #FF6A00), transparent);
  transform: scaleX(0);
  transition: transform 0.5s ease;
}

.aiow-card:hover::after {
  transform: scaleX(1);
}

/* Floating Particles */
.aiow-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--creo-accent, #FF6A00);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.aiow-section.aiow-visible .aiow-particle {
  animation: aiowFloat 8s ease-in-out infinite, aiowParticleIn 1.5s ease-out forwards;
  box-shadow: 0 0 10px var(--creo-accent, #FF6A00);
}

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

@keyframes aiowFloat {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 0.5;
  }
  50% {
    transform: translateY(-100px) translateX(50px);
    opacity: 0.3;
  }
  90% {
    opacity: 0.5;
  }
}

.aiow-particle:nth-child(1) { top: 10%; left: 15%; animation-delay: 0.5s; }
.aiow-particle:nth-child(2) { top: 30%; left: 85%; animation-delay: 0.8s; }
.aiow-particle:nth-child(3) { top: 60%; left: 10%; animation-delay: 1.1s; }
.aiow-particle:nth-child(4) { top: 80%; left: 70%; animation-delay: 1.4s; }
.aiow-particle:nth-child(5) { top: 25%; left: 50%; animation-delay: 0.6s; }
.aiow-particle:nth-child(6) { top: 70%; left: 40%; animation-delay: 1.2s; }

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .aiow-section,
  .aiow-card,
  .aiow-particle {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
