/* ============================
   Nile Digital Transformations
   Custom Stylesheet
   ============================ */

/* Google Fonts Import */
@import url("https://fonts.googleapis.com/css2?family=Dancing+Script:wght@600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Aref+Ruqaa:wght@400;700&display=swap");

/* 1. CSS VARIABLES (DESIGN TOKENS) */
:root {
  /* Brand Colors */
  --primary: #0d6efd;
  --accent: #00c2a8;
  --dark: #0b132b;
  --light: #f7f9fc;

  /* Extended Palette */
  --success: #00c2a8;
  --warning: #f59e0b;
  --danger: #dc2626;
  --info: #3b82f6;

  /* Grays */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Light Theme Variables */
  --bg-primary: #ffffff;
  --bg-secondary: var(--gray-50);
  --bg-tertiary: var(--gray-100);
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-tertiary: var(--gray-500);
  --border-color: var(--gray-200);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Spacing Scale */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  --spacing-3xl: 5rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-arabic: "Cairo", "Tajawal", "Noto Sans Arabic", sans-serif;
  --line-height-tight: 1.25;
  --line-height-base: 1.6;
  --line-height-relaxed: 1.8;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary: #111827;
  --bg-secondary: #1f2937;
  --bg-tertiary: #374151;
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-tertiary: #9ca3af;
  --border-color: #374151;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4),
    0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4),
    0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4),
    0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

/* Arabic Typography */
[lang="ar"],
[dir="rtl"] {
  font-family: var(--font-arabic);
  line-height: var(--line-height-relaxed);
}

/* 2. BASE & RESET */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: var(--line-height-base);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color var(--transition-base),
    color var(--transition-base);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent);
}

/* 3. TYPOGRAPHY */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 3rem);
  margin-bottom: var(--spacing-lg);
}

h2 {
  font-size: clamp(2rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.75rem, 3.5vw, 2rem);
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1.125rem;
}

p {
  margin-bottom: var(--spacing-md);
  color: var(--text-secondary);
}

.lead {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 4. LAYOUT UTILITIES */
.section-padding {
  padding: 5rem 0;
}

@media (max-width: 768px) {
  .section-padding {
    padding: 3rem 0;
  }
}

.container-custom {
  max-width: 1320px;
  margin: 0 auto;
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}

/* Skip to content */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  z-index: 9999;
  transition: top var(--transition-fast);
}

.skip-to-content:focus {
  top: 1rem;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* 5. HEADER & NAVIGATION */
.navbar {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-base);
  padding: 0.75rem 0;
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
  padding: 0.5rem 0;
}

.navbar-brand {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  white-space: nowrap;
}

.navbar-brand span {
  font-family: "Dancing Script", cursive;
  font-weight: 700;
  font-size: 1.75rem;
}

[dir="rtl"] .navbar-brand span {
  font-family: "Aref Ruqaa", "Cairo", cursive;
  font-weight: 700;
  font-size: 1.75rem;
}

.navbar-brand:hover {
  color: var(--primary);
}

.navbar-brand svg {
  flex-shrink: 0;
}

.navbar-nav .nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  transition: color var(--transition-fast);
  position: relative;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--primary);
}

.navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width var(--transition-fast);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
  width: 80%;
}

/* Language & Theme Toggles */
.btn-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.btn-toggle:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary);
}

.btn-toggle:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-toggle i {
  font-size: 1rem;
}

/* WhatsApp Button */
.btn-whatsapp {
  background: #25d366;
  color: white;
  border: none;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
  direction: ltr;
}

