:root {
  /* Theme Colors */
  --primary-color: #0B3D91; /* Deep Blue */
  --primary-dark: #072b68;
  --secondary-color: #ffffff; /* White */
  --accent-color: #FACC15; /* Yellow Accent */
  --accent-hover: #eab308;
  --bg-color: #F8FAFC; /* Light Gray/Blue Background */
  --text-dark: #0F172A; /* Slate 900 */
  --text-light: #475569; /* Slate 600 */

  /* Glassmorphism System */
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 10px 30px -5px rgba(11, 61, 145, 0.1);
  --glass-glow: 0 0 20px rgba(250, 204, 21, 0.05);
}

/* Base Body Styles */
body {
  background-color: var(--bg-color);
  color: var(--text-dark);
  overflow-x: hidden;
  position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Fonts and Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.02em;
}

.text-white h1, .text-white h2, .text-white h3, .text-white h4, .text-white h5, .text-white h6 {
  color: inherit;
}

.font-cairo {
  font-family: 'Cairo', sans-serif !important;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 20px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -10px rgba(11, 61, 145, 0.2);
  border-color: rgba(250, 204, 21, 0.3);
}

/* Navbar Enhancements */
.navbar-custom {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 18px 0;
  transition: all 0.4s ease;
}

.navbar-custom.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
  padding: 12px 0;
}

.navbar-custom .nav-link {
  color: var(--primary-color);
  font-weight: 600;
  margin: 0 12px;
  position: relative;
  transition: color 0.3s ease;
}

.navbar-custom .nav-link:hover, 
.navbar-custom .nav-link.active {
  color: var(--primary-dark);
}

.navbar-custom .nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent-color);
  transition: width 0.3s ease;
}

.navbar-custom .nav-link:hover::after, 
.navbar-custom .nav-link.active::after {
  width: 100%;
}

/* Hero Section slider */
.hero-section {
  position: relative;
  height: 90vh;
  min-height: 650px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #020617;
  padding-top: 85px;
}

.hero-bg-carousel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  background-size: cover;
  background-position: center;
  transition: opacity 1.5s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(11, 61, 145, 0.9) 0%, rgba(15, 23, 42, 0.7) 100%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 10;
  color: var(--secondary-color);
}

