/**
 * RTL support for PANIZO website
 */

/* RTL direction styles */
.rtl {
  direction: rtl;
  text-align: right;
}

/* Preserve center alignment for section headers and other centered elements */
.rtl .section-header,
.rtl .section-header h2,
.rtl .section-header p,
.rtl .section-subheader,
.rtl .cta,
.rtl .cta h2,
.rtl .cta p,
.rtl footer .copyright,
.rtl .footer-links,
.rtl h2::after,
.rtl .app-links,
.rtl .social-links,
.rtl [style*="justify-content: center"],
.rtl [style*="text-align: center"] {
  text-align: center;
}

/* Flip icons in RTL mode */
.rtl .fa,
.rtl .fas,
.rtl .far,
.rtl .fab {
  transform: scaleX(-1);
}

/* Don't flip some specific icons */
.rtl .fa-whatsapp,
.rtl .fa-globe {
  transform: none;
}

/* Adjust navigation for RTL */
.rtl .navbar-nav {
  padding-right: 0;
}

.rtl .navbar-nav .nav-item {
  margin-right: 0;
  margin-left: 1.5rem;
}

/* Section header remains centered in RTL */
.rtl .section-header {
  text-align: center;
}

/* Adjust testimonials for RTL */
.rtl .testimonial {
  text-align: right;
}

/* Adjust FAQ for RTL */
.rtl .faq-question,
.rtl .faq-answer {
  text-align: right;
}

/* Adjust footer for RTL but preserve centered elements */
.rtl footer {
  text-align: right;
}

.rtl footer .app-links,
.rtl footer .social-links,
.rtl footer .footer-links,
.rtl footer .copyright {
  text-align: center;
}

/* Language switcher styles */
.language-switcher-container {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  padding: 6px 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
}

.rtl .language-switcher-container {
  margin-left: 0;
  margin-right: 1.5rem;
}

/* Remove language label styles as it's no longer used */

.language-switcher-container::before {
  content: "\f1ab";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-right: 8px;
  color: #555;
  font-size: 1rem;
}

.rtl .language-switcher-container::before {
  margin-right: 0;
  margin-left: 8px;
}

.language-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 20px;
  margin: 0 3px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  background-color: #f0f0f0;
  color: #333;
  text-decoration: none;
  min-width: 70px;
}

/* Responsive text for language switcher */
@media (max-width: 767px) {
  .language-switcher[data-language="en"] {
    font-size: 0.75rem;
  }
  
  .language-switcher[data-language="ar"] {
    font-size: 0.75rem;
  }
}

.language-switcher:hover {
  background-color: #e0e0e0;
  transform: translateY(-2px);
}

.language-switcher.active {
  background-color: #3498db;
  color: white;
}

/* Remove the before pseudo-elements as we're using direct text */

/* Adjust width for different screen sizes */
@media (min-width: 768px) {
  .language-switcher {
    min-width: 100px;
  }
}

@media (max-width: 767px) {
  .language-switcher {
    min-width: 40px;
    padding: 6px 8px;
    font-size: 0.7rem;
  }
  
  .language-switcher[data-language="en"]::after {
    content: "EN";
  }
  
  .language-switcher[data-language="ar"]::after {
    content: "AR";
  }
  
  .language-switcher span {
    display: none;
  }
}

/* Font adjustments for Arabic */
.rtl body {
  font-family: 'Tajawal', 'Poppins', sans-serif;
}

/* Fix WhatsApp float button position in RTL */
.rtl .whatsapp-float {
  right: auto;
  left: 25px;
}

/* Fix timeline phases alignment for RTL */
.rtl .timeline-phases {
  justify-content: space-between;
  flex-direction: row;
  width: 100%;
  display: flex;
}

.rtl .timeline-phase {
  border-left: none;
  border-right: 4px solid #3498db;
  border-radius: 8px 0 0 8px;
  text-align: right;
  flex: 1;
  min-width: 150px;
}

/* Fix the business model timeline for RTL */
.rtl .timeline {
  direction: rtl;
}

.rtl .timeline::after {
  left: auto;
  right: 50%;
  margin-left: 0;
  margin-right: -1px;
}

.rtl .timeline-item {
  text-align: right;
}

.rtl .timeline-item:nth-child(odd) {
  left: auto;
  right: 0;
}

.rtl .timeline-item:nth-child(even) {
  left: auto;
  right: 50%;
}

.rtl .timeline-content {
  text-align: right;
}

/* Fix responsive issues for RTL timelines */
@media (max-width: 768px) {
  .rtl .timeline-phases {
    flex-direction: column;
  }
  
  .rtl .timeline-phase {
    width: 100%;
  }
  
  .rtl .timeline::after {
    right: 31px;
    left: auto;
  }
  
  .rtl .timeline-item {
    width: 100%;
    padding-right: 70px;
    padding-left: 25px;
  }
  
  .rtl .timeline-item:nth-child(odd),
  .rtl .timeline-item:nth-child(even) {
    left: auto;
    right: 0;
  }
}
