{% extends "core/base.html" %}
{% load static %}

{% block title %}SERVICES // NEURAL SYNC{% endblock %}

{% block extra_css %}
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;400;600;700&family=Share+Tech+Mono&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">

<style>
:root {
  --cyber-black: #0a0a0f;
  --cyber-yellow: #fcee0a;
  --cyber-cyan: #00f3ff;
  --cyber-red: #ff003c;
  --cyber-purple: #b026ff;
  --cyber-dark: #151520;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  background: var(--cyber-black);
  color: #ffffff;
  font-family: 'Rajdhani', sans-serif;
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

/* ANIMATED GRID BACKGROUND */
.cyber-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  background: 
    linear-gradient(0deg, transparent 24%, rgba(0, 243, 255, 0.05) 25%, rgba(0, 243, 255, 0.05) 26%, transparent 27%, transparent 74%, rgba(0, 243, 255, 0.05) 75%, rgba(0, 243, 255, 0.05) 76%, transparent 77%, transparent),
    linear-gradient(90deg, transparent 24%, rgba(0, 243, 255, 0.05) 25%, rgba(0, 243, 255, 0.05) 26%, transparent 27%, transparent 74%, rgba(0, 243, 255, 0.05) 75%, rgba(0, 243, 255, 0.05) 76%, transparent 77%, transparent);
  background-size: 50px 50px;
  animation: gridPulse 4s ease-in-out infinite;
  pointer-events: none;
}

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

/* CRT SCANLINES OVERLAY */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  animation: scanlineMove 8s linear infinite;
}

@keyframes scanlineMove {
  0% { transform: translateY(0); }
  100% { transform: translateY(100px); }
}

/* MAIN CONTENT WRAPPER */
.content-wrapper {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: 2rem 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.container-fluid {
  width: 100%;
  max-width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

/* ============================================
   SYSTEM OVERRIDE HEADER - UPGRADED
   ============================================ */
.system-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 1rem 1.5rem;
  border: 3px solid var(--cyber-cyan);
  background: 
    linear-gradient(135deg, rgba(0, 243, 255, 0.03) 0%, rgba(176, 38, 255, 0.03) 100%),
    rgba(0, 243, 255, 0.05);
  clip-path: polygon(
    20px 0, calc(100% - 20px) 0, 
    100% 20px, 100% calc(100% - 20px), 
    calc(100% - 20px) 100%, 20px 100%, 
    0 calc(100% - 20px), 0 20px
  );
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-shadow: 
    inset 0 0 30px rgba(0, 243, 255, 0.1),
    0 0 40px rgba(0, 243, 255, 0.2);
}

/* Double frame corners */
.system-header::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  border: 1px solid rgba(0, 243, 255, 0.3);
  clip-path: polygon(
    15px 0, calc(100% - 15px) 0, 
    100% 15px, 100% calc(100% - 15px), 
    calc(100% - 15px) 100%, 15px 100%, 
    0 calc(100% - 15px), 0 15px
  );
  pointer-events: none;
}

/* Access label */
.system-header::after {
  content: '// ACCESS GRANTED //';
  position: absolute;
  top: 8px;
  left: 15px;
  font-size: 9px;
  color: var(--cyber-cyan);
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  letter-spacing: 1px;
  animation: blink 2s infinite;
}

.main-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 900;
  color: var(--cyber-yellow);
  text-transform: uppercase;
  letter-spacing: clamp(2px, 1vw, 6px);
  margin: 0 0 1.5rem 0;
  text-shadow: 
    0 0 10px var(--cyber-yellow),
    0 0 20px var(--cyber-yellow);
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.main-title.glitch-active {
  animation: glitch 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}

