/**
 * RTL (Right-to-Left) Support for Arabic
 * Provides RTL-specific styling for Arabic language with bold fonts
 */

/* RTL Base Styles */
[dir="rtl"] {
  text-align: right;
}

/* Force center alignment for elements that should be centered */
[dir="rtl"] .text-center,
[dir="rtl"] .hero-content,
[dir="rtl"] .section h2,
[dir="rtl"] .section h1,
[dir="rtl"] .section-header h2,
[dir="rtl"] .section-header h1,
[dir="rtl"] .news-hero-content,
[dir="rtl"] .article-hero-content,
[dir="rtl"] .newsletter-header,
[dir="rtl"] .newsletter-wrapper,
[dir="rtl"] .newsletter-container,
[dir="rtl"] .hero-content h1,
[dir="rtl"] .hero-content p,
[dir="rtl"] .section h2,
[dir="rtl"] .section h3,
[dir="rtl"] .section h4,
[dir="rtl"] .section h5,
[dir="rtl"] .section h6,
[dir="rtl"] .section-header,
[dir="rtl"] .section-header h2,
[dir="rtl"] .section-header p,
[dir="rtl"] .news-hero h1,
[dir="rtl"] .news-hero p,
[dir="rtl"] .article-hero h1,
[dir="rtl"] .article-hero p,
[dir="rtl"] .newsletter h2,
[dir="rtl"] .newsletter p,
[dir="rtl"] .footer-bottom,
[dir="rtl"] .footer-bottom p {
  text-align: center !important;
}

/* Specific section headings and content for Arabic */
[dir="rtl"] #impact h2,
[dir="rtl"] #impact p,
[dir="rtl"] #impact .section-header h2,
[dir="rtl"] #impact .section-header p,
[dir="rtl"] #projects h2,
[dir="rtl"] #projects p,
[dir="rtl"] #projects .section-header h2,
[dir="rtl"] #projects .section-header p,
[dir="rtl"] #products h2,
[dir="rtl"] #products p,
[dir="rtl"] #products .section-header h2,
[dir="rtl"] #products .section-header p,
[dir="rtl"] #testimonials h2,
[dir="rtl"] #testimonials p,
[dir="rtl"] #testimonials .section-header h2,
[dir="rtl"] #testimonials .section-header p,
[dir="rtl"] #vision h2,
[dir="rtl"] #vision p,
[dir="rtl"] #vision .section-header h2,
[dir="rtl"] #vision .section-header p,
[dir="rtl"] #about h2,
[dir="rtl"] #about p,
[dir="rtl"] #about .section-header h2,
[dir="rtl"] #about .section-header p,
[dir="rtl"] #contact h2,
[dir="rtl"] #contact p,
[dir="rtl"] #contact .section-header h2,
[dir="rtl"] #contact .section-header p,
[dir="rtl"] .impact-section h2,
[dir="rtl"] .impact-section p,
[dir="rtl"] .projects-section h2,
[dir="rtl"] .projects-section p,
[dir="rtl"] .products-section h2,
[dir="rtl"] .products-section p,
[dir="rtl"] .testimonials-section h2,
[dir="rtl"] .testimonials-section p,
[dir="rtl"] .vision-section h2,
[dir="rtl"] .vision-section p,
[dir="rtl"] .about-section h2,
[dir="rtl"] .about-section p,
[dir="rtl"] .contact-section h2,
[dir="rtl"] .contact-section p {
  text-align: center !important;
}

