/* Arabic RTL Styles for Lambda Tech */

/* RTL Direction */
html[dir="rtl"],
body.rtl {
  direction: rtl;
  text-align: right;
}

/* Arabic Font */
body.rtl {
  font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Navigation RTL */
body.rtl .navbar-brand {
  margin-right: 0;
  margin-left: auto;
}

body.rtl .navbar-nav {
  margin-right: 0;
  margin-left: auto;
}

body.rtl .nav-item {
  margin-left: 0;
  margin-right: 0;
}

body.rtl .navbar-toggler {
  margin-left: 0;
  margin-right: auto;
}

/* Dropdown Menu RTL */
body.rtl .menu-links {
  left: auto;
  right: 0;
}

/* Bootstrap RTL Adjustments */
body.rtl .ms-auto {
  margin-left: 0 !important;
  margin-right: auto !important;
}

body.rtl .me-auto {
  margin-right: 0 !important;
  margin-left: auto !important;
}

body.rtl .text-end {
  text-align: left !important;
}

body.rtl .text-start {
  text-align: right !important;
}

/* Float adjustments */
body.rtl .float-end {
  float: left !important;
}

body.rtl .float-start {
  float: right !important;
}

/* Padding/Margin RTL */
body.rtl .ps-1 { padding-left: 0 !important; padding-right: 0.25rem !important; }
body.rtl .ps-2 { padding-left: 0 !important; padding-right: 0.5rem !important; }
body.rtl .ps-3 { padding-left: 0 !important; padding-right: 1rem !important; }
body.rtl .ps-4 { padding-left: 0 !important; padding-right: 1.5rem !important; }
body.rtl .ps-5 { padding-left: 0 !important; padding-right: 3rem !important; }

body.rtl .pe-1 { padding-right: 0 !important; padding-left: 0.25rem !important; }
body.rtl .pe-2 { padding-right: 0 !important; padding-left: 0.5rem !important; }
body.rtl .pe-3 { padding-right: 0 !important; padding-left: 1rem !important; }
body.rtl .pe-4 { padding-right: 0 !important; padding-left: 1.5rem !important; }
body.rtl .pe-5 { padding-right: 0 !important; padding-left: 3rem !important; }

body.rtl .ms-1 { margin-left: 0 !important; margin-right: 0.25rem !important; }
body.rtl .ms-2 { margin-left: 0 !important; margin-right: 0.5rem !important; }
body.rtl .ms-3 { margin-left: 0 !important; margin-right: 1rem !important; }
body.rtl .ms-4 { margin-left: 0 !important; margin-right: 1.5rem !important; }
body.rtl .ms-5 { margin-left: 0 !important; margin-right: 3rem !important; }

body.rtl .me-1 { margin-right: 0 !important; margin-left: 0.25rem !important; }
body.rtl .me-2 { margin-right: 0 !important; margin-left: 0.5rem !important; }
body.rtl .me-3 { margin-right: 0 !important; margin-left: 1rem !important; }
body.rtl .me-4 { margin-right: 0 !important; margin-left: 1.5rem !important; }
body.rtl .me-5 { margin-right: 0 !important; margin-left: 3rem !important; }

/* Icons RTL - Arrows flip direction */
body.rtl .fa-long-arrow-right:before {
  content: "\f177"; /* arrow-left */
}

body.rtl .fa-arrow-right:before {
  content: "\f060"; /* arrow-left */
}

/* LTR - Keep right arrows, flip left arrows to right */
body.ltr .fa-arrow-left:before {
  content: "\f061"; /* arrow-right */
}

body.ltr .fa-long-arrow-left:before {
  content: "\f178"; /* arrow-right */
}

/* Services Icons RTL */
body.rtl .services-icon {
  margin-right: 0;
  margin-left: -31px;
}

body.rtl .main-desc {
  flex-direction: row-reverse;
}

/* Footer RTL */
body.rtl .footer_logo {
  float: right;
}

body.rtl .social_icons li {
  float: left;
}

body.rtl .social_icons li a {
  margin: 0 0 0 8px;
}

/* Footer Column Top Alignment */
footer .row {
  align-items: flex-start;
}

/* Breadcrumb RTL */
body.rtl .bread .d-flex {
  flex-direction: row-reverse;
}

/* Language Switcher */
.language-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 20px;
}