@keyframes glitch {
  0% { 
    text-shadow: 
      2px 0 var(--cyber-red), 
      -2px 0 var(--cyber-cyan),
      0 0 10px var(--cyber-yellow); 
  }
  25% { 
    text-shadow: 
      -2px 0 var(--cyber-red), 
      2px 0 var(--cyber-cyan),
      0 0 20px var(--cyber-yellow); 
  }
  50% { 
    text-shadow: 
      2px 0 var(--cyber-cyan), 
      -2px 0 var(--cyber-red),
      0 0 30px var(--cyber-yellow); 
  }
  75% { 
    text-shadow: 
      -2px 0 var(--cyber-cyan), 
      2px 0 var(--cyber-red),
      0 0 20px var(--cyber-yellow); 
  }
  100% { 
    text-shadow: 
      2px 0 var(--cyber-red), 
      -2px 0 var(--cyber-cyan),
      0 0 10px var(--cyber-yellow); 
  }
}

.terminal-subtitle {
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  color: var(--cyber-cyan);
  font-size: clamp(0.7rem, 2vw, 1rem);
  letter-spacing: 1px;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* STATUS BAR - NEW */
.status-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  flex-wrap: wrap;
  padding: 0.8rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(0, 243, 255, 0.3);
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  font-size: clamp(0.6rem, 1.5vw, 0.75rem);
  letter-spacing: 1px;
  margin-top: 1rem;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--cyber-cyan);
}

.status-indicator {
  width: 6px;
  height: 6px;
  background: var(--cyber-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--cyber-cyan);
  animation: pulse 2s infinite;
}

.status-indicator.warning {
  background: var(--cyber-yellow);
  box-shadow: 0 0 8px var(--cyber-yellow);
}

.status-value {
  color: var(--cyber-yellow);
  font-weight: bold;
}

@keyframes blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0.5; }
}

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

/* ============================================
   SERVICE CARDS - UPGRADED WITH TEXTURE
   ============================================ */
.services-grid {
  margin-bottom: 4rem;
  width: 100%;
}

.row {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 1rem;
  display: flex;
  flex-wrap: wrap;
  margin-top: calc(-1 * var(--bs-gutter-y));
  margin-right: calc(-0.5 * var(--bs-gutter-x));
  margin-left: calc(-0.5 * var(--bs-gutter-x));
}

.row > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  margin-top: var(--bs-gutter-y);
}

.service-card {
  background: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 243, 255, 0.03) 2px,
      rgba(0, 243, 255, 0.03) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(0, 243, 255, 0.03) 2px,
      rgba(0, 243, 255, 0.03) 4px
    ),
    var(--cyber-dark);
  border: 2px solid var(--cyber-cyan);
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 15px 100%, 0 calc(100% - 15px));
  padding: 1.5rem 1rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
  display: block;
  color: inherit;
  width: 100%;
  max-width: 100%;
}

.service-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--cyber-cyan), var(--cyber-purple), var(--cyber-yellow));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}

/* Serial number - NEW */
.service-serial {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  font-size: 0.65rem;
  color: rgba(0, 243, 255, 0.4);
  letter-spacing: 0.5px;
}

.service-icon-wrapper {
  text-align: center;
  margin-bottom: 1rem;
  position: relative;
}

.service-icon {
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  color: var(--cyber-cyan);
  transition: all 0.3s;
  text-shadow: 0 0 15px var(--cyber-cyan);
  display: inline-block;
}

.service-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.service-description {
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  line-height: 1.6;
  opacity: 0.9;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* DATA NODE INDICATOR */
.node-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--cyber-cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--cyber-cyan);
  animation: pulse 2s infinite;
}

/* ============================================
   WORKFLOW SECTION - CIRCUIT BOARD STYLE
   ============================================ */
.workflow-section {
  padding: 3rem 0;
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.workflow-header {
  text-align: center;
  margin-bottom: 3rem;
}

.workflow-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 900;
  color: var(--cyber-yellow);
  text-transform: uppercase;
  letter-spacing: clamp(1px, 1vw, 3px);
  text-shadow: 0 0 15px var(--cyber-yellow);
  display: inline-block;
  padding: 1rem 1.5rem;
  border: 2px solid var(--cyber-yellow);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  position: relative;
  background: rgba(252, 238, 10, 0.05);
}

