/* ==========================================================================
   ROHAM SISTEMI — AJAX SYSTEMS THREAT SCROLLYTELLING ENGINE (v1.0)
   Real-Time Threat Response Cockpit for Ajax Systems
   ========================================================================== */

/* Layer 1: 4 Stupa Ajax Zaštite (Normal Static Section) */
.ajax-layer-pillars {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  pointer-events: auto;
  padding: 85px 24px 55px;
  background: var(--bg-black, #0b0b0c);
  overflow: hidden;
}

.ajax-layer-pillars::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 450px;
  background: radial-gradient(circle, rgba(0, 255, 102, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Base Wrapper for Desktop Pinned Stage (280vh for 4 threat steps) */
.ajax-stage-wrapper {
  position: relative;
  height: 280vh;
  background: var(--bg-black, #0b0b0c);
  perspective: 1200px;
}

.ajax-stage-frame {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background: var(--bg-black, #0b0b0c);
  transform-style: preserve-3d;
}

/* Layer 2: Threat Response Cockpit Container */
.ajax-stage-container {
  position: relative;
  margin: auto;
  width: 100%;
  max-width: 1340px;
  height: calc(100vh - 40px);
  max-height: 880px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  z-index: 18;
  pointer-events: auto;
  opacity: 1;
}

/* Layer 3: Ajax Systems Ekosustav Zaštite (Normal Static Section) */
.ajax-layer-ecosystem {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 22;
  pointer-events: auto;
  opacity: 1;
  padding: 75px 24px 85px;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(0, 255, 102, 0.04) 0%, transparent 75%);
}

.ajax-ecosystem-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.ajax-ecosystem-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 60px;
  align-items: center;
}

.ajax-eco-col-text {
  text-align: left;
}

.ajax-eco-title {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  margin-top: 16px;
  line-height: 1.12;
  letter-spacing: -0.04em;
  font-weight: 700;
  color: #fff;
}

.ajax-eco-desc {
  color: #aaa;
  font-size: 1.02rem;
  line-height: 1.65;
  margin-top: 16px;
  margin-bottom: 24px;
}

.ajax-eco-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.ajax-eco-feature-item {
  border-left: 2px solid var(--sec-green, #00ff66);
  padding-left: 14px;
}

.ajax-eco-feature-item h4 {
  color: #fff;
  margin: 0 0 4px 0;
  font-size: 0.98rem;
  font-weight: 600;
}

.ajax-eco-feature-item p {
  color: #888;
  font-size: 0.84rem;
  line-height: 1.45;
  margin: 0;
}

.ajax-eco-col-media {
  display: flex;
  justify-content: center;
  align-items: center;
}

.ajax-eco-img {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 255, 102, 0.06);
}

/* Header Row: Title + Stepper Nav */
.ajax-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 18px;
  gap: 20px;
  flex-wrap: wrap;
}

.ajax-stage-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ajax-stage-title {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  color: #fff;
  line-height: 1.15;
}

/* Stepper Pills Track */
.ajax-stepper-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ajax-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: transparent;
  border: none;
  color: #888;
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ajax-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.ajax-pill.active {
  background: var(--sec-green, #00ff66);
  color: #000;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(0, 255, 102, 0.35);
}

.ajax-pill-num {
  font-size: 0.72rem;
  opacity: 0.85;
}

/* Micro Progress Bar */
.ajax-progress-bar {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  margin-bottom: 20px;
  overflow: hidden;
}

.ajax-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--sec-green, #00ff66), #1aff75);
  box-shadow: 0 0 10px rgba(0, 255, 102, 0.5);
  transition: width 0.1s linear;
}

/* Cockpit Grid (2 Columns: Left Screen / Right Narrative) */
.ajax-cockpit-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: center;
  width: 100%;
  flex: 1;
  min-height: 0;
}

/* Left: Viewport Screen */
.ajax-viewport-sticky {
  position: relative;
  width: 100%;
  height: 520px;
  max-height: 60vh;
  border-radius: 24px;
  overflow: hidden;
  background: #08090b;
  border: 1px solid rgba(0, 255, 102, 0.2);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 255, 102, 0.08);
  display: flex;
  flex-direction: column;
}

