:root {
  --blue-primary: #0466C3;
  --blue-dark: #034a94;
  --blue-light: #0a84f0;
  --dark: #181818;
  --dark-soft: #2a2a2a;
  --white: #FEFEFE;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--white);
  color: var(--dark);
  overflow-x: hidden;
  line-height: 1.7;
}

body[dir="rtl"] {
  font-family: 'Tajawal', 'Inter', sans-serif;
}

/* Noise texture overlay */
.noise-bg::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0.025;
  z-index: 0;
  pointer-events: none;
  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");
}

/* Scroll reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Stagger children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0.05s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.15s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.25s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.35s; }
.stagger-children .reveal:nth-child(5) { transition-delay: 0.45s; }
.stagger-children .reveal:nth-child(6) { transition-delay: 0.55s; }
.stagger-children .reveal:nth-child(7) { transition-delay: 0.65s; }
.stagger-children .reveal:nth-child(8) { transition-delay: 0.75s; }

/* Gradient mesh background */
.gradient-mesh {
  background:
    radial-gradient(at 20% 30%, rgba(4,102,195,0.08) 0%, transparent 50%),
    radial-gradient(at 80% 70%, rgba(4,102,195,0.05) 0%, transparent 50%),
    radial-gradient(at 50% 50%, rgba(254,254,254,1) 0%, rgba(245,245,245,1) 100%);
}

/* Hero section */
.hero-gradient {
  background: linear-gradient(135deg, var(--dark) 0%, #0d2137 40%, var(--blue-dark) 100%);
  position: relative;
  overflow: hidden;
}
.hero-gradient::after {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 80%; height: 200%;
  background: radial-gradient(ellipse, rgba(4,102,195,0.15) 0%, transparent 60%);
  pointer-events: none;
}

/* Card hover effect */
.card-hover {
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

/* Button styles */
.btn-primary {
  background: var(--blue-primary);
  color: #fff;
  padding: 14px 36px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s ease;
}
.btn-primary:hover {
  background: var(--blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(4,102,195,0.35);
}
.btn-primary:hover::before { left: 100%; }

.btn-outline {
  background: transparent;
  color: var(--blue-primary);
  padding: 14px 36px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid var(--blue-primary);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-outline:hover {
  background: var(--blue-primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(4,102,195,0.25);
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: var(--transition);
  backdrop-filter: blur(0px);
}
.navbar.scrolled {
  background: rgba(254,254,254,0.95);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
  padding: 10px 0;
}
.navbar.scrolled .nav-logo,
.navbar.scrolled .nav-link,
.navbar.scrolled .lang-toggle {
  color: var(--dark);
}
.nav-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: var(--transition);
}
.nav-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  padding: 4px 0;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--blue-primary);
  transition: width 0.3s ease;
}
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }
.nav-link:hover,
.nav-link.active { color: #fff; }
.navbar.scrolled .nav-link:hover,
.navbar.scrolled .nav-link.active { color: var(--blue-primary); }

.lang-toggle {
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}
.lang-toggle:hover {
  background: rgba(255,255,255,0.2);
}
.navbar.scrolled .lang-toggle {
  color: var(--dark);
  background: rgba(4,102,195,0.08);
  border-color: rgba(4,102,195,0.2);
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  top: 0; right: -100%;
  width: 80%;
  max-width: 400px;
  height: 100vh;
  background: var(--white);
  z-index: 2000;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-xl);
  padding: 80px 40px 40px;
}
.mobile-menu.open { right: 0; }
.mobile-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.mobile-overlay.open { opacity: 1; pointer-events: auto; }
.mobile-menu .nav-link {
  color: var(--dark);
  display: block;
  padding: 16px 0;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--gray-200);
}
.mobile-menu .nav-link::after { display: none; }
.mobile-menu .lang-toggle {
  color: var(--dark);
  background: rgba(4,102,195,0.08);
  border-color: rgba(4,102,195,0.2);
  margin-top: 20px;
}

/* Section headers */
.section-label {
  color: var(--blue-primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 12px;
  display: inline-block;
}
.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--dark);
}
.section-title span {
  color: var(--blue-primary);
}
.section-desc {
  font-size: 1.05rem;
  color: var(--gray-500);
  max-width: 600px;
  line-height: 1.8;
}

