/**
 * Copyright (C) 2017-2026 Solution Libre
 *
 * Infrastructure Pages - Unified CSS
 * Design System: Industrial Refined Aesthetic
 *
 * Color Palette:
 * - Purple Primary: #7c3aed (Build focus)
 * - Teal Accent: #14b8a6 (Run focus)
 * - Problem Red: #ef4444
 * - Solution Teal: #14b8a6
 * - Slate tones for text hierarchy
 */

/* ============================================
   CSS VARIABLES - Infrastructure Theme
   ============================================ */
:root {
  --infra-purple-primary: #7c3aed;
  --infra-purple-dark: #6d28d9;
  --infra-purple-darker: #5b21b6;
  --infra-teal-accent: #14b8a6;
  --infra-teal-dark: #0d9488;
  --infra-slate-dark: #1e293b;
  --infra-slate-medium: #334155;
  --infra-slate-light: #cbd5e1;
  --infra-problem-red: #ef4444;
  --infra-solution-teal: #14b8a6;
}

/* ============================================
   THEME OVERRIDES - Infrastructure Pages
   ============================================ */
.page-section-heading {
  color: var(--infra-purple-primary) !important;
}

.divider-custom-line {
  background-color: var(--infra-purple-primary);
}

.divider-custom-icon {
  color: var(--infra-purple-primary);
}

.btn-primary {
  background-color: var(--infra-purple-primary) !important;
  border-color: var(--infra-purple-primary) !important;
}

.btn-primary:hover {
  background-color: var(--infra-purple-dark) !important;
  border-color: var(--infra-purple-dark) !important;
}

.text-primary {
  color: var(--infra-purple-primary) !important;
}

/* ============================================
   HERO SECTIONS - Diagonal Gradient
   ============================================ */
/* Extends base .hero-section from style.css with infrastructure-specific gradients */
.infrastructure-hero {
  background: linear-gradient(135deg, #1e293b 0%, #7c3aed 100%);
}

.build-hero {
  background: linear-gradient(135deg, #1e293b 0%, #7c3aed 100%);
}

.run-hero {
  background: linear-gradient(135deg, #1e293b 0%, #14b8a6 100%);
}

/* ============================================
   SECTION SPACING
   ============================================ */
.page-section.py-5 {
  padding-top: 3rem !important;
  padding-bottom: 3rem !important;
}

/* ============================================
   CONTRAST CARDS - Problem/Solution Pattern
   ============================================ */
.contrast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 0;
}

.contrast-card {
  background: white;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.contrast-card h3 {
  flex-shrink: 0;
}

.contrast-card p {
  flex: 1;
  display: flex;
  align-items: center;
}

.contrast-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  transition: height 0.4s ease;
}

.contrast-card.problem::before {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.contrast-card.solution::before {
  background: linear-gradient(90deg, var(--infra-teal-accent), #0d9488);
}

.contrast-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.contrast-card:hover::before {
  height: 6px;
}

.contrast-card-icon {
  width: 70px;
  height: 70px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  transition: transform 0.3s ease;
}

.contrast-card:hover .contrast-card-icon {
  transform: scale(1.1) rotate(5deg);
}

.contrast-card.problem .contrast-card-icon {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #dc2626;
}

.contrast-card.solution .contrast-card-icon {
  background: linear-gradient(135deg, #ccfbf1, #99f6e4);
  color: #0f766e;
}

.contrast-card h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--infra-slate-dark);
}

.contrast-card p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--infra-slate-medium);
  margin: 0;
}

/* Problem/Solution Row Alignment */
.problem-solution-row {
  display: flex;
  align-items: stretch;
}

.problem-solution-row .col-lg-6 {
  display: flex;
  flex-direction: column;
}

.problem-solution-row .contrast-card {
  flex: 1;
}

/* ============================================
   TECHNOLOGY SHOWCASE - Modern Cards
   ============================================ */
.tech-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0 0 0;
}

.tech-card-modern {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 2rem;
  position: relative;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  overflow: hidden;
}

.tech-card-modern::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 2px;
  background: linear-gradient(135deg, var(--infra-purple-primary), var(--infra-teal-accent));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.tech-card-modern:hover::before {
  opacity: 1;
}

.tech-card-modern:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(124, 58, 237, 0.15);
}