/* Screen Top HUD */
.ajax-viewport-top-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 42px;
  background: rgba(8, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 10;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  letter-spacing: 0.5px;
}

.ajax-hud-dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sec-green, #00ff66);
  display: inline-block;
  margin-right: 8px;
  box-shadow: 0 0 8px var(--sec-green, #00ff66);
  animation: ajaxHudPulse 1.8s infinite;
}

@keyframes ajaxHudPulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

/* Screen Layers Container */
.ajax-viewport-screen {
  position: relative;
  width: 100%;
  flex: 1;
  overflow: hidden;
}

/* Layer Slides */
.ajax-stage-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.ajax-stage-layer.active {
  opacity: 1;
  visibility: visible;
}

.ajax-layer-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  transition: transform 6s ease-out;
}

.ajax-stage-layer[data-index="2"] .ajax-layer-bg {
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-color: #08090b !important;
}

.ajax-stage-layer.active .ajax-layer-bg {
  transform: scale(1.06);
}

.ajax-layer-overlay {
  display: none !important;
}

/* Threat Radar Target Overlays */
.ajax-radar-overlay {
  display: none !important;
}

.ajax-radar-circle {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px dashed rgba(0, 255, 102, 0.3);
  position: relative;
  animation: ajaxRadarRotate 20s linear infinite;
}

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

.ajax-radar-circle::after {
  content: '';
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 1px solid rgba(0, 255, 102, 0.15);
}

.ajax-radar-crosshair {
  position: absolute;
  width: 100%;
  height: 100%;
}
.ajax-radar-crosshair::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0, 255, 102, 0.12);
}
.ajax-radar-crosshair::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(0, 255, 102, 0.12);
}