.hero-content h1 {
  color: var(--secondary-color);
  font-size: 3.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Buttons */
.btn-primary-custom {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  border: none;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(11, 61, 145, 0.35);
}

.btn-primary-custom:hover {
  background-color: var(--primary-dark);
  color: var(--secondary-color);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(11, 61, 145, 0.5);
}

.btn-accent {
  background-color: var(--accent-color);
  color: var(--primary-color);
  border: none;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(250, 204, 21, 0.35);
}

.btn-accent:hover {
  background-color: var(--accent-hover);
  color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(250, 204, 21, 0.5);
}

.btn-secondary-custom {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-secondary-custom:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

/* Brand Marquee Slider */
.brand-marquee-container {
  overflow: hidden;
  background: #fff;
  padding: 30px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.brand-marquee-inner {
  display: flex;
  width: 200%;
  animation: marquee 12s linear infinite;
}

.brand-logo-item {
  width: 12.5%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
}

.brand-logo-item img {
  max-height: 100px; /* increased from 50px */
  width: auto;
  max-width: 160px;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: all 0.3s ease;
}

.brand-logo-item img:hover {
  filter: grayscale(0%);
  opacity: 1;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Service Card Styles */
.service-icon-box {
  width: 70px;
  height: 70px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(11, 61, 145, 0.1) 0%, rgba(11, 61, 145, 0.02) 100%);
  border: 1px solid rgba(11, 61, 145, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
  transition: all 0.3s ease;
}

.glass-card:hover .service-icon-box {
  background: var(--primary-color);
  color: #fff !important;
  transform: scale(1.1) rotate(5deg);
}

.glass-card:hover .service-icon-box i {
  color: #fff !important;
}

/* Floating WhatsApp Chat Widget */
.whatsapp-chat-container {
  position: fixed;
  bottom: 40px;
  right: 40px;
  z-index: 1000;
}

.whatsapp-chat-trigger {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background-color: #25D366;
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.whatsapp-chat-trigger i {
  color: #fff;
  font-size: 32px;
}

.whatsapp-chat-trigger:hover {
  transform: scale(1.1);
}

.pulse-indicator {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 15px;
  height: 15px;
  background: #EF4444;
  border: 3px solid #fff;
  border-radius: 50%;
}

.whatsapp-chat-popup {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 320px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  background: #fff;
}

.wa-popup-header {
  background: var(--primary-color);
  color: #fff;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  position: relative;
}

.wa-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.wa-avatar i {
  font-size: 20px;
  color: var(--accent-color);
}

.wa-user-info h6 {
  margin: 0;
  color: #fff;
  font-weight: 600;
}

.wa-user-info span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}

.wa-close-btn {
  position: absolute;
  right: 15px;
  top: 15px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.7;
}

.wa-close-btn:hover {
  opacity: 1;
}

.wa-popup-body {
  padding: 20px;
  background: #F1F5F9;
}

.wa-message.bubble {
  background: #fff;
  padding: 12px 15px;
  border-radius: 0 16px 16px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.wa-message.bubble p {
  margin: 0;
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.5;
}

.wa-popup-footer {
  padding: 15px 20px;
  background: #fff;
}

/* Testimonial slider custom styling */
.testimonial-card {
  padding: 40px;
  text-align: center;
}

.testimonial-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(11, 61, 145, 0.2);
}

/* Footer Section */
.footer {
  background-color: #051630;
  color: var(--secondary-color);
  padding: 80px 0 20px;
  border-top: 2px solid rgba(250, 204, 21, 0.3);
}

.footer h5 {
  color: var(--accent-color);
  font-weight: 700;
  margin-bottom: 25px;
  position: relative;
}

.footer h5::after {
  content: '';
  position: absolute;
  width: 35px;
  height: 2px;
  bottom: -8px;
  left: 0;
  background-color: var(--accent-color);
}

body[dir="rtl"] .footer h5::after {
  left: auto;
  right: 0;
}

.footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer a:hover {
  color: var(--accent-color);
  padding-left: 5px;
}

body[dir="rtl"] .footer a:hover {
  padding-left: 0;
  padding-right: 5px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 50px;
  padding-top: 25px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Scroll Fade in Animations */
.fade-in-up {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Arabic Specific RTL Adjustments */
body[dir="rtl"] .navbar-nav {
  padding-right: 0;
}

body[dir="rtl"] .whatsapp-chat-container {
  right: auto;
  left: 40px;
}

body[dir="rtl"] .whatsapp-chat-popup {
  right: auto;
  left: 0;
}

body[dir="rtl"] .wa-avatar {
  margin-right: 0;
  margin-left: 12px;
}

body[dir="rtl"] .wa-close-btn {
  right: auto;
  left: 15px;
}

body[dir="rtl"] .wa-message.bubble {
  border-radius: 16px 0 16px 16px;
}

/* =========================================
   Responsive Mobile Optimizations
   ========================================= */
@media (max-width: 991px) {
  .hero-content h1 {
    font-size: 2.8rem;
  }
}

@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.2rem;
    line-height: 1.2;
  }

  .display-4 {
    font-size: 2.2rem;
  }
  
  .hero-section {
    min-height: 550px;
    height: auto;
    padding-top: 130px;
    padding-bottom: 60px;
    align-items: center;
  }

  .hero-content {
    padding-top: 15px;
  }
  
  .glass-card {
    padding: 20px !important;
  }

  .footer {
    padding: 50px 0 20px;
  }
  
  .brand-logo-item {
    width: 25%;
  }
  
  .whatsapp-chat-container {
    bottom: 20px;
    right: 20px;
  }

  body[dir="rtl"] .whatsapp-chat-container {
    left: 20px;
    right: auto;
  }

  .whatsapp-chat-popup {
    width: 290px;
    bottom: 80px;
    right: -10px;
  }

  body[dir="rtl"] .whatsapp-chat-popup {
    left: -10px;
    right: auto;
  }
}

@media (max-width: 576px) {
  .hero-section {
    padding-top: 120px;
    padding-bottom: 50px;
    min-height: auto;
  }

  .hero-content {
    padding-top: 10px;
  }

  .hero-content h1 {
    font-size: 1.8rem;
    line-height: 1.25;
  }

  .hero-content .lead {
    font-size: 1rem;
  }

  .brand-logo-item {
    width: 33.33%;
  }

  /* Make buttons full width on small mobile screens */
  .hero-content .btn,
  .whatsapp-chat-container .btn {
    width: 100%;
    margin-bottom: 10px;
    display: block;
  }

  .hero-content .d-flex {
    flex-direction: column;
  }
}