body.rtl .language-switcher {
  margin-left: 0;
  margin-right: 20px;
}

.lang-btn {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.lang-btn:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
}

.lang-btn.active {
  background: #FB7D13;
  border-color: #FB7D13;
  color: white;
}

/* WhatsApp Floating Button RTL */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #25D366;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  z-index: 1000;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
}

body.rtl .whatsapp-float {
  right: auto;
  left: 30px;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

@keyframes pulse {
  0% {
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  }
  50% {
    box-shadow: 0 4px 30px rgba(37, 211, 102, 0.7);
  }
  100% {
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  }
}

/* Arabic Typography */
body.rtl h1,
body.rtl h2,
body.rtl h3,
body.rtl h4,
body.rtl h5,
body.rtl h6 {
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
}

body.rtl p,
body.rtl span,
body.rtl a,
body.rtl li {
  font-family: 'Cairo', sans-serif;
}

/* Improve Arabic readability */
body.rtl {
  line-height: 1.8;
  letter-spacing: 0;
}

/* Form inputs RTL */
body.rtl input,
body.rtl textarea,
body.rtl select {
  text-align: right;
  direction: rtl;
}

body.rtl .input input,
body.rtl .textarea textarea {
  padding-right: 46px;
  padding-left: 10px;
}

body.rtl .icon-append {
  right: auto;
  left: 5px;
  border-left: none;
  border-right-width: 1px;
  border-right-style: solid;
  padding-left: 0;
  padding-right: 3px;
}

/* Slider RTL */
body.rtl .swiper-button-next {
  left: 10px;
  right: auto;
}

body.rtl .swiper-button-prev {
  right: 10px;
  left: auto;
}

body.rtl .swiper-button-next:after {
  content: 'prev';
}

body.rtl .swiper-button-prev:after {
  content: 'next';
}

/* Ensure proper text rendering for Arabic */
body.rtl * {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Numbers stay LTR in Arabic */
body.rtl .count-number,
body.rtl .counter-value {
  direction: ltr;
  display: inline-block;
}

/* Testimonial cards RTL/LTR */
body.rtl .testimonial-card {
  text-align: right;
}

body.ltr .testimonial-card {
  text-align: left;
}

body.rtl .testimonial-stars {
  justify-content: flex-end;
}

body.ltr .testimonial-stars {
  justify-content: flex-start;
}

/* Footer Section Title Underlines RTL/LTR */
body.rtl footer h5 {
  text-align: right;
}

body.ltr footer h5 {
  text-align: left;
}

body.rtl footer h5 div {
  right: 0 !important;
  left: auto !important;
}

body.ltr footer h5 div {
  left: 0 !important;
  right: auto !important;
}

/* Footer Social Icons Alignment */
footer .social-icons-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start !important;
}

body.ltr footer .social_icons,
body.ltr footer .social-icons-container {
  justify-content: flex-start !important;
}

body.rtl footer .social_icons,
body.rtl footer .social-icons-container {
  justify-content: flex-start !important;
}

/* Copyright Section Alignment */
body.ltr footer .text-md-end {
  text-align: left !important;
}

body.rtl footer .text-md-start {
  text-align: right !important;
}

/* Mobile Navigation RTL */
@media (max-width: 991px) {
  body.rtl .navbar-collapse {
    text-align: right;
  }

  body.rtl .nav-item {
    text-align: right;
  }
}

/* Breadcrumb Fix - Prevent Overlap */
.breadcrumb {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  color: #6c757d;
}

body.rtl .breadcrumb-item + .breadcrumb-item::before {
  content: "\\";
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

body.ltr .breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

/* Sticky Navbar */
.navbar.sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  animation: slideDown 0.3s ease-out;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}