.ajax-radar-pulse {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sec-green, #00ff66);
  box-shadow: 0 0 15px var(--sec-green, #00ff66);
  animation: ajaxBlipPulse 1.2s infinite;
}

@keyframes ajaxBlipPulse {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
  100% { transform: scale(0.9); opacity: 1; }
}

/* Layer HUD Floating Pills */
.ajax-hud-overlay {
  display: none !important;
}

.ajax-hud-tag-pill {
  position: absolute;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  letter-spacing: 0.8px;
  color: #fff;
  background: rgba(8, 9, 11, 0.85);
  border: 1px solid rgba(0, 255, 102, 0.35);
  padding: 6px 12px;
  border-radius: 99px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* Bottom Telemetry Bar on Sticky Screen */
.ajax-viewport-bottom-bar {
  height: 48px;
  background: rgba(8, 9, 11, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  z-index: 10;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
}

.ajax-bottom-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ajax-metric-label {
  color: #777;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ajax-metric-val {
  color: var(--sec-green, #00ff66);
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Right: Narrative Deck */
.ajax-narrative-deck {
  position: relative;
  width: 100%;
  height: 480px;
  max-height: 58vh;
  display: flex;
  align-items: center;
}

/* Deck Slide */
.ajax-deck-slide {
  position: absolute;
  inset: 0;
  background: rgba(16, 17, 22, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 255, 102, 0.25);
  border-radius: 24px;
  padding: 34px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 26px, 0) scale(0.96);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

.ajax-deck-slide.active {
  border-color: rgba(0, 255, 102, 0.45);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 255, 102, 0.1);
}

.ajax-deck-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--sec-green, #00ff66);
  background: rgba(0, 255, 102, 0.1);
  border: 1px solid rgba(0, 255, 102, 0.25);
  padding: 5px 11px;
  border-radius: 99px;
  width: fit-content;
  margin-bottom: 12px;
}

.ajax-deck-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px 0;
  line-height: 1.25;
}

.ajax-deck-desc {
  font-size: 0.94rem;
  color: #bbb;
  line-height: 1.5;
  margin: 0 0 18px 0;
}

/* Scrollytelling Threat Timeline */
.ajax-threat-timeline {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 18px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ajax-timeline-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: #ddd;
}

.ajax-timeline-time {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  color: var(--sec-green, #00ff66);
  background: rgba(0, 255, 102, 0.1);
  border: 1px solid rgba(0, 255, 102, 0.25);
  padding: 2px 7px;
  border-radius: 6px;
  min-width: 48px;
  text-align: center;
  flex-shrink: 0;
}

.ajax-timeline-text {
  line-height: 1.35;
}
.ajax-timeline-text strong {
  color: #fff;
}

/* Tags on Slide */
.ajax-deck-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
}

.ajax-deck-pill {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: #ccc;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ajax-deck-pill .pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sec-green, #00ff66);
}

/* Hide Mobile Stream on Desktop */
.ajax-mobile-threats-stream {
  display: none;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS (<= 960px)
   ========================================================================== */
@media (max-width: 960px) {
  .ajax-stage-wrapper {
    height: auto !important;
    perspective: none !important;
    padding: 0 !important;
  }

  .ajax-stage-frame {
    position: relative !important;
    top: auto !important;
    height: auto !important;
    min-height: auto !important;
    display: block !important;
    overflow: visible !important;
  }

  /* Mobile Layer 1: Pillars */
  .ajax-layer-pillars {
    position: relative !important;
    inset: auto !important;
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    pointer-events: auto !important;
    visibility: visible !important;
    padding: 50px 16px 30px !important;
  }

  /* Mobile Layer 2: Cockpit */
  .ajax-stage-container {
    position: relative !important;
    inset: auto !important;
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    pointer-events: auto !important;
    visibility: visible !important;
    height: auto !important;
    max-height: none !important;
    padding: 30px 16px 50px !important;
  }

  /* Mobile Layer 3: Ecosystem */
  .ajax-layer-ecosystem {
    position: relative !important;
    inset: auto !important;
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    pointer-events: auto !important;
    visibility: visible !important;
    padding: 40px 16px 80px !important;
    background: transparent !important;
  }

  .ajax-ecosystem-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  .ajax-eco-features-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .ajax-eco-img {
    max-height: 320px !important;
  }

  .ajax-stage-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 24px !important;
  }

  .ajax-stage-title {
    font-size: 1.65rem !important;
  }

  /* Hide Desktop Stepper i Cockpit Grid on Mobile */
  .ajax-stepper-nav {
    display: none !important;
  }

  .ajax-progress-bar {
    display: none !important;
  }

  .ajax-cockpit-grid {
    display: none !important;
  }

  /* Mobile Stream: Visible all 4 cards vertically stacked */
  .ajax-mobile-threats-stream {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .ajax-mobile-card {
    background: rgba(16, 17, 22, 0.95) !important;
    border: 1px solid rgba(0, 255, 102, 0.2) !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55) !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }

  .ajax-m-card-media {
    position: relative !important;
    width: 100% !important;
    height: 250px !important;
    overflow: hidden !important;
    background: #08090b !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .ajax-m-card-media img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
  }

  .ajax-m-card-media-overlay {
    display: none !important;
  }

  .ajax-m-card-hud-badge {
    display: none !important;
  }

  .ajax-m-card-body {
    padding: 20px 18px 22px !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }

  .ajax-m-card-body h3 {
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.25 !important;
  }

  .ajax-m-card-body p {
    font-size: 0.92rem !important;
    color: #a0a0a8 !important;
    line-height: 1.55 !important;
    margin: 0 0 16px 0 !important;
  }

  .ajax-m-card-body .ajax-threat-timeline {
    margin-bottom: 16px !important;
  }
}