.btn-whatsapp:hover {
  background: #1eb855;
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-whatsapp i {
  font-size: 1.125rem;
}

/* 6. HERO SECTION */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(135deg, var(--dark) 0%, #1a2332 100%);
  color: white;
  padding: 2rem 0;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><path fill="%2300C2A8" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,165.3C384,171,480,149,576,128C672,107,768,85,864,90.7C960,96,1056,128,1152,133.3L1200,136L1200,600L1152,600C1104,600,1008,600,912,600C816,600,720,600,624,600C528,600,432,600,336,600C240,600,144,600,96,600L48,600L0,600Z"></path></svg>')
    no-repeat bottom;
  background-size: cover;
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero h1 {
  color: white;
  margin-bottom: var(--spacing-lg);
}

.hero .lead {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.5rem;
  margin-bottom: var(--spacing-xl);
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero {
    min-height: 80vh;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .hero-cta .btn {
    width: 100%;
    max-width: 300px;
  }
}

/* 7. BUTTONS */
.btn {
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  text-decoration: none;
  min-height: 40px;
  white-space: nowrap;
}

.btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: #0b5ed7;
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Navbar-specific button adjustments */
.navbar .btn-primary {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-outline-primary {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: white;
}

.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-accent:hover {
  background: #00a891;
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline-light {
  background: transparent;
  border: 2px solid white;
  color: white;
  direction: ltr;
}

.btn-outline-light:hover {
  background: white;
  color: var(--dark);
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.125rem;
}

/* 8. CARDS */
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: all var(--transition-base);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
}

/* Card with automatic height (not stretched) */
.card-auto-height {
  height: auto;
}

.card-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  margin-bottom: var(--spacing-md);
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  color: var(--text-primary);
}

.card-text {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
  flex-grow: 1;
}

.card-link {
  color: var(--primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}

.card-link:hover {
  color: var(--accent);
  gap: 0.75rem;
}

/* Service Card */
.card-service {
  text-align: center;
  position: relative;
  overflow: hidden;
}

.card-service::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

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

/* Case Study Card */
.card-case-study {
  position: relative;
  overflow: hidden;
}

.card-case-study img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  transition: transform var(--transition-slow);
}

.card-case-study:hover img {
  transform: scale(1.05);
}

.card-case-study .card-body {
  padding: var(--spacing-lg);
}

/* 9. BADGES & TAGS */
.badge {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-block;
}

.badge-primary {
  background: var(--primary);
  color: white;
}

.badge-accent {
  background: var(--accent);
  color: white;
}

.badge-light {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

/* Metric Badge */
.metric-badge {
  background: linear-gradient(135deg, var(--accent) 0%, #00e6c0 100%);
  color: white;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 1rem;
  display: inline-block;
  box-shadow: var(--shadow-md);
}

/* Technology Badges */
.tech-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.tech-badge:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* 10. TIMELINE / PROCESS STEPS */
.timeline {
  position: relative;
  padding: var(--spacing-xl) 0;
}

.timeline-step {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  position: relative;
}

.timeline-step:last-child {
  margin-bottom: 0;
}

.timeline-step::before {
  content: "";
  position: absolute;
  left: 32px;
  top: 64px;
  bottom: -48px;
  width: 2px;
  background: var(--border-color);
}

.timeline-step:last-child::before {
  display: none;
}

.timeline-number {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: var(--shadow-lg);
}

.timeline-content h4 {
  margin-bottom: var(--spacing-sm);
}

.timeline-content p {
  color: var(--text-secondary);
}

/* Horizontal Timeline (Desktop) */
@media (min-width: 992px) {
  .timeline-horizontal {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-md);
    position: relative;
  }

  .timeline-horizontal::before {
    content: "";
    position: absolute;
    top: 32px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border-color);
  }

  .timeline-horizontal .timeline-step {
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    margin-bottom: 0;
  }

  .timeline-horizontal .timeline-step::before {
    display: none;
  }
}
/* ===================================
   CAROUSEL - SYMMETRIC CONTROLS
   =================================== */

/* Carousel Container */
.carousel {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 80px;
}

/* Carousel Inner */
.carousel-inner {
  min-height: 420px;
  display: flex;
  align-items: center;
  position: relative;
}

/* Carousel Items */
.carousel-item {
  display: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.carousel-item.active {
  display: block !important;
  opacity: 1 !important;
}

/* Navigation Buttons */
.carousel-control-prev,
.carousel-control-next {
  /* Position */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;

  /* Size */
  width: 52px;
  height: 52px;

  /* Style */
  background: var(--primary);
  border: none;
  border-radius: 50%;

  /* Content */
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;

  /* Effects */
  opacity: 1 !important;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: all var(--transition-base);
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background: var(--accent);
  transform: translateY(-50%) scale(1.15);
  box-shadow: 0 12px 24px rgba(13, 110, 253, 0.3);
}

.carousel-control-prev:focus,
.carousel-control-next:focus {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
}

.carousel-control-prev {
  left: 0;
}
.carousel-control-next {
  right: 0;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  filter: brightness(0) invert(1);
}

/* Indicators - Centered at Bottom */
.carousel-indicators {
  position: static;
  margin: 2.5rem auto 0;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  padding: 0;
  list-style: none;
}

.carousel-indicators button {
  width: 10px;
  height: 10px;
  padding: 0;
  margin: 0;
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: transparent;
  opacity: 0.5;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.carousel-indicators button.active {
  background: var(--primary);
  opacity: 1;
  transform: scale(1.4);
}

.carousel-indicators button:hover {
  opacity: 0.8;
  transform: scale(1.2);
}

/* ===================================
   RESPONSIVE - TABLET & MOBILE
   =================================== */

@media (max-width: 992px) {
  .carousel {
    padding: 0 70px;
  }

  .carousel-control-prev,
  .carousel-control-next {
    width: 48px;
    height: 48px;
    font-size: 1.375rem;
  }
}

@media (max-width: 768px) {
  /* Testimonial Card */
  .testimonial {
    padding: 2rem 1.75rem;
    min-height: 340px;
  }

  /* Icon */
  .testimonial-icon {
    width: 70px;
    height: 70px;
    margin-bottom: 1.5rem;
    font-size: 2.25rem;
  }

  /* Quote */
  .testimonial-quote {
    font-size: 1.0625rem;
    line-height: 1.7;
    margin-bottom: 1.75rem;
  }

  /* Author */
  .testimonial-author {
    font-size: 1.0625rem;
  }

  .testimonial-role {
    font-size: 0.875rem;
  }

  .testimonial-author-wrapper {
    padding-top: 1.25rem;
  }

  /* Carousel */
  .carousel {
    padding: 0 55px;
  }

  .carousel-inner {
    min-height: 380px;
  }

  /* Controls */
  .carousel-control-prev,
  .carousel-control-next {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }

  /* Indicators */
  .carousel-indicators {
    margin-top: 2rem;
    gap: 0.625rem;
  }

  .carousel-indicators button {
    width: 9px;
    height: 9px;
  }
}

@media (max-width: 576px) {
  /* Testimonial */
  .testimonial {
    padding: 1.75rem 1.5rem;
    min-height: 320px;
  }

  /* Icon */
  .testimonial-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1.25rem;
    font-size: 2rem;
  }

  /* Quote */
  .testimonial-quote {
    font-size: 1rem;
  }

  /* Carousel */
  .carousel {
    padding: 0 50px;
  }

  /* Controls */
  .carousel-control-prev,
  .carousel-control-next {
    width: 40px;
    height: 40px;
    font-size: 1.125rem;
  }
}

/* 12. ACCORDION / FAQ */
.accordion-button {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text-primary);
  background: var(--bg-primary);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.accordion-button::after {
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 0;
}

[dir="rtl"] .accordion-button::after {
  margin-left: 0;
  margin-right: auto;
}

.accordion-button:not(.collapsed) {
  background: var(--primary);
  color: white;
}

.accordion-button:not(.collapsed)::after {
  filter: brightness(0) invert(1);
}

.accordion-button:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.accordion-body {
  padding: 1.5rem;
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}

/* 13. FORMS */
.form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-control,
.form-select {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  min-height: 44px;
}

.form-control:focus,
.form-select:focus {
  background: var(--bg-primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  color: var(--text-primary);
}

.form-control::placeholder {
  color: var(--text-tertiary);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.invalid-feedback {
  color: var(--danger);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.form-control.is-invalid,
.form-select.is-invalid {
  border-color: var(--danger);
}

/* 14. FOOTER */
.footer {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.8);
  padding: 4rem 0 2rem;
  margin-top: 5rem;
}

.footer h5 {
  color: white;
  margin-bottom: var(--spacing-md);
  font-size: 1.25rem;
}

.footer a {
  color: rgba(255, 255, 255, 0.8);
  transition: color var(--transition-fast);
  display: block;
  margin-bottom: 0.5rem;
}

.footer a:hover {
  color: var(--accent);
  padding-left: 0.5rem;
}

[dir="rtl"] .footer a:hover {
  padding-left: 0;
  padding-right: 0.5rem;
}

/* Phone and email links always LTR */
.footer a[href^="tel:"],
.footer a[href^="mailto:"] {
  direction: ltr;
  text-align: left;
}

[dir="rtl"] .footer a[href^="tel:"],
[dir="rtl"] .footer a[href^="mailto:"] {
  text-align: right;
}

.footer-social {
  display: flex;
  gap: 1rem;
  margin-top: var(--spacing-md);
}

.footer-social a {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0;
}

.footer-social a:hover {
  background: var(--accent);
  color: white;
  padding-left: 0;
  transform: translateY(-4px);
}

.company-name-link {
  color: #00e5cc;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 600;
  font-family: "Dancing Script", cursive;
  font-size: 1.25rem;
}

[dir="rtl"] .company-name-link {
  font-family: "Aref Ruqaa", "Cairo", cursive;
  font-size: 1.25rem;
}

.footer-bottom p {
  white-space: nowrap;
  overflow: hidden;
  display: inline;
  margin: 0;
}

.company-name-link:hover {
  color: #00fff5;
  text-decoration: none;
  text-shadow: 0 0 10px rgba(0, 229, 204, 0.3);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

/* 15. BACK TO TOP */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.25);
}

.back-to-top:focus {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

[dir="rtl"] .back-to-top {
  right: auto;
  left: 2rem;
}

/* 16. COOKIE CONSENT */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border-top: 2px solid var(--primary);
  padding: 1.5rem;
  box-shadow: var(--shadow-xl);
  z-index: 9999;
  display: none;
}

.cookie-consent.show {
  display: block;
}

.cookie-consent-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.cookie-consent p {
  margin: 0;
  flex: 1;
  min-width: 250px;
}

/* 17. OFFCANVAS */
.offcanvas {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.offcanvas-header {
  border-bottom: 1px solid var(--border-color);
}

.offcanvas-title {
  color: var(--text-primary);
  font-weight: 700;
}

.btn-close {
  filter: var(--bs-btn-close-filter, none);
}

[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* 18. INDUSTRIES GRID */
.industries-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.industry-chip {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.industry-chip:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* 19. STATS / METRICS */
.stat-card {
  text-align: center;
  padding: var(--spacing-lg);
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: var(--spacing-sm);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
}

/* 20. CTA STRIP */
.cta-strip {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
  margin: 5rem 0;
  border-radius: var(--radius-lg);
}

.cta-strip h2 {
  color: white;
  margin-bottom: var(--spacing-lg);
}

.cta-strip p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.25rem;
  margin-bottom: var(--spacing-xl);
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

.cta-buttons .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: fit-content;
}

.cta-buttons .btn i {
  flex-shrink: 0;
}

.cta-buttons .btn span {
  white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .cta-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-buttons .btn {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    justify-content: center;
  }
}

/* 21. RTL OVERRIDES - COMPREHENSIVE */

/* ===================================
   RTL Direction Overrides
   Preserves all theme colors, spacing, and styles
   Only flips directional properties
   =================================== */

/* Navigation */
[dir="rtl"] .navbar-nav {
  text-align: right;
}

[dir="rtl"] .navbar-nav .nav-link::after {
  left: 50%;
  right: auto;
}

[dir="rtl"] .navbar-toggler {
  margin-left: 0;
  margin-right: auto;
}

/* Buttons & Icons */
[dir="rtl"] .btn i {
  margin-left: 0.375rem;
  margin-right: 0;
}

[dir="rtl"] .btn i:first-child {
  margin-left: 0;
  margin-right: 0.375rem;
}

[dir="rtl"] .btn-toggle {
  flex-direction: row-reverse;
}

/* Hero Section */
[dir="rtl"] .hero-cta {
  flex-direction: row-reverse;
}

/* Cards */
[dir="rtl"] .card-link {
  flex-direction: row-reverse;
}

[dir="rtl"] .card-link i {
  margin-left: 0;
  margin-right: 0.5rem;
}

/* Badges */
[dir="rtl"] .badge {
  margin-left: 0.5rem;
  margin-right: 0;
}

[dir="rtl"] .tech-badge i,
[dir="rtl"] .industry-chip i {
  margin-left: 0.5rem;
  margin-right: 0;
}

/* Timeline */
[dir="rtl"] .timeline-step {
  flex-direction: row-reverse;
}

[dir="rtl"] .timeline-step::before {
  left: auto;
  right: 32px;
}

/* Horizontal Timeline RTL Fix */
@media (min-width: 992px) {
  [dir="rtl"] .timeline-horizontal .timeline-step {
    flex-direction: column;
  }
}

/* Testimonials */
[dir="rtl"] .testimonial-quote::before {
  left: auto;
  right: 20px;
}

/* Footer */
[dir="rtl"] .footer a:hover {
  padding-left: 0;
  padding-right: 0.5rem;
}

[dir="rtl"] .footer-social {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

/* Back to Top Button */
[dir="rtl"] .back-to-top {
  right: auto;
  left: 2rem;
}

/* Forms */
[dir="rtl"] .form-label {
  text-align: right;
}

[dir="rtl"] .form-control,
[dir="rtl"] .form-select {
  text-align: right;
}

/* Accordion */
[dir="rtl"] .accordion-button::after {
  margin-left: 0;
  margin-right: auto;
}

/* Offcanvas */
[dir="rtl"] .offcanvas-end {
  right: auto;
  left: 0;
  transform: translateX(-100%);
}

[dir="rtl"] .offcanvas-end.show {
  transform: translateX(0);
}

/* Lists & Flex Items */
[dir="rtl"] .d-flex {
  direction: rtl;
}

[dir="rtl"] ul,
[dir="rtl"] ol {
  padding-left: 0;
  padding-right: 2rem;
}

/* Bootstrap Grid RTL Support */
[dir="rtl"] .row {
  --bs-gutter-x: 1.5rem;
}

[dir="rtl"] .ms-1 {
  margin-right: 0.25rem !important;
  margin-left: 0 !important;
}
[dir="rtl"] .ms-2 {
  margin-right: 0.5rem !important;
  margin-left: 0 !important;
}
[dir="rtl"] .ms-3 {
  margin-right: 1rem !important;
  margin-left: 0 !important;
}
[dir="rtl"] .ms-auto {
  margin-right: auto !important;
  margin-left: 0 !important;
}

[dir="rtl"] .me-1 {
  margin-left: 0.25rem !important;
  margin-right: 0 !important;
}
[dir="rtl"] .me-2 {
  margin-left: 0.5rem !important;
  margin-right: 0 !important;
}
[dir="rtl"] .me-3 {
  margin-left: 1rem !important;
  margin-right: 0 !important;
}
[dir="rtl"] .me-auto {
  margin-left: auto !important;
  margin-right: 0 !important;
}

[dir="rtl"] .ps-1 {
  padding-right: 0.25rem !important;
  padding-left: 0 !important;
}
[dir="rtl"] .ps-2 {
  padding-right: 0.5rem !important;
  padding-left: 0 !important;
}
[dir="rtl"] .ps-3 {
  padding-right: 1rem !important;
  padding-left: 0 !important;
}

[dir="rtl"] .pe-1 {
  padding-left: 0.25rem !important;
  padding-right: 0 !important;
}
[dir="rtl"] .pe-2 {
  padding-left: 0.5rem !important;
  padding-right: 0 !important;
}
[dir="rtl"] .pe-3 {
  padding-left: 1rem !important;
  padding-right: 0 !important;
}

[dir="rtl"] .text-start {
  text-align: right !important;
}
[dir="rtl"] .text-end {
  text-align: left !important;
}

/* Float Utilities */
[dir="rtl"] .float-start {
  float: right !important;
}
[dir="rtl"] .float-end {
  float: left !important;
}

/* Border Utilities */
[dir="rtl"] .border-start {
  border-left: 0 !important;
  border-right: var(--bs-border-width) var(--bs-border-style)
    var(--bs-border-color) !important;
}
[dir="rtl"] .border-end {
  border-right: 0 !important;
  border-left: var(--bs-border-width) var(--bs-border-style)
    var(--bs-border-color) !important;
}

/* Dropdown Menus */
[dir="rtl"] .dropdown-menu {
  right: 0;
  left: auto;
  text-align: right;
}

[dir="rtl"] .dropdown-menu-end {
  right: auto;
  left: 0;
}

/* Breadcrumbs */
[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
  float: right;
  padding-left: 0;
  padding-right: 0.5rem;
  content: "/";
}

/* Input Groups */
[dir="rtl"] .input-group > :not(:first-child) {
  margin-left: 0;
  margin-right: -1px;
  border-top-left-radius: 0.375rem;
  border-bottom-left-radius: 0.375rem;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

[dir="rtl"] .input-group > :not(:last-child) {
  border-top-right-radius: 0.375rem;
  border-bottom-right-radius: 0.375rem;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Modal */
[dir="rtl"] .modal-header .btn-close {
  margin: -0.5rem auto -0.5rem -0.5rem;
}

/* Carousel Controls */
[dir="rtl"] .carousel-control-prev {
  left: auto;
  right: 0;
}

[dir="rtl"] .carousel-control-next {
  right: auto;
  left: 0;
}

/* Alert Close Button */
[dir="rtl"] .alert .btn-close {
  left: 0;
  right: auto;
}

/* Checkbox & Radio */
[dir="rtl"] .form-check {
  padding-left: 0;
  padding-right: 1.5em;
}

[dir="rtl"] .form-check-input {
  float: right;
  margin-left: 0;
  margin-right: -1.5em;
}

/* List Groups */
[dir="rtl"] .list-group {
  padding-left: 0;
  padding-right: 0;
}

/* Pagination */
[dir="rtl"] .pagination {
  flex-direction: row-reverse;
}

/* Progress Bar */
[dir="rtl"] .progress-bar {
  direction: ltr;
}

/* 22. FOCUS VISIBLE */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* 23. LOADING STATES */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* 24. ANIMATIONS */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Language Transition Animation */
@keyframes fadeInContent {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

[lang] {
  animation: fadeInContent 0.3s ease-in-out;
}

/* Smooth Content Transition on Language Change */
.section-padding,
.card,
.testimonial {
  transition: opacity 0.2s ease-in-out;
}

/* Enhanced Focus States for Accessibility */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

/* Skip Link Enhancement */
.skip-to-content:focus {
  top: 1rem;
  z-index: 10000;
  box-shadow: var(--shadow-xl);
}

/* Improved Loading States */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Enhanced Hover Effects */
.card,
.industry-chip,
.tech-badge {
  will-change: transform;
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .carousel-item {
    transition: none !important;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .btn,
  .card,
  .testimonial {
    border: 2px solid currentColor;
  }

  .carousel-control-prev,
  .carousel-control-next {
    border: 3px solid white;
  }
}

/* 26. ENHANCED FAQ SECTION */
.faq-search-container {
  max-width: 600px;
  margin: 0 auto 2rem;
}

.faq-search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  transition: all var(--transition-base);
}

.faq-search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.faq-search-icon {
  color: var(--text-tertiary);
  font-size: 1.25rem;
  margin-right: 1rem;
  transition: color var(--transition-fast);
}

.faq-search-box:focus-within .faq-search-icon {
  color: var(--primary);
}

.faq-search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 1.125rem;
  outline: none;
}

.faq-search-input::placeholder {
  color: var(--text-tertiary);
}

.faq-search-clear {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.25rem;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.faq-search-clear:hover {
  color: var(--danger);
  background: var(--bg-tertiary);
}

.faq-accordion {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.faq-item {
  border: none;
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-base);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item:hover {
  background: var(--bg-tertiary);
}

.faq-button {
  background: var(--bg-primary);
  border: none;
  padding: 1.5rem 2rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.faq-button:not(.collapsed) {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.faq-button:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.faq-question-content {
  display: flex;
  align-items: center;
  width: 100%;
}

.faq-question-icon {
  font-size: 1.5rem;
  margin-right: 1rem;
  color: var(--primary);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.faq-button:not(.collapsed) .faq-question-icon {
  color: white;
}

.faq-question-text {
  font-size: 1.125rem;
  line-height: 1.5;
  text-align: left;
}

.faq-answer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 0;
}

.faq-answer-content {
  display: flex;
  align-items: flex-start;
  padding: 1.5rem 2rem;
}

.faq-answer-icon {
  color: var(--accent);
  font-size: 1.25rem;
  margin-right: 1rem;
  margin-top: 0.125rem;
  flex-shrink: 0;
}

.faq-answer-text {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 1rem;
}

/* FAQ Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.faq-item {
  animation: fadeInUp 0.3s ease;
}

/* FAQ Responsive Design */
@media (max-width: 768px) {
  .faq-button {
    padding: 1.25rem 1.5rem;
  }

  .faq-question-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .faq-question-icon {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }

  .faq-answer-content {
    padding: 1.25rem 1.5rem;
    flex-direction: column;
  }

  .faq-answer-icon {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }

  .faq-search-box {
    padding: 0.875rem 1.25rem;
  }

  .faq-search-input {
    font-size: 1rem;
  }
}

/* Dark theme specific FAQ adjustments */
[data-theme="dark"] .faq-search-box {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-theme="dark"] .faq-button {
  background: var(--bg-primary);
  color: var(--text-primary);
}

[data-theme="dark"] .faq-answer {
  background: var(--bg-secondary);
}

[data-theme="dark"] .faq-item:hover {
  background: var(--bg-tertiary);
}

/* 25. RESPONSIVE NAVBAR BREAKPOINTS */
@media (max-width: 1399px) {
  .navbar-nav .nav-link {
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
  }

  .btn-toggle {
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
  }

  .navbar .btn-primary {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
  }
}

@media (max-width: 1299px) {
  .navbar-brand {
    font-size: 1.25rem;
    gap: 0.5rem;
  }

  .navbar-nav .nav-link {
    padding: 0.5rem 0.5rem;
  }
}

@media (min-width: 1200px) and (max-width: 1399px) {
  /* Show WhatsApp button at XL breakpoint */
  .btn-whatsapp {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }
}

/* 26. PHONE NUMBER DIRECTION FIX */
.cta-buttons span[dir="ltr"],
.cta-strip span[dir="ltr"],
.btn span[dir="ltr"] {
  direction: ltr !important;
  unicode-bidi: bidi-override !important;
  display: inline-block !important;
  text-align: left !important;
}

/* Force phone numbers to display LTR even in RTL context */
[data-i18n="ctaWhatsApp"] span[dir="ltr"],
[data-i18n="ctaCall"] span[dir="ltr"] {
  direction: ltr !important;
  unicode-bidi: bidi-override !important;
  display: inline-block !important;
  text-align: left !important;
}

/* 27. PRINT STYLES */
@media print {
  .navbar,
  .footer,
  .back-to-top,
  .cookie-consent {
    display: none;
  }

  body {
    color: black;
    background: white;
  }

  a {
    text-decoration: underline;
  }
}
