/*
================================================================================
Engaz (إنجاز) SaaS Landing Page - Professional Enhancements
Theme: Primary #123B56 | Action #0F766E | Accent #14B8A6 | Bg #F6F8FB | Text #0F172A
RTL Optimized
================================================================================
*/

:root {
  --edara-primary: #123B56;
  --edara-action: #0F766E;
  --edara-accent: #14B8A6;
  --edara-bg: #F6F8FB;
  --edara-text: #0F172A;
  --edara-glass-bg: rgba(255, 255, 255, 0.85);
  --edara-glass-border: rgba(255, 255, 255, 0.4);
  --edara-shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --edara-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  --edara-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  --edara-shadow-glow: 0 0 20px rgba(20, 184, 166, 0.3);
  --transition-smooth: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   15. Smooth Scroll & Global
   ========================================================================== */
html {
  scroll-behavior: smooth;
}

::selection {
  background-color: var(--edara-accent);
  color: #FFFFFF;
}

.parallax-subtle {
  will-change: transform;
}

/* ==========================================================================
   1. Scroll Reveal Animation System
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: var(--transition-smooth);
  will-change: opacity, transform;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px); /* RTL: slides from left (usually physical left) */
  transition: var(--transition-smooth);
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px); /* RTL: slides from right */
  transition: var(--transition-smooth);
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: var(--transition-smooth);
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Stagger Delays */
.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }
.reveal-delay-5 { transition-delay: 500ms; }
.reveal-delay-6 { transition-delay: 600ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-right, .reveal-scale {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ==========================================================================
   2. Hero Section Enhancements
   ========================================================================== */
.hero-animated-bg {
  position: relative;
  overflow: hidden;
  background-color: #F8FAFC;
}

.hero-animated-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 15% 20%, rgba(20, 184, 166, 0.12) 0%, transparent 40%),
              radial-gradient(circle at 85% 60%, rgba(18, 59, 86, 0.06) 0%, transparent 45%),
              radial-gradient(circle at 50% 90%, rgba(245, 196, 81, 0.08) 0%, transparent 35%);
  animation: gradientShift 20s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes gradientShift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-2%, 5%) scale(1.05); }
  100% { transform: translate(5%, -2%) scale(1); }
}

.hero-title-animate,
.hero-subtitle-animate,
.hero-cta-animate,
.hero-trust-animate {
  opacity: 0;
  animation: heroSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
  z-index: 2;
}

.hero-title-animate { animation-delay: 0.1s; }
.hero-subtitle-animate { animation-delay: 0.3s; }
.hero-cta-animate { animation-delay: 0.6s; }
.hero-trust-animate { animation-delay: 0.8s; }

@keyframes heroSlideUp {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

.hero-shimmer-text {
  position: relative;
  display: inline-block;
  background: linear-gradient(
    110deg,
    #0F766E 0%,
    #123B56 20%,
    #0F766E 38%,
    #14B8A6 48%,
    #2DD4BF 52%,
    #14B8A6 56%,
    #0F766E 66%,
    #123B56 82%,
    #0F766E 100%
  );
  background-size: 250% auto;
  color: #0F766E;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmerPass 5s infinite linear;
  font-weight: 900;
}

@keyframes shimmerPass {
  0% { background-position: 250% center; }
  100% { background-position: -250% center; }
}

/* ==========================================================================
   3. CTA Button Shimmer & Pulse Effects
   ========================================================================== */
.btn-hero-primary {
  position: relative;
  overflow: hidden;
  background-color: var(--edara-action);
  color: #fff;
  border: none;
  transition: var(--transition-fast);
  z-index: 1;
}

.btn-hero-primary:hover {
  background-color: var(--edara-accent);
  box-shadow: var(--edara-shadow-glow);
  transform: translateY(-2px);
}

.btn-hero-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: skewX(-25deg);
  animation: btnShimmer 4s infinite;
  z-index: -1;
}

@keyframes btnShimmer {
  0%, 80% { left: -100%; }
  100% { left: 200%; }
}

.btn-pulse {
  animation: btnPulse 3s infinite;
}

@keyframes btnPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.4); }
  50% { transform: scale(1.04); box-shadow: 0 0 15px 5px rgba(20, 184, 166, 0); }
}

/* ==========================================================================
   4. Floating Particles Background
   ========================================================================== */