.workflow-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyber-yellow), transparent);
}

/* TIMELINE - MOBILE (VERTICAL) */
.timeline-container {
  position: relative;
  padding-left: 2.5rem;
  width: 100%;
  max-width: 100%;
}

.timeline-container::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, 
    var(--cyber-cyan) 0%, 
    var(--cyber-purple) 50%, 
    var(--cyber-yellow) 100%
  );
  box-shadow: 0 0 15px var(--cyber-cyan);
}

/* Animated data flow - NEW */
.timeline-container::after {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  width: 3px;
  height: 40px;
  background: linear-gradient(180deg, 
    transparent 0%,
    var(--cyber-yellow) 50%,
    transparent 100%
  );
  box-shadow: 0 0 20px var(--cyber-yellow);
  animation: dataFlow 3s linear infinite;
}

@keyframes dataFlow {
  0% { top: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  padding: 1.5rem 1rem;
  background: 
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(0, 243, 255, 0.02) 10px,
      rgba(0, 243, 255, 0.02) 20px
    ),
    var(--cyber-dark);
  border: 2px solid var(--cyber-cyan);
  border-left: 3px solid var(--cyber-yellow);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  transition: all 0.3s ease;
  width: 100%;
  max-width: 100%;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.5rem;
  top: 1.5rem;
  width: 12px;
  height: 12px;
  background: var(--cyber-yellow);
  border: 2px solid var(--cyber-cyan);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--cyber-yellow);
  z-index: 1;
}

.step-number {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 900;
  color: var(--cyber-yellow);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 12px var(--cyber-yellow);
}

.step-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(45px, 10vw, 60px);
  height: clamp(45px, 10vw, 60px);
  background: rgba(0, 243, 255, 0.1);
  border: 2px solid var(--cyber-cyan);
  clip-path: polygon(
    30% 0%, 70% 0%, 100% 30%, 
    100% 70%, 70% 100%, 30% 100%, 
    0% 70%, 0% 30%
  );
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

/* Rotating border effect */
.step-icon-wrapper::before {
  content: '';
  position: absolute;
  inset: -3px;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--cyber-cyan) 90deg,
    transparent 180deg
  );
  animation: rotateBorder 4s linear infinite;
  opacity: 0;
  transition: opacity 0.3s;
}

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

