/* Language Toggle Button */
.language-toggle {
  margin-right: 1rem;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.lang-text {
  display: inline-block;
  transition: transform 0.3s ease;
}

/* RTL Styles */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] * {
  font-family: 'Noto Sans Arabic', 'Inter', sans-serif;
}

/* Header RTL */
[dir="rtl"] .header-container {
  flex-direction: row-reverse;
}

[dir="rtl"] .nav-list {
  flex-direction: row-reverse;
}

[dir="rtl"] .header-buttons {
  flex-direction: row-reverse;
}

[dir="rtl"] .language-toggle {
  margin-right: 0;
  margin-left: 1rem;
}

/* Hero Section RTL */
[dir="rtl"] .hero-content {
  text-align: right;
}

[dir="rtl"] .hero-title {
  text-align: right;
}

[dir="rtl"] .hero-subtitle {
  text-align: right;
}

/* Companies Section RTL */
[dir="rtl"] .companies-logos {
  flex-direction: row-reverse;
}

/* About Section RTL */
[dir="rtl"] .about-content {
  flex-direction: row-reverse;
}

[dir="rtl"] .about-badge-title {
  align-items: flex-end;
}

[dir="rtl"] .about-text-content {
  text-align: right;
}

/* Services Section RTL */
[dir="rtl"] .services-grid {
  direction: rtl;
}

[dir="rtl"] .service-card {
  text-align: right;
}

[dir="rtl"] .service-icon {
  margin-left: 0;
  margin-right: auto;
}

/* Projects Section RTL */
[dir="rtl"] .project-filters {
  flex-direction: row-reverse;
}

[dir="rtl"] .projects-grid {
  direction: rtl;
}

[dir="rtl"] .project-overlay {
  text-align: right;
}

[dir="rtl"] .project-icons {
  justify-content: flex-end;
}

/* Footer RTL */
[dir="rtl"] .footer-content {
  flex-direction: row-reverse;
}

[dir="rtl"] .footer-section {
  text-align: right;
}

[dir="rtl"] .footer-nav ul {
  text-align: right;
}

[dir="rtl"] .contact-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .contact-item svg {
  margin-left: 0.5rem;
  margin-right: 0;
}

[dir="rtl"] .footer-bottom {
  flex-direction: row-reverse;
}

[dir="rtl"] .social-links {
  flex-direction: row-reverse;
}

[dir="rtl"] .store-icons {
  flex-direction: row-reverse;
}

/* Mobile Sidebar RTL */
[dir="rtl"] .mobile-sidebar {
  left: auto;
  right: 0;
  transform: translateX(100%);
}

[dir="rtl"] .mobile-sidebar.open {
  transform: translateX(0);
}

[dir="rtl"] .mobile-sidebar ul {
  text-align: right;
}

[dir="rtl"] .close-btn {
  left: 1rem;
  right: auto;
}

/* Mobile sidebar animation for RTL */
.mobile-sidebar.rtl {
  left: auto;
  right: 0;
  transform: translateX(100%);
}

.mobile-sidebar.rtl.open {
  transform: translateX(0);
}

/* Form RTL */
[dir="rtl"] .footer-header-form {
  direction: rtl;
}

[dir="rtl"] .footer-input-wrapper {
  flex-direction: row-reverse;
}

[dir="rtl"] .footer-header-input {
  text-align: right;
  padding-right: 1rem;
  padding-left: 3rem;
}

[dir="rtl"] .footer-header-submit {
  left: 0;
  right: auto;
}

/* Responsive RTL */
@media (max-width: 768px) {
  [dir="rtl"] .about-content {
    flex-direction: column;
  }

  [dir="rtl"] .about-badge-title {
    align-items: center;
  }

  [dir="rtl"] .about-text-content {
    text-align: center;
  }

  [dir="rtl"] .hero-content {
    text-align: center;
  }

  [dir="rtl"] .service-card {
    text-align: center;
  }

  [dir="rtl"] .footer-content {
    flex-direction: column;
  }

  [dir="rtl"] .footer-section {
    text-align: center;
  }

  [dir="rtl"] .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  [dir="rtl"] .contact-item {
    justify-content: center;
  }
}

/* Animation for language switch */
.language-switching {
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.language-switching * {
  transition: all 0.3s ease;
}

/* Arabic font optimization */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
  font-weight: 600;
  line-height: 1.4;
}

[dir="rtl"] p,
[dir="rtl"] a,
[dir="rtl"] span,
[dir="rtl"] div {
  line-height: 1.6;
}

/* Fix for Arabic text in buttons */
[dir="rtl"] .cta-button,
[dir="rtl"] .contact-btn,
[dir="rtl"] .filter-btn {
  font-weight: 500;
}

/* Project cards title alignment */
[dir="rtl"] .project-card h3 {
  text-align: right;
}

/* Ensure proper spacing for Arabic text */
[dir="rtl"] .hero-title {
  margin-bottom: 1.5rem;
}

[dir="rtl"] .hero-subtitle {
  margin-bottom: 2rem;
}

/* Companies grid RTL fix */
[dir="rtl"] .companies-logos {
  justify-content: center;
}

/* Service cards icon alignment */
[dir="rtl"] .service-card .service-icon {
  margin-bottom: 1rem;
}