/**
 * ITSOFT DZ - Services Page Styles
 * Modern animated design
 */

/* ============================================
   HERO SECTION (aligné sur about/contact/logiciels)
   ============================================ */

.services-hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  padding: calc(72px + 4rem) 0 4rem;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  overflow: hidden;
}

.services-hero .hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  opacity: 0.6;
  pointer-events: none;
}

.services-hero .hero-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 40%, rgba(0, 102, 204, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(0, 163, 224, 0.08) 0%, transparent 50%);
}

.services-hero .hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 102, 204, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 102, 204, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.services-hero .hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.services-hero .hero-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 102, 204, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0066CC;
  margin-bottom: 2rem;
}

.services-hero .hero-label i {
  font-size: 1rem;
}

.services-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  color: #0f172a;
  margin-bottom: 1.5rem;
}

.services-hero h1 .line {
  display: block;
}

.services-hero .hero-description {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: #334155;
  line-height: 1.7;
  max-width: 700px;
  margin: 0;
}

[data-theme="dark"] .services-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="dark"] .services-hero .hero-mesh {
  background:
    radial-gradient(circle at 30% 40%, rgba(0, 163, 224, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(0, 102, 204, 0.1) 0%, transparent 50%);
}

[data-theme="dark"] .services-hero .hero-grid {
  background-image:
    linear-gradient(rgba(0, 163, 224, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 163, 224, 0.05) 1px, transparent 1px);
}

[data-theme="dark"] .services-hero .hero-label {
  background: rgba(0, 102, 204, 0.2);
  color: #00A3E0;
}

[data-theme="dark"] .services-hero h1 {
  color: #f1f5f9;
}

[data-theme="dark"] .services-hero .hero-description {
  color: #cbd5e1;
}

/* ============================================
   SERVICES GRID WITH ANIMATED CARDS
   ============================================ */

.services-section {
  background: var(--bg-alt);
  padding: 6rem 0;
  position: relative;
}

/* Circuit pattern background */
.services-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(0, 102, 204, 0.03) 2px, transparent 2px),
    linear-gradient(90deg, rgba(0, 102, 204, 0.03) 2px, transparent 2px);
  background-size: 80px 80px;
  animation: circuitMove 40s linear infinite;
}

@keyframes circuitMove {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 80px 80px;
  }
}

.services-grid-full {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
  position: relative;
  z-index: 10;
}