.tech-icon-modern {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--infra-purple-primary), var(--infra-purple-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
  transition: transform 0.3s ease;
}

.tech-card-modern:hover .tech-icon-modern {
  transform: rotate(-5deg) scale(1.05);
}

.tech-card-modern h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--infra-slate-dark);
}

.tech-problem-tag {
  display: inline-block;
  background: rgba(239, 68, 68, 0.15);
  border: 2px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.tech-solution-tag {
  display: inline-block;
  background: rgba(20, 184, 166, 0.15);
  border: 2px solid rgba(20, 184, 166, 0.3);
  color: #0f766e;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.75rem;
}

.tech-description {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--infra-slate-medium);
  margin: 0;
}

/* Build page tech details */
.tech-detail {
  margin-bottom: 1.2rem;
}

.tech-detail-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.tech-detail.problem .tech-detail-label {
  color: rgba(220, 38, 38, 0.75);
}

.tech-detail.solution .tech-detail-label {
  color: rgba(20, 184, 166, 0.75);
}

.tech-detail.problem {
  padding-left: 0.5rem;
  border-left: 2px solid rgba(220, 38, 38, 0.15);
}

.tech-detail.solution {
  padding-left: 0.5rem;
  border-left: 2px solid rgba(20, 184, 166, 0.15);
}

.tech-detail-text {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--infra-slate-medium);
}

/* ============================================
   PROCESS TIMELINE - Vertical Animated
   ============================================ */
.process-timeline {
  position: relative;
  max-width: 900px;
  margin: 2rem auto 0 auto;
}

.timeline-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
  opacity: 0;
  animation: slideInUp 0.6s ease forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline-number {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--infra-purple-primary), var(--infra-purple-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: white;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
  position: relative;
  z-index: 2;
}

.timeline-item:not(:last-child) .timeline-number::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 80px;
  background: linear-gradient(180deg, var(--infra-purple-primary), transparent);
}

.timeline-content {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border-left: 4px solid var(--infra-purple-primary);
}

.timeline-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--infra-slate-dark);
  margin-bottom: 0.8rem;
}

.timeline-content p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--infra-slate-medium);
  margin: 0;
}

/* Run page timeline */
.timeline-container {
  margin: 2rem auto;
  position: relative;
}

.timeline-step {
  position: relative;
  padding-left: 80px;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: slideIn 0.6s ease forwards;
}

.timeline-step:nth-child(1) { animation-delay: 0.1s; }
.timeline-step:nth-child(2) { animation-delay: 0.2s; }
.timeline-step:nth-child(3) { animation-delay: 0.3s; }
.timeline-step:nth-child(4) { animation-delay: 0.4s; }
.timeline-step:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.timeline-step .timeline-number {
  position: absolute;
  left: 0;
  width: 60px;
  height: 60px;
  font-size: 1.5rem;
}

.timeline-step:hover .timeline-content {
  transform: translateX(8px);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.15);
}

.timeline-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--infra-purple-primary);
  margin-bottom: 0.5rem;
}

.timeline-description {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--infra-slate-medium);
  margin: 0;
}

/* ============================================
   BENEFITS GRID
   ============================================ */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0 0 0;
}

.benefit-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: white;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.benefit-item:hover {
  background: #faf8ff;
  transform: translateX(8px);
}

.benefit-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--infra-purple-primary), var(--infra-purple-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.benefit-text {
  flex: 1;
}

.benefit-text h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--infra-slate-dark);
  margin-bottom: 0.3rem;
}

.benefit-text p {
  font-size: 0.95rem;
  color: var(--infra-slate-medium);
  margin: 0;
  line-height: 1.5;
}

.benefit-text strong {
  color: var(--infra-slate-dark);
  display: block;
  margin-bottom: 0.25rem;
}

/* ============================================
   DIFFERENTIATORS
   ============================================ */
.differentiator-modern {
  text-align: center;
  padding: 2rem 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
}

.differentiator-modern:hover {
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.15);
  transform: translateY(-4px);
}

.differentiator-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 1.2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--infra-purple-primary);
}

.differentiator-title {
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--infra-slate-dark);
  margin-bottom: 0.8rem;
}

.differentiator-text {
  font-size: 1rem;
  color: var(--infra-slate-medium);
  line-height: 1.6;
}

/* Run page differentiators */
.differentiators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0 0 0;
}