.step-icon {
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  color: var(--cyber-cyan);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.step-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1rem, 3vw, 1.3rem);
  font-weight: 700;
  color: var(--cyber-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.8rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.step-description {
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* GLITCH TEXT EFFECT */
.glitch-text {
  position: relative;
  display: inline-block;
}

.glitch-text:hover::before,
.glitch-text:hover::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch-text:hover::before {
  animation: glitchTop 0.3s infinite;
  color: var(--cyber-red);
  z-index: -1;
}

.glitch-text:hover::after {
  animation: glitchBottom 0.3s infinite;
  color: var(--cyber-cyan);
  z-index: -2;
}

@keyframes glitchTop {
  0% { clip-path: inset(40% 0 20% 0); transform: translate(-2px, -2px); }
  50% { clip-path: inset(60% 0 0% 0); transform: translate(2px, 2px); }
  100% { clip-path: inset(20% 0 60% 0); transform: translate(-2px, 2px); }
}

@keyframes glitchBottom {
  0% { clip-path: inset(0% 0 60% 0); transform: translate(2px, 2px); }
  50% { clip-path: inset(20% 0 40% 0); transform: translate(-2px, -2px); }
  100% { clip-path: inset(60% 0 20% 0); transform: translate(2px, -2px); }
}

/* RGB Glitch effect for icons */
@keyframes rgbGlitch {
  0% { 
    text-shadow: 
      0 0 15px var(--cyber-cyan);
  }
  20% {
    text-shadow: 
      -3px 0 var(--cyber-red),
      3px 0 var(--cyber-cyan),
      0 0 15px var(--cyber-cyan);
  }
  40% {
    text-shadow: 
      3px 0 var(--cyber-red),
      -3px 0 var(--cyber-cyan),
      0 0 15px var(--cyber-cyan);
  }
  60% {
    text-shadow: 
      -3px 0 var(--cyber-cyan),
      3px 0 var(--cyber-red),
      0 0 15px var(--cyber-cyan);
  }
  80% {
    text-shadow: 
      3px 0 var(--cyber-cyan),
      -3px 0 var(--cyber-red),
      0 0 15px var(--cyber-cyan);
  }
  100% { 
    text-shadow: 
      0 0 15px var(--cyber-cyan);
  }
}

/* ============================================
   TABLET (≥ 576px)
   ============================================ */
@media (min-width: 576px) {
  .content-wrapper {
    padding: 3rem 0;
  }

  .container-fluid {
    padding-right: 20px;
    padding-left: 20px;
  }

  .system-header {
    padding: 2.5rem 1.5rem 1.8rem;
    margin-bottom: 4rem;
  }

  .system-header::after {
    font-size: 10px;
    left: 20px;
    top: 10px;
  }

  .terminal-subtitle {
    margin-top: 1.2rem;
  }

  .service-card {
    padding: 2rem 1.5rem;
  }

  .service-serial {
    font-size: 0.7rem;
    bottom: 10px;
    right: 12px;
  }

  .timeline-container {
    padding-left: 3rem;
  }

  .timeline-container::before {
    left: 15px;
  }

  .timeline-container::after {
    left: 15px;
  }

  .timeline-item {
    padding: 1.8rem 1.3rem;
    margin-bottom: 3rem;
  }

  .timeline-item::before {
    left: -3rem;
    width: 15px;
    height: 15px;
  }

  .step-icon-wrapper {
    width: 65px;
    height: 65px;
  }
}

/* ============================================
   TABLET LARGE (≥ 768px)
   ============================================ */
@media (min-width: 768px) {
  .content-wrapper {
    padding: 4rem 0;
  }

  .container-fluid {
    max-width: 1320px;
  }

  .row {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
  }

  .col-md-6 {
    flex: 0 0 auto;
    width: 50%;
  }

  .system-header::after {
    content: '// SYSTEM ACCESS GRANTED //';
    font-size: 11px;
    letter-spacing: 1.5px;
  }

  .service-card {
    padding: 2.5rem 2rem;
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
    border: 3px solid var(--cyber-cyan);
  }

  .timeline-container {
    padding-left: 3.5rem;
  }

  .timeline-container::before {
    width: 4px;
    left: 18px;
  }

  .timeline-container::after {
    width: 4px;
    left: 18px;
  }

  .timeline-item {
    padding: 2rem 1.5rem;
  }

  .timeline-item::before {
    left: -3.5rem;
    width: 18px;
    height: 18px;
  }

  .step-icon-wrapper {
    width: 70px;
    height: 70px;
    border: 3px solid var(--cyber-cyan);
  }
}

/* ============================================
   DESKTOP (≥ 992px)
   ============================================ */
@media (min-width: 992px) {
  .content-wrapper {
    padding: 5rem 0;
  }

  .row {
    --bs-gutter-x: 2rem;
    --bs-gutter-y: 2rem;
  }

  .col-lg-4 {
    flex: 0 0 auto;
    width: 33.333333%;
  }

  .system-header {
    padding: 3rem 2.5rem 2rem;
    margin-bottom: 5rem;
    clip-path: polygon(
      30px 0, calc(100% - 30px) 0, 
      100% 30px, 100% calc(100% - 30px), 
      calc(100% - 30px) 100%, 30px 100%, 
      0 calc(100% - 30px), 0 30px
    );
  }

  .system-header::before {
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .system-header::after {
    content: '// MILITECH NEURAL SYNC ACCESS GRANTED //';
    font-size: 12px;
    letter-spacing: 2px;
    left: 25px;
    top: 12px;
  }

  .status-bar {
    font-size: 0.8rem;
  }

  .status-indicator {
    width: 8px;
    height: 8px;
  }

  /* SERVICE CARDS - DESKTOP HOVER EFFECTS */
  .service-card {
    padding: 2.5rem 2rem;
    clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 30px 100%, 0 calc(100% - 30px));
  }

  .service-card:hover {
    background: var(--cyber-yellow);
    color: var(--cyber-black);
    border-color: var(--cyber-yellow);
    transform: translateY(-10px);
    box-shadow: 
      0 0 40px rgba(252, 238, 10, 0.6),
      0 20px 50px rgba(252, 238, 10, 0.3),
      inset 0 0 30px rgba(252, 238, 10, 0.2);
  }

  .service-card:hover::before {
    opacity: 1;
    animation: borderRotate 2s linear infinite;
  }

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

  .service-card:hover .service-icon {
    color: var(--cyber-black);
    animation: rgbGlitch 0.5s infinite, iconShake 0.3s infinite;
  }

  @keyframes iconShake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-2px, 2px) rotate(-2deg); }
    50% { transform: translate(2px, -2px) rotate(2deg); }
    75% { transform: translate(-2px, -2px) rotate(-1deg); }
  }

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

  .service-card:hover .service-serial {
    color: rgba(10, 10, 15, 0.6);
  }

  .service-serial {
    font-size: 0.75rem;
  }

  .node-indicator {
    width: 10px;
    height: 10px;
  }

  .workflow-section {
    padding: 4rem 0;
  }

  /* TIMELINE HORIZONTALE DESKTOP */
  .timeline-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-left: 0;
    padding-top: 4rem;
    gap: 1.5rem;
  }

  .timeline-container::before {
    left: 0;
    top: 2.5rem;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, 
      var(--cyber-cyan) 0%, 
      var(--cyber-purple) 50%, 
      var(--cyber-yellow) 100%
    );
  }

  .timeline-container::after {
    left: 0;
    top: 2.5rem;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, 
      transparent 0%,
      var(--cyber-yellow) 50%,
      transparent 100%
    );
    animation: dataFlowHorizontal 3s linear infinite;
  }

  @keyframes dataFlowHorizontal {
    0% { left: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
  }

  .timeline-item {
    flex: 1;
    margin: 0;
    margin-bottom: 0;
    padding: 2rem 1.5rem;
    border-left: 2px solid var(--cyber-cyan);
    border-top: 4px solid var(--cyber-yellow);
    clip-path: polygon(
      0 0,
      100% 0,
      100% calc(100% - 20px),
      calc(100% - 20px) 100%,
      0 100%
    );
  }

  .timeline-item::before {
    left: 50%;
    top: -4rem;
    transform: translateX(-50%);
    width: 25px;
    height: 25px;
    border: 3px solid var(--cyber-cyan);
  }

  .timeline-item:hover {
    border-color: var(--cyber-yellow);
    transform: translateY(-15px);
    box-shadow: 
      0 15px 40px rgba(252, 238, 10, 0.25),
      0 0 30px rgba(0, 243, 255, 0.2);
  }

  .timeline-item:hover .step-icon-wrapper::before {
    opacity: 1;
  }

  .timeline-item:hover .step-icon {
    color: var(--cyber-yellow);
    transform: scale(1.15);
  }

  .step-icon-wrapper {
    width: 80px;
    height: 80px;
  }
}