/* Additional comprehensive center alignment for Arabic */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6,
[dir="rtl"] .section h1,
[dir="rtl"] .section h2,
[dir="rtl"] .section h3,
[dir="rtl"] .section h4,
[dir="rtl"] .section h5,
[dir="rtl"] .section h6,
[dir="rtl"] .section p,
[dir="rtl"] .section-header,
[dir="rtl"] .section-header h1,
[dir="rtl"] .section-header h2,
[dir="rtl"] .section-header h3,
[dir="rtl"] .section-header p,
[dir="rtl"] .block h1,
[dir="rtl"] .block h2,
[dir="rtl"] .block h3,
[dir="rtl"] .block p,
[dir="rtl"] .hero h1,
[dir="rtl"] .hero h2,
[dir="rtl"] .hero p,
[dir="rtl"] .hero-content h1,
[dir="rtl"] .hero-content h2,
[dir="rtl"] .hero-content p,
[dir="rtl"] .news-hero h1,
[dir="rtl"] .news-hero h2,
[dir="rtl"] .news-hero p,
[dir="rtl"] .article-hero h1,
[dir="rtl"] .article-hero h2,
[dir="rtl"] .article-hero p,
[dir="rtl"] .newsletter h1,
[dir="rtl"] .newsletter h2,
[dir="rtl"] .newsletter p,
[dir="rtl"] .footer h1,
[dir="rtl"] .footer h2,
[dir="rtl"] .footer p {
  text-align: center !important;
}

[dir="rtl"] body {
  direction: rtl;
  text-align: right;
  font-weight: bold;
}

/* Janna LT Bold Font for Arabic - Apply to all elements */
[dir="rtl"] * {
  font-family: 'Janna LT Bold', 'Janna LT', Arial, sans-serif !important;
  font-weight: bold !important;
}

/* Preserve Font Awesome icons for Arabic */
[dir="rtl"] .fas,
[dir="rtl"] .far,
[dir="rtl"] .fab,
[dir="rtl"] .fal,
[dir="rtl"] .fa,
[dir="rtl"] i[class*="fa-"],
[dir="rtl"] i[class*="fas"],
[dir="rtl"] i[class*="far"],
[dir="rtl"] i[class*="fab"],
[dir="rtl"] i[class*="fal"] {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 5 Free", "Font Awesome 5 Pro", "FontAwesome" !important;
  font-weight: 900 !important;
}

/* More specific Janna LT Bold font rules for Arabic */
[dir="rtl"] body,
[dir="rtl"] body *,
[dir="rtl"] html,
[dir="rtl"] html * {
  font-family: 'Janna LT Bold', 'Janna LT', Arial, sans-serif !important;
  font-weight: bold !important;
}

/* Specific element targeting for Arabic with Janna LT Bold */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6,
[dir="rtl"] p,
[dir="rtl"] span,
[dir="rtl"] div,
[dir="rtl"] a,
[dir="rtl"] li,
[dir="rtl"] button,
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] label {
  font-family: 'Janna LT Bold', 'Janna LT', Arial, sans-serif !important;
  font-weight: bold !important;
}

/* Force Janna LT Bold on all text elements */
[dir="rtl"] .hero-content,
[dir="rtl"] .hero-content *,
[dir="rtl"] .card,
[dir="rtl"] .card *,
[dir="rtl"] .project-card,
[dir="rtl"] .project-card *,
[dir="rtl"] .team-card,
[dir="rtl"] .team-card *,
[dir="rtl"] .why-card,
[dir="rtl"] .why-card *,
[dir="rtl"] .testimonial-content,
[dir="rtl"] .testimonial-content *,
[dir="rtl"] .news-card,
[dir="rtl"] .news-card *,
[dir="rtl"] .footer-section,
[dir="rtl"] .footer-section *,
[dir="rtl"] .contact-info,
[dir="rtl"] .contact-info *,
[dir="rtl"] .newsletter-form,
[dir="rtl"] .newsletter-form *,
[dir="rtl"] .nav-link,
[dir="rtl"] .nav-link *,
[dir="rtl"] .btn,
[dir="rtl"] .btn * {
  font-family: 'Janna LT Bold', 'Janna LT', Arial, sans-serif !important;
  font-weight: bold !important;
}

/* RTL Navigation */
[dir="rtl"] .nav-toggle {
  left: 20px;
  right: auto;
}

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

[dir="rtl"] nav ul {
  flex-direction: row-reverse;
}

[dir="rtl"] nav li {
  margin-left: 0;
  margin-right: 2rem;
}

[dir="rtl"] nav li:last-child {
  margin-right: 0;
}

