/* ==========================================================================
   Circusoft - Enterprise Stylesheet
   Architecture: Clean, Modular, Orthogonal
   Theme System: Warm Slate/Stone Light Mode & Deep Charcoal Emerald Dark Mode
   Typography: Cairo / IBM Plex Sans Arabic + Space Grotesk (Tech Wordmarks)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties / Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand Emerald Palette */
  --color-emerald-300: #6ee7b7;
  --color-emerald-400: #34d399;
  --color-emerald-500: #10b981;
  --color-emerald-600: #059669;
  --color-emerald-700: #047857;
  --color-emerald-800: #065f46;
  --color-emerald-900: #064e3b;
  --color-emerald-950: #022c22;

  /* Glow and Shadow Tokens */
  --glow-emerald-subtle: 0 0 25px rgba(16, 185, 129, 0.15);
  --glow-emerald-intense: 0 0 40px rgba(16, 185, 129, 0.35);
  --glow-emerald-border: 0 0 15px rgba(16, 185, 129, 0.25);

  /* Light Theme (Warm Enterprise Gray/Stone - Never pure harsh #FFF background) */
  --bg-primary: #f4f5f8;
  --bg-secondary: #e9ecf2;
  --bg-card: #ffffff;
  --bg-card-hover: #fafbfc;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-input: #ffffff;

  --border-subtle: #e2e8f0;
  --border-card: #cbd5e1;
  --border-focus: #10b981;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --text-accent: #059669;

  --badge-bg: #ecfdf5;
  --badge-text: #065f46;
  --badge-border: #a7f3d0;

  --card-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  --card-shadow-hover: 0 20px 35px -5px rgba(16, 185, 129, 0.12), 0 12px 16px -8px rgba(15, 23, 42, 0.08);

  --grid-line-color: rgba(148, 163, 184, 0.15);
}

/* Dark Theme (Luxury Emerald & Deep Charcoal) */
html.dark {
  --bg-primary: #070a0f;
  --bg-secondary: #0d121c;
  --bg-card: #111827;
  --bg-card-hover: #162032;
  --bg-glass: rgba(17, 24, 39, 0.78);
  --bg-input: #0b0f19;

  --border-subtle: #1e293b;
  --border-card: rgba(52, 211, 153, 0.12);
  --border-focus: #34d399;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-accent: #34d399;

  --badge-bg: rgba(6, 78, 59, 0.45);
  --badge-text: #6ee7b7;
  --badge-border: rgba(52, 211, 153, 0.3);

  --card-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6);
  --card-shadow-hover: 0 22px 45px -10px rgba(16, 185, 129, 0.22);

  --grid-line-color: rgba(52, 211, 153, 0.05);
}

/* --------------------------------------------------------------------------
   2. Base & Typography Adjustments
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* High-tech wordmark font */
.font-brand {
  font-family: 'Space Grotesk', 'IBM Plex Sans Arabic', sans-serif;
  letter-spacing: -0.03em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-emerald-600);
  border-radius: 9999px;
  border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-emerald-500);
}

/* Selection Color */
::selection {
  background-color: var(--color-emerald-500);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   3. Glassmorphic & Layout Utilities
   -------------------------------------------------------------------------- */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-card);
}

.glass-header {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.card-elevated {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  box-shadow: var(--card-shadow);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.28s ease;
}

.card-elevated:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--color-emerald-500);
}

/* Circuit Grid Pattern Background */
.bg-circuit-grid {
  background-image: 
    linear-gradient(to right, var(--grid-line-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line-color) 1px, transparent 1px);
  background-size: 38px 38px;
}

/* Radial Gradient Mesh for Ambient Glow */
.ambient-glow-mesh {
  position: absolute;
  pointer-events: none;
  border-radius: 9999px;
  filter: blur(80px);
  opacity: 0.45;
  z-index: 0;
}

html.dark .ambient-glow-mesh {
  opacity: 0.28;
  filter: blur(100px);
}

/* --------------------------------------------------------------------------
   4. High-Tech Visual Interactive Node & Dashboard (Hero Visual)
   -------------------------------------------------------------------------- */
.circuit-node-core {
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.4);
  animation: pulse-core 3s infinite ease-in-out;
}

@keyframes pulse-core {
  0%, 100% {
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.35);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 45px rgba(16, 185, 129, 0.65);
    transform: scale(1.02);
  }
}

.pulse-line {
  stroke-dasharray: 6, 6;
  animation: dash 18s linear infinite;
}

@keyframes dash {
  to {
    stroke-dashoffset: -1000;
  }
}

.telemetry-chip {
  animation: float-chip 4s infinite ease-in-out alternate;
}

@keyframes float-chip {
  0% {
    transform: translateY(0px);
  }
  100% {
    transform: translateY(-8px);
  }
}

/* --------------------------------------------------------------------------
   5. Lead Qualification Wizard (Step 1, 2, 3)
   -------------------------------------------------------------------------- */
.qualifier-path-card {
  cursor: pointer;
  border: 2px solid var(--border-card);
  background: var(--bg-card);
  transition: all 0.25s ease;
  user-select: none;
}

.qualifier-path-card:hover {
  border-color: var(--color-emerald-400);
  transform: translateY(-2px);
  box-shadow: var(--glow-emerald-subtle);
}