.diff-card {
  background: linear-gradient(135deg, #ffffff, #faf5ff);
  border: 2px solid rgba(124, 58, 237, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.diff-card:hover {
  border-color: var(--infra-purple-primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.15);
}

.diff-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--infra-purple-primary), var(--infra-purple-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  margin: 0 auto 1rem;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3);
}

.diff-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--infra-slate-dark);
  margin-bottom: 0.5rem;
}

.diff-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--infra-slate-medium);
  margin: 0;
}

/* ============================================
   SERVICE CARDS - Run Page
   ============================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin: 2rem 0 0 0;
}

.service-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, var(--infra-purple-primary), var(--infra-teal-accent));
  transition: width 0.4s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.15);
}

.service-card:hover::before {
  width: 8px;
}

.service-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.service-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--infra-purple-primary), var(--infra-purple-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3);
}

.service-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--infra-slate-dark);
  margin: 0;
}

.service-problem {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border-left: 3px solid var(--infra-problem-red);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.service-problem-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #dc2626;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.service-problem-text {
  font-size: 0.95rem;
  color: #991b1b;
  font-style: italic;
  margin: 0;
}

.service-solution {
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  border-left: 3px solid var(--infra-solution-teal);
  padding: 1rem;
  border-radius: 8px;
}

.service-solution-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0f766e;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.service-solution-text {
  font-size: 1rem;
  line-height: 1.7;
  color: #134e4a;
  margin: 0;
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta-section {
  background: linear-gradient(135deg, var(--infra-purple-darker) 0%, var(--infra-purple-primary) 100%);
  padding: 3.5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
  opacity: 0.4;
}

.cta-content {
  position: relative;
  z-index: 2;
}

.cta-section h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: white;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.cta-section p {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: rgba(255,255,255,0.9);
  margin-bottom: 2.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.btn-cta {
  background: white;
  color: var(--infra-purple-primary);
  border: none;
  padding: 1.2rem 3rem;
  font-size: 1.2rem;
  font-weight: 700;
  border-radius: 50px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.btn-cta:hover {
  background: #f0f9ff;
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
  color: var(--infra-purple-dark);
}

/* ============================================
   INFRASTRUCTURE MAIN PAGE - Timeline
   ============================================ */
.infrastructure-timeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  margin: 3rem 0;
}

.timeline-phase {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.timeline-phase:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.15);
}

.phase-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--infra-purple-primary);
  padding-bottom: 1rem;
}

.phase-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.build-icon {
  background: linear-gradient(135deg, var(--infra-purple-primary), var(--infra-purple-dark));
}

.run-icon {
  background: linear-gradient(135deg, var(--infra-teal-accent), #0d9488);
}

.phase-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--infra-purple-primary);
  margin: 0;
}

.phase-subtitle {
  font-size: 1rem;
  color: var(--infra-slate-medium);
  margin: 0;
  font-style: italic;
}

.phase-description,
.phase-solution {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--infra-slate-medium);
  margin-bottom: 1rem;
}

.phase-solution {
  color: var(--infra-slate-dark);
  font-weight: 500;
}

.technologies-build,
.technologies-run {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.tech-badge {
  background: linear-gradient(135deg, var(--infra-purple-primary), var(--infra-purple-dark));
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.technologies-run .tech-badge {
  background: linear-gradient(135deg, var(--infra-teal-accent), #0d9488);
  color: white;
}

.timeline-transition {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.transition-arrow {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--infra-purple-primary), var(--infra-teal-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.transition-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--infra-purple-primary);
  background: rgba(124, 58, 237, 0.1);
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
  .infrastructure-hero,
  .build-hero,
  .run-hero {
    min-height: 35vh;
    padding: 110px 0 30px;
  }

  .contrast-grid,
  .tech-showcase,
  .services-grid,
  .benefits-grid,
  .differentiators-grid {
    grid-template-columns: 1fr;
  }

  .problem-solution-row {
    flex-direction: column;
  }

  .timeline-item {
    grid-template-columns: 60px 1fr;
    gap: 1rem;
  }

  .timeline-number {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .timeline-item:not(:last-child) .timeline-number::after {
    height: 70px;
  }

  .page-section.py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .infrastructure-timeline {
    gap: 2rem;
  }

  .timeline-transition {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }

  .transition-arrow {
    transform: rotate(90deg);
  }
}