/* RTL Mobile Navigation - Force Centering */
@media (max-width: 768px) {
  [dir="rtl"] nav a {
    text-align: center !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto !important;
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Even more specific targeting */
  [dir="rtl"] nav ul li a {
    text-align: center !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto !important;
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Target RTL navigation container */
  [dir="rtl"] nav ul {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
  }
  
  [dir="rtl"] nav li {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }
  
  /* Fine-tune RTL navigation positioning */
  [dir="rtl"] nav a,
  [dir="rtl"] nav ul li a {
    margin-left: 48px !important;
  }
}

/* RTL Hero Section */
[dir="rtl"] .hero-content {
  text-align: right;
}

[dir="rtl"] .hero-buttons {
  justify-content: flex-start;
}

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

/* RTL Cards and Grids */
[dir="rtl"] .card {
  text-align: right;
}

[dir="rtl"] .card-icon {
  margin-left: 1rem;
  margin-right: 0;
}

[dir="rtl"] .card-content {
  text-align: right;
}

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

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

[dir="rtl"] .form-group input,
[dir="rtl"] .form-group textarea {
  text-align: right;
}

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

/* RTL Buttons */
[dir="rtl"] .btn {
  text-align: center;
}

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

[dir="rtl"] .btn i.fa-arrow-right {
  transform: scaleX(-1);
}

/* RTL Language Switcher */
[dir="rtl"] .language-switcher {
  left: 20px;
  right: auto;
}

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

[dir="rtl"] .language-option {
  text-align: right;
}

[dir="rtl"] .language-option .language-flag {
  margin-left: 0.5rem;
  margin-right: 0;
}

/* RTL Team Cards */
[dir="rtl"] .team-card {
  text-align: right;
}

[dir="rtl"] .team-card .card-content {
  text-align: right;
}

[dir="rtl"] .team-card .team-role {
  text-align: right;
}

[dir="rtl"] .team-card .team-summary {
  text-align: right;
}

/* RTL Statistics */
[dir="rtl"] .stat-item {
  text-align: center;
}

[dir="rtl"] .stat-number {
  text-align: center;
}

[dir="rtl"] .stat-label {
  text-align: center;
}

/* RTL Partnership Cards - Check Icons and Dots */
[dir="rtl"] .benefits-list li {
  padding-right: 1.5rem !important;
  padding-left: 0 !important;
}

[dir="rtl"] .benefits-list li::before {
  right: 0 !important;
  left: auto !important;
}

[dir="rtl"] .info-list li {
  padding-right: 1.5rem !important;
  padding-left: 0 !important;
}

[dir="rtl"] .info-list li::before {
  right: 0 !important;
  left: auto !important;
}

/* RTL Footer */
[dir="rtl"] .footer-content {
  text-align: center !important;
}

[dir="rtl"] .footer-section {
  text-align: center !important;
}

[dir="rtl"] .footer-section h3 {
  text-align: center !important;
}

[dir="rtl"] .footer-section h4 {
  text-align: center !important;
}

[dir="rtl"] .footer-section ul {
  text-align: center !important;
}

[dir="rtl"] .footer-section li {
  text-align: center !important;
}

[dir="rtl"] .footer-section a {
  text-align: center !important;
}

/* RTL Social Links */
[dir="rtl"] .social-links {
  justify-content: flex-start;
}

[dir="rtl"] .social-links a {
  margin-left: 0.5rem;
  margin-right: 0;
}

[dir="rtl"] .social-links a:first-child {
  margin-left: 0;
}

/* RTL Social Icons */
[dir="rtl"] .social-icons {
  justify-content: flex-start;
}

[dir="rtl"] .social-icons a {
  margin-left: 0.5rem;
  margin-right: 0;
}

[dir="rtl"] .social-icons a:first-child {
  margin-left: 0;
}

/* LTR Social Icons - Ensure they're visible */
[dir="ltr"] .social-icons {
  display: flex !important;
  gap: 1rem !important;
  justify-content: center !important;
  margin-top: 1rem !important;
  visibility: visible !important;
  opacity: 1 !important;
}

[dir="ltr"] .social-icons a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  background: #00aeca !important;
  border-radius: 50% !important;
  color: white !important;
  font-size: 1.2rem !important;
  text-decoration: none !important;
  transition: all 0.3s ease !important;
  visibility: visible !important;
  opacity: 1 !important;
  border: 2px solid #ffffff !important;
}

[dir="ltr"] .social-icons a i {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-style: normal !important;
  text-rendering: auto !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Specific Font Awesome icon fixes for LTR */
[dir="ltr"] .social-icons a i.fab {
  font-family: "Font Awesome 6 Brands" !important;
  font-weight: 400 !important;
}

[dir="ltr"] .social-icons a i.fa-facebook-f:before {
  content: "\f39e" !important;
}

[dir="ltr"] .social-icons a i.fa-whatsapp:before {
  content: "\f232" !important;
}

[dir="ltr"] .social-icons a i.fa-instagram:before {
  content: "\f16d" !important;
}

[dir="ltr"] .social-icons a i.fa-linkedin-in:before {
  content: "\f0e1" !important;
}

[dir="ltr"] .social-icons a:hover {
  color: #00aeca !important;
  transform: translateY(-2px) !important;
  background: #ffffff !important;
}

/* Fallback for all social icons regardless of language */
.social-icons {
  display: flex !important;
  gap: 1rem !important;
  justify-content: center !important;
  margin-top: 1rem !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.social-icons a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  background: #00aeca !important;
  border-radius: 50% !important;
  color: white !important;
  font-size: 1.2rem !important;
  text-decoration: none !important;
  transition: all 0.3s ease !important;
  visibility: visible !important;
  opacity: 1 !important;
  border: 2px solid #ffffff !important;
}

.social-icons a i {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-style: normal !important;
  text-rendering: auto !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Specific Font Awesome icon fixes for fallback */
.social-icons a i.fab {
  font-family: "Font Awesome 6 Brands" !important;
  font-weight: 400 !important;
}

.social-icons a i.fa-facebook-f:before {
  content: "\f39e" !important;
}

.social-icons a i.fa-whatsapp:before {
  content: "\f232" !important;
}

.social-icons a i.fa-instagram:before {
  content: "\f16d" !important;
}

.social-icons a i.fa-linkedin-in:before {
  content: "\f0e1" !important;
}

/* RTL Contact Info */
[dir="rtl"] .contact-info {
  text-align: right;
}

[dir="rtl"] .contact-info .contact-item {
  text-align: right;
}

[dir="rtl"] .contact-info .contact-item i {
  margin-left: 0.5rem;
  margin-right: 0;
}

/* RTL Newsletter */
[dir="rtl"] .newsletter-form {
  text-align: right;
}

[dir="rtl"] .newsletter-form input {
  text-align: right;
}

[dir="rtl"] .newsletter-form .btn {
  margin-left: 0.5rem;
  margin-right: 0;
}

/* RTL Responsive Adjustments */
@media (max-width: 768px) {
  [dir="rtl"] .nav-toggle {
    left: 15px;
    right: auto;
  }
  
  [dir="rtl"] .logo {
    margin-right: 0;
    margin-left: auto;
  }
  
  [dir="rtl"] .language-switcher {
    left: 15px;
    right: auto;
  }
}

@media (max-width: 480px) {
  [dir="rtl"] .hero-content {
    text-align: center;
  }
  
  [dir="rtl"] .hero-buttons {
    justify-content: center;
  }
  
  [dir="rtl"] .card {
    text-align: center;
  }
  
  [dir="rtl"] .form-group {
    text-align: center;
  }
}

/* RTL Typography Adjustments */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
  text-align: right;
}

[dir="rtl"] p {
  text-align: right;
}

[dir="rtl"] .lead {
  text-align: right;
}

/* RTL List Adjustments */
[dir="rtl"] ul {
  padding-right: 0;
  padding-left: 1.5rem;
}

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

[dir="rtl"] li {
  text-align: right;
}

/* RTL Table Adjustments */
[dir="rtl"] table {
  direction: rtl;
}

[dir="rtl"] th,
[dir="rtl"] td {
  text-align: right;
}