.particles-container {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.particle {
  position: absolute;
  background-color: var(--edara-accent);
  border-radius: 50%;
  opacity: 0.1;
  animation: floatParticle 10s infinite ease-in-out;
}

.particle-1 { width: 8px; height: 8px; top: 20%; left: 15%; animation-duration: 12s; }
.particle-2 { width: 4px; height: 4px; top: 60%; left: 80%; animation-duration: 8s; animation-delay: 1s; }
.particle-3 { width: 6px; height: 6px; top: 80%; left: 25%; animation-duration: 14s; animation-delay: 2s; }
.particle-4 { width: 5px; height: 5px; top: 30%; left: 70%; animation-duration: 11s; animation-delay: 3s; }
.particle-5 { width: 7px; height: 7px; top: 75%; left: 60%; animation-duration: 13s; animation-delay: 4s; }
.particle-6 { width: 4px; height: 4px; top: 40%; left: 35%; animation-duration: 9s; animation-delay: 5s; }

@keyframes floatParticle {
  0%, 100% { transform: translateY(0) translateX(0); }
  33% { transform: translateY(-20px) translateX(10px); }
  66% { transform: translateY(10px) translateX(-15px); }
}

/* ==========================================================================
   5. Counter Animation Support
   ========================================================================== */
.counter-section {
  background: linear-gradient(to right, #ffffff, var(--edara-bg));
  padding: 4rem 0;
  position: relative;
  box-shadow: var(--edara-shadow-sm);
  z-index: 10;
}

.counter-item {
  background: var(--edara-glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--edara-glass-border);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  transition: var(--transition-fast);
  box-shadow: var(--edara-shadow-sm);
}

.counter-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--edara-shadow-md);
}

.counter-icon {
  width: 60px;
  height: 60px;
  background-color: rgba(20, 184, 166, 0.1);
  color: var(--edara-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
}

.counter-value {
  font-size: 3rem;
  font-weight: 800;
  color: var(--edara-action);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.2;
}

.counter-label {
  color: #64748B;
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

/* ==========================================================================
   6. Enhanced Card Styles
   ========================================================================== */
.landing-feature-box {
  position: relative;
  border-radius: 1rem;
  transition: var(--transition-fast);
  z-index: 1;
}

.landing-feature-box::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  padding: 2px;
  background: linear-gradient(135deg, transparent, transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transition: var(--transition-fast);
  z-index: -1;
}

.landing-feature-box:hover::before {
  background: linear-gradient(135deg, var(--edara-action), var(--edara-accent));
}

.tilt-card {
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-style: preserve-3d;
  will-change: transform;
}
/* JS handles the actual rotation via inline styles, but hover state fallback below */
.tilt-card:hover {
  transform: perspective(800px) scale(1.02);
  z-index: 10;
}

.card-glow:hover {
  animation: singlePulseGlow 0.8s ease-out forwards;
}

@keyframes singlePulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0); }
  50% { box-shadow: 0 0 25px rgba(20, 184, 166, 0.4); }
  100% { box-shadow: var(--edara-shadow-glow); }
}

.feature-stagger > div:nth-child(1) { transition-delay: 0s; }
.feature-stagger > div:nth-child(2) { transition-delay: 0.1s; }
.feature-stagger > div:nth-child(3) { transition-delay: 0.2s; }
.feature-stagger > div:nth-child(4) { transition-delay: 0.3s; }
.feature-stagger > div:nth-child(5) { transition-delay: 0.4s; }
.feature-stagger > div:nth-child(6) { transition-delay: 0.5s; }

/* ==========================================================================
   7. Vertical Cards Enhancement
   ========================================================================== */
.vertical-card {
  position: relative;
  overflow: hidden;
  transition: var(--transition-fast);
}

.vertical-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 4px;
  background-color: var(--edara-accent);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.vertical-card:hover::after {
  transform: scaleY(1);
  transform-origin: top;
  box-shadow: -5px 0 15px rgba(20, 184, 166, 0.5); /* RTL right side shadow */
}

.vertical-card:hover .card-icon {
  animation: iconBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

/* ==========================================================================
   8. Navbar Scroll Effect
   ========================================================================== */
.landing-nav {
  transition: var(--transition-fast);
  padding: 1.5rem 0;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

.landing-nav.scrolled {
  padding: 0.75rem 0;
  background-color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
}

/* ==========================================================================
   9. Live Notification Toast
   ========================================================================== */
.live-toast-container {
  position: fixed;
  bottom: 2rem;
  left: 2rem; /* Left side for RTL */
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  pointer-events: none;
}

.live-toast {
  background: var(--edara-glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--edara-glass-border);
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--edara-shadow-lg);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(-50px);
  transition: var(--transition-fast);
  width: 320px;
}

.live-toast.show {
  animation: toastSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.live-toast.hide {
  animation: toastSlideOut 0.4s ease-in forwards;
}

@keyframes toastSlideIn {
  0% { opacity: 0; transform: translateX(-50px) scale(0.9); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastSlideOut {
  0% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(-50px) scale(0.9); }
}

.toast-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--edara-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  position: relative;
}

.toast-live-dot {
  position: absolute;
  top: 0; right: 0;
  width: 10px; height: 10px;
  background-color: #10B981;
  border: 2px solid white;
  border-radius: 50%;
}

.toast-content {
  flex-grow: 1;
}

.toast-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--edara-text);
  margin-bottom: 0.2rem;
}

.toast-desc {
  font-size: 0.8rem;
  color: #64748B;
}

.toast-close {
  background: none;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 0.2rem;
}

.toast-close:hover {
  color: var(--edara-text);
}

/* ==========================================================================
   10. Wave Separator
   ========================================================================== */
.wave-separator {
  position: relative;
  width: 100%;
  height: 60px;
  overflow: hidden;
  line-height: 0;
}

.wave-separator svg {
  display: block;
  width: calc(100% + 1.3px);
  height: 60px;
}