@media (min-width: 768px) {
  .services-grid-full {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .services-grid-full {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================
   SERVICE CARD WITH HOVER ANIMATIONS
   ============================================ */

.service-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 2.5rem;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #0066CC, #00A3E0);
  transform: scaleX(0);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(transparent, rgba(0, 102, 204, 0.05));
  transition: bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
  border-color: #0066CC;
  box-shadow: 0 25px 50px rgba(0, 102, 204, 0.2);
  transform: translateY(-10px);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card:hover::after {
  bottom: 0;
}

.service-card .icon {
  width: 80px;
  height: 80px;
  background: rgba(0, 102, 204, 0.1);
  border: 1px solid rgba(0, 102, 204, 0.2);
  border-radius: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #0066CC;
  margin-bottom: 1.5rem;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.service-card .icon::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(0, 102, 204, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.5s;
  animation: iconGlow 2s ease-in-out infinite;
}

@keyframes iconGlow {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

.service-card:hover .icon {
  transform: rotateY(360deg) scale(1.1);
  background: linear-gradient(135deg, #0066CC, #00A3E0);
  color: white;
}

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-main);
  transition: color 0.3s;
}

.service-card:hover h3 {
  color: #0066CC;
}

.service-card .description {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.service-card .technologies {
  margin-bottom: 1.5rem;
}

.service-card .technologies-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.service-card .tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.service-card .tech-tag {
  background: rgba(0, 102, 204, 0.08);
  padding: 0.375rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  color: #0066CC;
  font-weight: 600;
  border: 1px solid rgba(0, 102, 204, 0.2);
  transition: all 0.3s;
}

[data-theme="dark"] .service-card .tech-tag {
  background: rgba(0, 102, 204, 0.12);
  border-color: rgba(0, 102, 204, 0.3);
  color: #00A3E0;
}

.service-card .tech-tag:hover {
  background: linear-gradient(135deg, #0066CC, #00A3E0);
  color: white;
  transform: translateY(-2px);
}

.service-card .benefits {
  margin-bottom: 1.5rem;
}

.service-card .benefits-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.service-card .benefits-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.service-card .benefits-list li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  position: relative;
  transition: all 0.3s;
}

.service-card .benefits-list li::before {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 0;
  color: #0066CC;
  font-size: 0.75rem;
  line-height: 1.9;
}

.service-card .benefits-list li:hover {
  color: #0066CC;
  transform: translateX(5px);
}

.service-card .cta {
  margin-top: auto;
}

.service-card .btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 0.9375rem;
  background: transparent;
  color: #0066CC;
  border: 2px solid #0066CC;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .service-card .btn {
  color: #00A3E0;
  border-color: rgba(0, 163, 224, 0.5);
}

.service-card .btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 102, 204, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.service-card .btn:hover::before {
  width: 300px;
  height: 300px;
}

.service-card .btn:hover {
  background: linear-gradient(135deg, #0066CC, #00A3E0);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 102, 204, 0.3);
}

/* ============================================
   FEATURED SERVICES WITH PARALLAX
   ============================================ */

.services-detail {
  background: var(--bg-alt);
  padding: 6rem 0;
}

.service-featured {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  overflow: hidden;
  margin-bottom: 3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.service-featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(at top left, rgba(0, 102, 204, 0.05), transparent 50%);
  opacity: 0;
  transition: opacity 0.5s;
}

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

.service-featured .content {
  padding: 3rem;
  position: relative;
  z-index: 10;
}

.service-featured .badge {
  display: inline-block;
  background: linear-gradient(135deg, #0066CC, #00A3E0);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
  animation: pulse 2s ease-in-out infinite;
}

.service-featured h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

.service-featured .description {
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 600px;
}

.service-featured .problem-box {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-left: 4px solid #f59e0b;
  padding: 1.5rem;
  border-radius: 1rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.service-featured .problem-box strong {
  display: block;
  color: #92400e;
  margin-bottom: 0.5rem;
}

.service-featured .problem-box p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

[data-theme="dark"] .service-featured .problem-box {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  border-left-color: #f59e0b;
}

[data-theme="dark"] .service-featured .problem-box strong {
  color: #fbbf24;
}

.service-featured .problem-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #f59e0b, #d97706);
}

.service-featured .features-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .service-featured .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.service-featured .feature-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.service-featured .feature-item .icon {
  width: 50px;
  height: 50px;
  background: rgba(0, 102, 204, 0.1);
  border: 1px solid rgba(0, 102, 204, 0.2);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #0066CC;
  transition: all 0.3s;
}

[data-theme="dark"] .service-featured .feature-item .icon {
  background: rgba(0, 102, 204, 0.15);
  border-color: rgba(0, 102, 204, 0.3);
  color: #00A3E0;
}
.service-featured .feature-item:hover .icon {
  transform: scale(1.1) rotate(-5deg);
  background: linear-gradient(135deg, #0066CC, #00A3E0);
  color: white;
}

.service-featured .feature-item .feature-text h4 {
  font-size: 1.0625rem;
  margin-bottom: 0.25rem;
  color: var(--text-main);
}
.service-featured .feature-item .feature-text p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0;
}

.service-featured .image {
  width: 100%;
  height: 400px;
  background: linear-gradient(135deg, rgba(0, 102, 204, 0.12) 0%, rgba(0, 163, 224, 0.12) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: #0066CC;
  position: relative;
  overflow: hidden;
}

.service-featured .image::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 102, 204, 0.15), transparent);
  animation: iconGlow 4s ease-in-out infinite;
}

@media (min-width: 768px) {
  .service-featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .service-featured.reverse {
    grid-template-columns: 1fr 1fr;
  }

  .service-featured.reverse .image {
    order: -1;
  }
}

/* ============================================
   PROCESS STEPS WITH ANIMATED ICONS
   ============================================ */

.process-section {
  background: var(--bg-alt);
  padding: 6rem 0;
  position: relative;
}

/* Subtle pattern background */
.process-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h4v-2h-4zM34 30v-4h-2v4h-4v2h4v4h4v-2h-4z'/%3E%3C/g%3E%3C/svg%3E");
}

.process-steps {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 3rem;
  position: relative;
  z-index: 10;
}

@media (min-width: 768px) {
  .process-steps {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Animated connecting line */
.process-steps::before {
  content: '';
  position: absolute;
  top: 32px;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  background: linear-gradient(90deg, #0066CC, #00A3E0, #0066CC);
  opacity: 0.3;
  z-index: 0;
}

@media (max-width: 767px) {
  .process-steps::before {
    display: none;
  }
}

.process-step {
  position: relative;
  z-index: 10;
  text-align: center;
}

.process-step .step-number {
  width: 64px;
  height: 64px;
  background: var(--bg);
  border: 3px solid #0066CC;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0066CC;
  margin: 0 auto 1.5rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.process-step .step-number::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 102, 204, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.4s;
  animation: stepPulse 2s ease-in-out infinite;
}

@keyframes stepPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

.process-step:hover .step-number {
  background: linear-gradient(135deg, #0066CC, #00A3E0);
  border-color: transparent;
  color: white;
  transform: scale(1.1);
}

.process-step h3 {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.process-step p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0;
}

/* ============================================
   CTA SECTION
   ============================================ */

.services-cta {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 6rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Animated stars background */
.services-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(2px 2px at 50px 160px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 90px 40px, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(2px 2px at 130px 80px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 160px 120px, rgba(255, 255, 255, 0.2), transparent);
  animation: starsFloat 15s linear infinite;
}

@keyframes starsFloat {
  0% {
    background-position: 0% 0%, 100% 0%;
  }
  100% {
    background-position: 0% 100%, 100% 100%;
  }
}

.services-cta h2 {
  color: white;
  margin-bottom: 1rem;
  position: relative;
  z-index: 10;
}

.services-cta p {
  color: rgba(255, 255, 255, 0.8);
  max-width: 600px;
  margin: 0 auto 2rem;
  position: relative;
  z-index: 10;
}

.services-cta .btn-primary {
  background: linear-gradient(135deg, #0066CC, #00A3E0);
  color: white;
  padding: 1.25rem 2.5rem;
  font-size: 1.125rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0, 102, 204, 0.4);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 10;
  overflow: hidden;
}

.services-cta .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;
}

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

.services-cta .btn-primary:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 35px rgba(0, 102, 204, 0.5);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 767px) {
  .services-hero {
    min-height: auto;
    padding: calc(64px + 3rem) 0 3rem;
  }

  .services-section,
  .services-detail,
  .process-section,
  .services-cta {
    padding: 4rem 0;
  }
  .services-grid-full {
    grid-template-columns: repeat(1, 1fr);
  }

  .service-featured {
    grid-template-columns: 1fr;
  }

  .service-featured .content {
    padding: 2rem;
  }

  .service-featured.reverse .image {
    order: unset;
  }

  .service-featured .image {
    height: 250px;
    font-size: 3rem;
  }

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

  .process-steps::before {
    display: none;
  }
}

/* ============================================
   DARK MODE STYLES
   ============================================ */

[data-theme="dark"] .services-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="dark"] .services-hero .hero-mesh {
  background:
    radial-gradient(circle at 30% 40%, rgba(0, 163, 224, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(0, 102, 204, 0.1) 0%, transparent 50%);
}

[data-theme="dark"] .services-hero .hero-grid {
  background-image:
    linear-gradient(rgba(0, 163, 224, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 163, 224, 0.05) 1px, transparent 1px);
}

[data-theme="dark"] .services-hero .hero-label {
  background: rgba(0, 102, 204, 0.2);
  color: #00A3E0;
}

[data-theme="dark"] .services-hero h1 {
  color: #f1f5f9;
}

[data-theme="dark"] .services-hero .hero-description {
  color: #cbd5e1;
}

/* Services cards */
[data-theme="dark"] .services-section::before {
  background-image:
    linear-gradient(rgba(0, 163, 224, 0.05) 2px, transparent 2px),
    linear-gradient(90deg, rgba(0, 163, 224, 0.05) 2px, transparent 2px);
}

[data-theme="dark"] .service-card {
  background: var(--bg-alt);
  border-color: var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .service-card:hover {
  border-color: #0066CC;
  box-shadow: 0 25px 50px rgba(0, 102, 204, 0.25);
}

[data-theme="dark"] .service-card .icon {
  background: rgba(0, 102, 204, 0.15);
  border-color: rgba(0, 102, 204, 0.3);
  color: #00A3E0;
}

[data-theme="dark"] .service-card:hover h3 {
  color: #00A3E0;
}

/* Featured / detail */
[data-theme="dark"] .services-detail {
  background: var(--bg);
}

[data-theme="dark"] .service-featured {
  background: var(--bg-alt);
  border-color: var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .service-featured .image {
  background: linear-gradient(135deg, rgba(0, 102, 204, 0.2) 0%, rgba(0, 163, 224, 0.12) 100%);
  color: #00A3E0;
}

/* Process */
[data-theme="dark"] .process-section::before {
  opacity: 0.06;
}

[data-theme="dark"] .process-step .step-number {
  background: var(--bg-alt);
  border-color: #00A3E0;
  color: #00A3E0;
}

/* CTA */
[data-theme="dark"] .services-cta {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0066CC 100%);
}
