@import url('/assets/css/variables.css');
@import 'animated-background.css';

/* Import AOS animation library */
@import url('https://cdn.jsdelivr.net/npm/aos@2.3.4/dist/aos.css');

/* Base Typography */
body {
  font-family: var(--font-primary);
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.rtl {
  font-family: var(--font-arabic);
  direction: rtl;
}

/* Bootstrap overrides removed from this file.
  All button, navbar, nav-link, gradient, and related component
  customizations now live exclusively in bootstrap-overrides.css
  to avoid duplication and specificity conflicts. */

/* Hero Section */
.hero-section {
  /* background: linear-gradient(135deg, var(--background-light) 0%, var(--bg-color) 100%); */
  padding: 120px 0 80px;
  position: relative;
  overflow: hidden;
  /* heroFadeIn animation moved to animations.css */
}

/* Hero background video and overlay */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-bg-video {
/* Bootstrap overrides moved to bootstrap-overrides.css */
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: 120%;
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  /* filter: saturate(0.95) brightness(0.7); */
  pointer-events: none;
}

.hero-bg-overlay {
  /* display: none; */
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, var(--hero-overlay-start, var(--hero-overlay-mid-1)), var(--hero-overlay-end, var(--hero-overlay-mid-2)));
  mix-blend-mode: multiply;
}

/* Ensure hero content sits above the background */
.hero-section .container,
.hero-section .hero-content {
  position: relative;
  z-index: 1;
}

/* Mobile and reduced bandwidth fallback: hide video on small screens */
@media (max-width: 768px) {
  .hero-bg-video { display: none; }
  .hero-bg-overlay { background: linear-gradient(to bottom right, var(--hero-overlay-start, rgba(26,26,26,0.35)), var(--hero-overlay-end, rgba(0,0,0,0.45))); }
}

@media (prefers-reduced-motion: reduce) {
  /* Respect reduced-motion unless explicitly forced via html.force-hero-video */
  /* html:not(.force-hero-video) .hero-bg-video { display: none; } */
}

/* heroFadeIn keyframes moved to animations.css */

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  right: -50%;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23e9374e" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23e9374e" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.5;
  z-index: 0;
  /* heroParallax animation moved */
}

/* heroParallax keyframes moved */

.hero-content {
  position: relative;
  z-index: 1;
  /* heroContentSlide animation moved */
}

/* heroContentSlide keyframes moved */

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, rgb(255, 255, 255) 0%, var(--primary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  /* heroTitleReveal animation moved */
}

/* heroTitleReveal keyframes moved */

.hero-subtitle {
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 2rem;
  max-width: 600px;
  /* heroSubtitleReveal animation moved */
}

/* heroSubtitleReveal keyframes moved */

/* Hero CTA animation moved to animations.css */
.hero-cta { display:flex; gap:1rem; flex-wrap:wrap; }

/* heroButtonsReveal keyframes moved */

/* hero-image-animate animation now defined in animations.css (no base styles needed here) */

/* heroImageReveal keyframes moved to animations.css */

/* Capabilities Section */
.capabilities-section {
  padding: 80px 0;
}

.capability-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  height: 100%;
  /* transition-property: transform, box-shadow, border-color;
  transition-duration: var(--duration-normal);
  transition-timing-function: var(--ease-out-expo); */
  position: relative;
  overflow: hidden;
  will-change: transform, box-shadow;
  transform: translateZ(0);
  cursor: pointer;
}

.capability-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
  transform: scaleX(0);
  /* transition: transform var(--duration-normal) var(--ease-out-back); */
  transform-origin: left;
}

.capability-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color)08, transparent);
  opacity: 0;
  /* transition: opacity var(--duration-normal) var(--ease-out-expo); */
  pointer-events: none;
}

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

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

.capability-card:hover {
  transform: translateY(-12px) translateZ(0) rotateX(2deg);
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.15),
    0 10px 20px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.capability-icon {
  /* transition-property: transform, box-shadow;
  transition-duration: var(--duration-normal);
  transition-timing-function: var(--ease-out-back); */
  transform-origin: center;
}

.capability-card:hover .capability-icon {
  transform: scale(1.1) rotate(5deg);
}

.capability-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: white;
  font-size: 1.5rem;
}

/* Interactive Forms */
.interactive-form {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 10px 40px var(--shadow-medium);
}

.form-step {
  display: none;
  animation: fadeInUp 0.5s ease;
}

.form-step.active {
  display: block;
}

.form-progress {
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  margin-bottom: 2rem;
  overflow: hidden;
}

.form-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem var(--focus-shadow);
}

/* Sticky Contact Widget */
.sticky-contact-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1050;
}