/* Water ripple animation */
@keyframes ripple {
  0% { transform: scale(1); opacity: 0.3; }
  100% { transform: scale(4); opacity: 0; }
}
.ripple-circle {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(4,102,195,0.2);
  animation: ripple 3s ease-out infinite;
}
.ripple-circle:nth-child(2) { animation-delay: 0.8s; }
.ripple-circle:nth-child(3) { animation-delay: 1.6s; }

/* Floating animation */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}
.float { animation: float 5s ease-in-out infinite; }
.float-delay-1 { animation-delay: 0.5s; }
.float-delay-2 { animation-delay: 1s; }

/* Page header */
.page-header {
  background: linear-gradient(135deg, var(--dark) 0%, #0d2137 50%, var(--blue-dark) 100%);
  padding: 160px 0 100px;
  position: relative;
  overflow: hidden;
}
.page-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(4,102,195,0.3), transparent);
}

/* Footer */
.footer-dark {
  background: var(--dark);
  color: rgba(255,255,255,0.7);
  position: relative;
}
.footer-dark a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: var(--transition);
}
.footer-dark a:hover { color: var(--blue-light); }

/* Smooth scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue-primary); }

/* Icon box */
.icon-box {
  width: 64px; height: 64px;
  background: rgba(4,102,195,0.08);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.card-hover:hover .icon-box {
  background: var(--blue-primary);
}
.card-hover:hover .icon-box svg {
  stroke: #fff;
  fill: none;
}

/* Product card image placeholder */
.product-img {
  height: 240px;
  background: linear-gradient(135deg, rgba(4,102,195,0.08), rgba(4,102,195,0.02));
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Stats counter */
.stat-number {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--blue-primary);
  line-height: 1;
}

/* Divider */
.section-divider {
  width: 60px;
  height: 4px;
  background: var(--blue-primary);
  border-radius: 2px;
}

/* Water drop SVG animation */
@keyframes dropBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.05); }
}
.drop-bounce { animation: dropBounce 2s ease-in-out infinite; }

/* Contact form */
.form-input {
  width: 100%;
  padding: 14px 20px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--white);
  color: var(--dark);
}
.form-input:focus {
  outline: none;
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 4px rgba(4,102,195,0.1);
}
.form-input::placeholder {
  color: var(--gray-400);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 1001;
}
.hamburger span {
  width: 24px;
  height: 2px;
  background: #fff;
  transition: var(--transition);
}
.navbar.scrolled .hamburger span { background: var(--dark); }

/* RTL adjustments */
[dir="rtl"] .nav-link::after {
  left: auto; right: 0;
}
[dir="rtl"] .section-desc {
  text-align: right;
}
[dir="rtl"] .mobile-menu {
  right: auto; left: -100%;
}
[dir="rtl"] .mobile-menu.open {
  left: 0;
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--blue-primary), var(--blue-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Responsive */
@media (max-width: 1024px) {
  .hamburger { display: flex; }
  .desktop-nav { display: none; }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem) !important;
  }
}

/* Timeline */
.timeline-item {
  position: relative;
  padding-left: 40px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 16px; height: 16px;
  background: var(--blue-primary);
  border-radius: 50%;
  border: 3px solid var(--white);
  box-shadow: 0 0 0 3px var(--blue-primary);
}
.timeline-item::after {
  content: '';
  position: absolute;
  left: 7px; top: 32px;
  width: 2px;
  height: calc(100% - 16px);
  background: var(--gray-200);
}
.timeline-item:last-child::after { display: none; }

[dir="rtl"] .timeline-item {
  padding-left: 0;
  padding-right: 40px;
}
[dir="rtl"] .timeline-item::before {
  left: auto; right: 0;
}
[dir="rtl"] .timeline-item::after {
  left: auto; right: 7px;
}

/* Gallery grid */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-item:hover img {
  transform: scale(1.08);
}
.gallery-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 24px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  transform: translateY(100%);
  transition: transform 0.4s ease;
}
.gallery-item:hover .gallery-overlay {
  transform: translateY(0);
}

/* Counter animation */
@keyframes countUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
