/* ===== SUFI ENGINEERING — Premium Design System ===== */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: #dc2626; border-radius: 3px; }

/* ===== Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

.font-display {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}

/* ===== Loading Screen ===== */
.loader-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader-screen.loaded {
  opacity: 0;
  visibility: hidden;
}

.loader-pulse {
  width: 60px;
  height: 60px;
  border: 3px solid #dc2626;
  border-radius: 50%;
  animation: loaderPulse 1s ease-in-out infinite;
}

@keyframes loaderPulse {
  0% { transform: scale(0.8); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.5; }
  100% { transform: scale(0.8); opacity: 1; }
}

/* ===== Scroll Animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-children.active > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.active > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.active > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.active > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.active > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.active > *:nth-child(6) { transition-delay: 0.3s; }

.stagger-children.active > * {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Hero Gradient Animation ===== */
.hero-gradient {
  background: linear-gradient(-45deg, #0a0a0a, #1a0000, #2d0000, #0a0a0a);
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
}

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

/* ===== Floating Particles ===== */
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(220, 38, 38, 0.3);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.3; }
  50% { transform: translateY(-20px) rotate(180deg); opacity: 0.8; }
}

/* ===== Glow Effects ===== */
.glow-red {
  box-shadow: 0 0 40px rgba(220, 38, 38, 0.15), 0 0 80px rgba(220, 38, 38, 0.05);
}

.glow-red-strong {
  box-shadow: 0 0 30px rgba(220, 38, 38, 0.3), 0 0 60px rgba(220, 38, 38, 0.1);
}

/* ===== Glass Morphism ===== */
.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-light {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ===== Card Hover Effects ===== */
.card-lift {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .card-lift:active {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }
  .card-lift:hover {
    transform: none;
    box-shadow: none;
  }
}

/* ===== Magnetic Button ===== */
.btn-magnetic {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.btn-magnetic::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn-magnetic:hover::before {
  transform: translateX(100%);
}

/* ===== Marquee ===== */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== Counter animation ===== */
.counter-number {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ===== Navbar ===== */
.nav-blur {
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-scrolled {
  box-shadow: 0 1px 30px rgba(0, 0, 0, 0.3);
}

/* ===== Mobile Menu Overlay ===== */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 85%;
  max-width: 360px;
  background: #111111;
  z-index: 50;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu.open {
  transform: translateX(0);
}

/* ===== Horizontal Scroll (Mobile) ===== */
.scroll-snap-x {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.scroll-snap-x > * {
  scroll-snap-align: start;
}

/* Hide scrollbar for carousel */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ===== Sticky WhatsApp Button ===== */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: whatsappPulse 2s ease-in-out infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(37, 211, 102, 0.5);
}

@keyframes whatsappPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(37, 211, 102, 0.6); }
}

/* ===== Text Gradient ===== */
.text-gradient {
  background: linear-gradient(135deg, #dc2626 0%, #f87171 50%, #dc2626 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Timeline ===== */
.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, #dc2626, transparent);
  transform: translateX(-50%);
}

@media (max-width: 768px) {
  .timeline-line {
    left: 20px;
  }
}

.timeline-dot {
  width: 16px;
  height: 16px;
  background: #dc2626;
  border-radius: 50%;
  border: 3px solid #0a0a0a;
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.5);
  position: relative;
  z-index: 2;
}

/* ===== Image Parallax ===== */
.parallax-img {
  transition: transform 0.1s linear;
  will-change: transform;
}

/* ===== Process Steps ===== */
.process-connector {
  position: absolute;
  top: 50%;
  right: -2rem;
  width: 4rem;
  height: 2px;
  background: linear-gradient(to right, #dc2626, transparent);
}

@media (max-width: 768px) {
  .process-connector {
    display: none;
  }
}

/* ===== Ripple effect on tap ===== */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(220, 38, 38, 0.3) 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform .5s, opacity 1s;
}

.ripple:active::after {
  transform: scale(0, 0);
  opacity: .3;
  transition: 0s;
}

/* ===== Stats Bar ===== */
.stat-bar {
  height: 4px;
  border-radius: 2px;
  background: #1f1f1f;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #dc2626, #f87171);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-bar-fill.active {
  transform: scaleX(1);
}

/* ===== Video Play Button ===== */
.play-btn {
  width: 80px;
  height: 80px;
  background: rgba(220, 38, 38, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
  animation: playPulse 2s ease-in-out infinite;
}

.play-btn:hover {
  transform: scale(1.1);
  background: #dc2626;
}

@keyframes playPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 0 0 20px rgba(220, 38, 38, 0); }
}

/* ===== Service Icon Bounce ===== */
.service-icon {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.service-icon:hover,
.service-icon:active {
  transform: scale(1.15) rotate(-5deg);
}

/* ===== Testimonial Carousel ===== */
.testimonial-card {
  min-width: 85vw;
  max-width: 400px;
}

@media (min-width: 768px) {
  .testimonial-card {
    min-width: 380px;
  }
}

/* ===== Bottom Sheet (Mobile) ===== */
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #111;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  z-index: 60;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 80vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.bottom-sheet.open {
  transform: translateY(0);
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: #333;
  border-radius: 2px;
  margin: 12px auto;
}

/* ===== Noise Texture Overlay ===== */
.noise-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

/* ===== Focus States (A11y) ===== */
a:focus-visible, button:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== Selection Color ===== */
::selection {
  background: #dc2626;
  color: white;
}

/* ===== Print ===== */
@media print {
  .whatsapp-float, nav, .mobile-menu, .mobile-menu-overlay { display: none !important; }
}