.wave-separator .shape-fill {
  fill: var(--edara-bg);
}

.wave-separator-flip {
  transform: rotate(180deg);
}
.wave-separator-flip .shape-fill {
  fill: #FFFFFF;
}

/* ==========================================================================
   11. Sticky Mobile CTA
   ========================================================================== */
.sticky-mobile-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 1rem;
  border-top: 1px solid var(--edara-glass-border);
  box-shadow: 0 -10px 20px rgba(0,0,0,0.05);
  z-index: 9998;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sticky-mobile-cta.hidden {
  transform: translateY(100%);
}

.sticky-mobile-cta .btn {
  width: 100%;
  padding: 1rem;
  font-weight: 700;
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  .sticky-mobile-cta {
    display: block;
  }
}

/* ==========================================================================
   12. Pricing Section Glow
   ========================================================================== */
.pricing-plan-card.featured {
  position: relative;
  border: 2px solid var(--edara-accent);
  box-shadow: var(--edara-shadow-md);
  animation: pricingGlow 4s infinite alternate;
  z-index: 2;
  transform: scale(1.05); /* Highlight featured plan */
}

@keyframes pricingGlow {
  0% { box-shadow: 0 0 10px rgba(20, 184, 166, 0.2); }
  100% { box-shadow: 0 0 30px rgba(20, 184, 166, 0.6); }
}

.plan-features-list li {
  position: relative;
  padding-right: 1.8rem;
  margin-bottom: 0.8rem;
}

.plan-features-list li::before {
  content: '✓';
  position: absolute;
  right: 0;
  top: 2px;
  color: var(--edara-action);
  font-weight: bold;
}

/* Stagger checkmarks on reveal */
.reveal.revealed .plan-features-list li {
  animation: fadeInRight 0.4s ease-out forwards;
  opacity: 0;
}
.reveal.revealed .plan-features-list li:nth-child(1) { animation-delay: 0.1s; }
.reveal.revealed .plan-features-list li:nth-child(2) { animation-delay: 0.2s; }
.reveal.revealed .plan-features-list li:nth-child(3) { animation-delay: 0.3s; }
.reveal.revealed .plan-features-list li:nth-child(4) { animation-delay: 0.4s; }
.reveal.revealed .plan-features-list li:nth-child(5) { animation-delay: 0.5s; }
.reveal.revealed .plan-features-list li:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInRight {
  0% { opacity: 0; transform: translateX(10px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   13. FAQ Enhancement
   ========================================================================== */
.faq-accordion-item {
  border: 1px solid #E2E8F0;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  background: #FFF;
  overflow: hidden;
}

.faq-accordion-btn {
  width: 100%;
  text-align: right; /* RTL */
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--edara-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.faq-accordion-btn:hover {
  background-color: var(--edara-bg);
}

.faq-icon {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--edara-accent);
}

.faq-accordion-btn[aria-expanded="true"] .faq-icon {
  transform: rotate(45deg) scale(1.1);
}

.faq-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
}

.faq-accordion-btn[aria-expanded="true"] + .faq-accordion-content {
  max-height: 500px; /* Arbitrary large height to allow transition */
  transition: max-height 0.8s ease-in-out;
}

.faq-inner {
  padding: 0 1.5rem 1.25rem 1.5rem;
  color: #475569;
  line-height: 1.6;
}

/* ==========================================================================
   14. Footer Enhancement
   ========================================================================== */
.wave-footer-separator {
  position: relative;
  width: 100%;
  height: 60px;
  overflow: hidden;
  line-height: 0;
  margin-bottom: -1px; /* prevent gaps */
}

.wave-footer-separator svg {
  display: block;
  width: calc(100% + 1.3px);
  height: 60px;
}

.wave-footer-separator .shape-fill {
  fill: var(--edara-primary); /* Footer bg color */
}

.footer-gradient-divider {
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, 
    rgba(255,255,255,0.05) 0%, 
    rgba(20,184,166,0.5) 50%, 
    rgba(255,255,255,0.05) 100%);
  background-size: 200% 100%;
  animation: gradientMove 3s ease infinite;
  margin: 2rem 0;
}

@keyframes gradientMove {
  0% { background-position: 100% 0; }
  50% { background-position: 0 0; }
  100% { background-position: 100% 0; }
}

/* ==========================================================================
   16. Calculator Enhancement
   ========================================================================== */
.calc-result-pop {
  animation: resultPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes resultPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); color: var(--edara-accent); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   17. Mobile Responsiveness Fixes
   ========================================================================== */
@media (max-width: 768px) {
  /* Tone down animations */
  .hero-animated-bg::before {
    animation: none;
    opacity: 0.5;
  }
  
  .particles-container {
    display: none; /* Hide for performance */
  }

  .reveal, .reveal-left, .reveal-right, .reveal-scale {
    transform: translateY(20px); /* Smaller movement on mobile */
  }

  /* Fix spacing */
  .hero-section {
    padding-top: 6rem;
    padding-bottom: 3rem;
  }

  .counter-value {
    font-size: 2.2rem;
  }

  .pricing-plan-card.featured {
    transform: scale(1); /* Remove scale on mobile so it fits */
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
}