.btn-floating {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 8px 25px var(--shadow-primary);
  animation: pulse 2s infinite;
}

/* Product Cards */
.product-card {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow-light);
  /* transition: all 0.3s ease; */
  height: 100%;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px var(--shadow-heavy);
}

.product-card-image {
  height: 200px;
  background: linear-gradient(135deg, var(--background-light), var(--bg-color));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--primary-color);
}

.product-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  height: calc(100% - 200px);
}

.product-badge {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 1rem;
}

/* Case Study Cards */
.case-study-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 20px var(--shadow-light);
  transition: all 0.3s ease;
  height: 100%;
}

.case-study-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px var(--shadow-medium);
}

.case-study-metrics {
  display: flex;
  gap: 2rem;
  margin: 1.5rem 0;
}

.metric {
  text-align: center;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  display: block;
}

.metric-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Video Container */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 25px var(--shadow-heavy);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Footer */
footer {
  background: var(--bg-gradient-primary);
}

footer .social-links a {
  display: inline-flex;
  width: 40px;
  height: 40px;
  background: var(--overlay-medium);
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

footer .social-links a:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
}

/* animation keyframes & fade-in-up utility moved to animations.css */

/* RTL Specific Styles */
.rtl .capability-card::before {
  transform-origin: right;
}

.rtl .nav-link.active::after {
  left: auto;
  right: 50%;
  transform: translateX(50%);
}

/* Marketing Banner */
.marketing-banner {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  padding: 1rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* marketing-banner shimmer animation moved to animations.css */

/* shimmer keyframes moved */

.banner-close {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.banner-close:hover {
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  
  .capability-card {
    margin-bottom: 2rem;
  }
  
  .case-study-metrics {
    flex-direction: column;
    gap: 1rem;
  }
  
  .sticky-contact-widget {
    bottom: 1rem;
    right: 1rem;
  }
  
  .btn-floating {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
}

@media (max-width: 576px) {
  .hero-section {
    padding: 80px 0 60px;
  }
  
  .capabilities-section {
    padding: 60px 0;
  }
  
  .interactive-form {
    padding: 1.5rem;
  }
}

/* Dark mode Bootstrap component overrides removed; now reside in bootstrap-overrides.css */

/* Dark Mode Toggle Button */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.theme-toggle i {
  font-size: 18px;
  transition: all 0.3s ease;
}

/* theme toggle spin animation moved to animations.css */

/* generic keyframes moved */

/* animation utility classes moved */

/* stagger animation rules moved */

/* hover interaction animations moved */

/* loading animations moved */

/* progress bar animation moved */

/* animation timing vars now in variables.css */

/* scroll reveal classes moved */

/* Debug visual for observed elements (temporary) */
.observed-debug {
  outline: 3px dashed rgba(0, 150, 136, 0.28);
  box-shadow: 0 0 0 3px rgba(0,150,136,0.02) inset;
}

/* Lightweight Scroll Reveal */
.sr-hidden {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
  will-change: opacity, transform;
}
.sr-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Advanced Stagger Animation */
.stagger-animation {
    perspective: 1000px;
}

.stagger-animation > * {
    opacity: 0;
    transform: translateY(40px) rotateX(15deg);
    transition-property: opacity, transform;
    transition-duration: var(--duration-normal);
    transition-timing-function: var(--ease-out-back);
    will-change: opacity, transform;
    backface-visibility: hidden;
}

.stagger-animation.revealed > * {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
}

/* Button Ripple Effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::before {
  width: 300px;
  height: 300px;
}

/* Card Flip Animation */
.flip-card {
  perspective: 1000px;
  height: 300px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flip-card-back {
  transform: rotateY(180deg);
  background: var(--gradient-primary);
  color: white;
}

/* Smooth Page Transitions */
.page-transition {
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

.page-transition.fade-out {
  opacity: 0;
}

/* Enhanced Navbar Animation */
.navbar {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.navbar.scrolled {
  background-color: var(--card-bg) !important;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
  padding: 0.5rem 0;
}

/* Text Animation */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: glow 3s ease-in-out infinite alternate;
}

/* Parallax Effect */
.parallax {
  transform: translateZ(0);
  transition: transform 0.1s ease-out;
}

/* Mobile Optimized Animations */
@media (max-width: 768px) {
  .hover-lift:hover,
  .hover-tilt:hover {
    transform: none;
  }
  
  .animate-bounce-in,
  .animate-zoom-in {
    animation-duration: 0.5s;
  }
  
  .stagger-animation > * {
    animation-duration: 0.5s;
  }
  
  .stagger-animation > *:nth-child(n) {
    animation-delay: 0.1s;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  /* *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .animate-float,
  .animate-glow,
  .loading-spinner {
    animation: none;
  } */
}