/* LARGE DESKTOP (≥ 1200px) */
@media (min-width: 1200px) {
  .container-fluid {
    max-width: 1400px;
  }

  .timeline-container {
    gap: 2rem;
  }

  .timeline-item {
    padding: 2.5rem 2rem;
  }

  .step-icon-wrapper {
    width: 90px;
    height: 90px;
  }
}
</style>
{% endblock %}

{% block content %}
<!-- ANIMATED BACKGROUND -->
<div class="cyber-bg"></div>
<div class="scanlines"></div>

<!-- MAIN CONTENT -->
<div class="content-wrapper">
  <div class="container-fluid">
    
    <!-- SYSTEM OVERRIDE HEADER -->
    <div class="system-header">
      <h1 class="main-title glitch-text" data-text="SERVICES">SERVICES</h1>
      <p class="terminal-subtitle">&gt; NETRUNNER INTERFACE // SELECT PROTOCOL_</p>
      
      <!-- STATUS BAR - NEW -->
      <div class="status-bar">
        <div class="status-item">
          <span class="status-indicator"></span>
          <span>[MEM: <span class="status-value">OK</span>]</span>
        </div>
        <div class="status-item">
          <span class="status-indicator warning"></span>
          <span>[SYNC: <span class="status-value">98%</span>]</span>
        </div>
        <div class="status-item">
          <span class="status-indicator"></span>
          <span>[<span class="status-value">SECURE</span>]</span>
        </div>
        <div class="status-item">
          <span class="status-indicator"></span>
          <span>[LATENCY: <span class="status-value">12ms</span>]</span>
        </div>
      </div>
    </div>

    <!-- SERVICES GRID -->
    <div class="services-grid">
      <div class="row">
        {% for service in services %}
        <div class="col-12 col-md-6 col-lg-4">
          <a href="{% url 'services:detail' service.slug %}" class="service-card">
            <div class="node-indicator"></div>
            
            <!-- SERIAL NUMBER - NEW -->
            <div class="service-serial">SER-0{{ forloop.counter }}</div>
            
            <div class="service-icon-wrapper">
              <i class="{{ service.icon_class }} service-icon"></i>
            </div>
            
            <h3 class="service-title">{{ service.title }}</h3>
            <p class="service-description">{{ service.short_description }}</p>
          </a>
        </div>
        {% endfor %}
      </div>
    </div>

    <!-- WORKFLOW SECTION -->
    {% if processes %}
    <div class="workflow-section">
      <div class="workflow-header">
        <h2 class="workflow-title">NEURAL SYNC</h2>
      </div>

      <div class="timeline-container">
        {% for process in processes %}
        <div class="timeline-item">
          <div class="step-number">{{ process.step_number|stringformat:"02d" }}</div>
          
          <!-- ICON IN HEXAGON - NEW -->
          <div class="step-icon-wrapper">
            <i class="{{ process.icon_class }} step-icon"></i>
          </div>
          
          <h4 class="step-title">{{ process.title }}</h4>
          <p class="step-description">{{ process.description }}</p>
        </div>
        {% endfor %}
      </div>
    </div>
    {% endif %}

  </div>
</div>

<script>
// GLITCH EFFECT ON TITLE
document.addEventListener('DOMContentLoaded', function() {
  const title = document.querySelector('.main-title');
  
  if (title) {
    title.addEventListener('mouseenter', function() {
      this.classList.add('glitch-active');
    });
    
    title.addEventListener('mouseleave', function() {
      this.classList.remove('glitch-active');
    });

    // RANDOM GLITCH TRIGGER
    setInterval(() => {
      if (Math.random() > 0.95) {
        title.classList.add('glitch-active');
        setTimeout(() => {
          title.classList.remove('glitch-active');
        }, 300);
      }
    }, 2000);
  }

  // RANDOM STATUS UPDATES
  const statusValues = document.querySelectorAll('.status-value');
  setInterval(() => {
    if (Math.random() > 0.7) {
      const randomStatus = statusValues[Math.floor(Math.random() * statusValues.length)];
      randomStatus.style.opacity = '0.3';
      setTimeout(() => {
        randomStatus.style.opacity = '1';
      }, 150);
    }
  }, 3000);
});
</script>
{% endblock %}