.qualifier-path-card.selected {
  border-color: var(--color-emerald-500);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.02) 100%);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

html.dark .qualifier-path-card.selected {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16) 0%, rgba(6, 78, 59, 0.25) 100%);
  border-color: var(--color-emerald-400);
}

.qualifier-goal-pill {
  cursor: pointer;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.qualifier-goal-pill:hover {
  border-color: var(--color-emerald-400);
  color: var(--text-main);
}

.qualifier-goal-pill.active {
  background: var(--color-emerald-600);
  color: #ffffff;
  border-color: var(--color-emerald-500);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

/* WhatsApp Live Chat Bubble */
.whatsapp-chat-preview {
  background-color: #0b141a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 16px 16px;
}

.whatsapp-bubble-out {
  background-color: #005c4b;
  color: #e9edef;
  border-radius: 12px 0 12px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  position: relative;
}

.whatsapp-bubble-out::after {
  content: '';
  position: absolute;
  top: 0;
  right: -8px;
  width: 0;
  height: 0;
  border: 8px solid transparent;
  border-top-color: #005c4b;
  border-left-color: #005c4b;
}

/* Floating WhatsApp Button Animation */
.whatsapp-floating-pulse {
  animation: pulse-whatsapp 2.5s infinite;
}

@keyframes pulse-whatsapp {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* --------------------------------------------------------------------------
   6. Step Indicators & Animations
   -------------------------------------------------------------------------- */
.step-indicator-dot {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.step-indicator-dot.active {
  background-color: var(--color-emerald-500);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
  transform: scale(1.1);
}

.step-indicator-dot.completed {
  background-color: var(--color-emerald-700);
  color: #a7f3d0;
}

.step-indicator-dot.pending {
  background-color: var(--bg-secondary);
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
}

/* Fade in for dynamic step transitions */
.fade-in {
  animation: fadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* Scroll Reveal classes */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   7. Buttons, Badges, and Hover Interactions
   -------------------------------------------------------------------------- */
.btn-emerald-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 6px 20px -3px rgba(16, 185, 129, 0.45);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.btn-emerald-primary:hover {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  box-shadow: 0 10px 25px -2px rgba(16, 185, 129, 0.6);
  transform: translateY(-2px);
}

.btn-emerald-primary:active {
  transform: translateY(0);
}

.btn-emerald-secondary {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-card);
  transition: all 0.25s ease;
}

.btn-emerald-secondary:hover {
  border-color: var(--color-emerald-500);
  color: var(--color-emerald-500);
  background-color: rgba(16, 185, 129, 0.05);
  transform: translateY(-2px);
}

/* Custom Accordion Chevron */
.faq-chevron {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
}

/* Responsive tweaks & Zero-Scroll Architecture */
@media (max-width: 768px) {
  .hero-visual-card {
    min-height: 380px;
  }
}

/* ==========================================================================
   Ultra-High-End UI/UX Interactive Architecture (Linear / Stripe Style)
   ========================================================================== */

/* Card 3D container with hardware acceleration */
.showcase-card {
  position: relative;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 1.15rem;
  overflow: hidden;
  will-change: transform, box-shadow;
  transform-style: preserve-3d;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

/* Cinematic Lens Flare Across Showcase Grid */
.cinematic-flare {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(52, 211, 153, 0.03) 25%,
    rgba(52, 211, 153, 0.28) 50%,
    rgba(52, 211, 153, 0.03) 75%,
    transparent 100%
  );
  pointer-events: none;
  transform: skewX(-25deg);
  z-index: 20;
}

/* Cinematic Movie Vignette (Atmospheric Focus) */
.cinematic-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.45) 100%);
}

html:not(.dark) .cinematic-vignette {
  background: radial-gradient(circle at 50% 50%, transparent 68%, rgba(15, 23, 42, 0.08) 100%);
}

/* Dynamic Cursor Spotlight Layer */
.showcase-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    400px circle at var(--spotlight-x, -999px) var(--spotlight-y, -999px),
    rgba(16, 185, 129, 0.14),
    transparent 65%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.showcase-card:hover::after {
  opacity: 1;
}

/* Subtle glowing border following cursor */
.showcase-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: radial-gradient(
    300px circle at var(--spotlight-x, -999px) var(--spotlight-y, -999px),
    rgba(52, 211, 153, 0.65),
    transparent 70%
  );
  -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;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 2;
}

.showcase-card:hover::before {
  opacity: 1;
}

.showcase-card:hover {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 20px 40px -12px rgba(16, 185, 129, 0.18), 0 0 20px rgba(16, 185, 129, 0.08);
}

/* Shimmer pulse for feature tags */
.tech-tag-pill {
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.tech-tag-pill:hover {
  background-color: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.4);
  transform: translateY(-1px);
}

/* Ambient canvas behind background */
#ambient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

/* Magnetic button smooth transition */
.magnetic-btn {
  will-change: transform;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1);
}

/* Toast alert (Pure CSS Centered, Reliable, Hidden by default) */
#copy-toast {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translate(-50%, 16px) !important;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s !important;
}

#copy-toast.show {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translate(-50%, 0) !important;
}


