/**
 * MEDAS RTL (Right-to-Left) Stylesheet
 * Arabic Language Support
 */

/* ========================================
   RTL Base Styles
   ======================================== */

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

/* Arabic Font Stack */
[dir="rtl"] body {
  font-family: 'Noto Sans Arabic', 'Segoe UI', 'Tahoma', sans-serif;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
  font-family: 'Noto Sans Arabic', 'Plus Jakarta Sans', sans-serif;
}

/* ========================================
   Navigation RTL
   ======================================== */

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

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

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

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

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

[dir="rtl"] .has-dropdown > a::after {
  margin-left: 0;
  margin-right: 0.5rem;
}

/* Mobile Nav RTL */
[dir="rtl"] .mobile-nav-menu {
  text-align: right;
}

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

/* Language Switcher - Premium Toggle Design */
.language-switcher {
  display: flex;
  align-items: center;
  margin-left: 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

[dir="rtl"] .language-switcher {
  margin-left: 0;
  margin-right: 1.25rem;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: 50px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
}

.lang-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.lang-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-weight: 600;
}

.lang-btn img {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.lang-btn.active img {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* Scrolled header adjustment */
.header.scrolled .language-switcher {
  background: rgba(15, 76, 129, 0.1);
  border-color: rgba(15, 76, 129, 0.2);
}

.header.scrolled .lang-btn {
  color: var(--gray-500);
}

.header.scrolled .lang-btn:hover {
  color: var(--primary);
  background: rgba(15, 76, 129, 0.1);
}

.header.scrolled .lang-btn.active {
  background: var(--primary);
  color: white;
}

/* Mobile Language Switcher */
.mobile-nav .language-switcher {
  background: rgba(15, 76, 129, 0.1);
  border-color: rgba(15, 76, 129, 0.2);
  margin: 0;
  justify-content: center;
}

.mobile-nav .lang-btn {
  color: var(--gray-600);
  padding: 10px 18px;
}

.mobile-nav .lang-btn:hover {
  color: var(--primary);
  background: rgba(15, 76, 129, 0.1);
}

.mobile-nav .lang-btn.active {
  background: var(--primary);
  color: white;
}

/* ========================================
   Hero Section RTL
   ======================================== */

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

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

[dir="rtl"] .hero__stats {
  flex-direction: row-reverse;
}

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

/* ========================================
   Section Headers RTL
   ======================================== */

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

[dir="rtl"] .section-header:not(.center) {
  text-align: right;
}

/* ========================================
   Cards & Grids RTL
   ======================================== */

[dir="rtl"] .feature-card,
[dir="rtl"] .solution-card,
[dir="rtl"] .product-card {
  text-align: right;
}

[dir="rtl"] .feature-icon,
[dir="rtl"] .card-icon {
  margin-left: auto;
  margin-right: 0;
}

[dir="rtl"] .solution-features li::before,
[dir="rtl"] .feature-list li::before {
  left: auto;
  right: 0;
  margin-left: 0.5rem;
  margin-right: 0;
}

[dir="rtl"] .solution-features li,
[dir="rtl"] .feature-list li {
  padding-left: 0;
  padding-right: 1.75rem;
}

/* Solution Showcase RTL */
[dir="rtl"] .solution-showcase-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .solution-showcase-item.reverse {
  flex-direction: row;
}

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

/* ========================================
   GCC Compliance RTL
   ======================================== */

[dir="rtl"] .gcc-compliance-item {
  flex-direction: row-reverse;
  text-align: right;
}

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

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

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

[dir="rtl"] .location-tag {
  margin-left: 0.25rem;
  margin-right: 0;
}

/* ========================================
   Stats Section RTL
   ======================================== */

[dir="rtl"] .stats-grid,
[dir="rtl"] .stats-section-bg .stats-grid {
  flex-direction: row-reverse;
}

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

/* ========================================
   Testimonials RTL
   ======================================== */

[dir="rtl"] .testimonial-card {
  flex-direction: row-reverse;
}

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

[dir="rtl"] .testimonial-quote::before {
  left: auto;
  right: 0;
}

/* ========================================
   Footer RTL
   ======================================== */

[dir="rtl"] .footer-grid {
  direction: rtl;
}

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

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

[dir="rtl"] .footer-links ul {
  padding-left: 0;
  padding-right: 0;
}

[dir="rtl"] .footer-gcc-flags {
  justify-content: flex-start;
}

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

[dir="rtl"] .footer-legal {
  flex-direction: row-reverse;
}

/* ========================================
   Forms RTL
   ======================================== */

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

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

[dir="rtl"] input[type="text"],
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="password"],
[dir="rtl"] textarea,
[dir="rtl"] select {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .newsletter-form {
  flex-direction: row-reverse;
}

/* ========================================
   Buttons RTL
   ======================================== */

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

[dir="rtl"] .btn-icon-right svg {
  margin-left: 0;
  margin-right: 0.5rem;
  order: -1;
}

/* ========================================
   Trust Badges RTL
   ======================================== */

[dir="rtl"] .trust-badges-grid {
  flex-direction: row-reverse;
}

/* ========================================
   Client Logos RTL
   ======================================== */

[dir="rtl"] .client-logos-header {
  text-align: center;
}

/* ========================================
   Integration Grid RTL
   ======================================== */

[dir="rtl"] .integration-grid {
  flex-direction: row-reverse;
}

/* ========================================
   Floating Contact RTL
   ======================================== */

[dir="rtl"] .floating-contact {
  left: 20px;
  right: auto;
}

/* ========================================
   Breadcrumbs RTL
   ======================================== */

[dir="rtl"] .breadcrumb {
  flex-direction: row-reverse;
}

[dir="rtl"] .breadcrumb-item::before {
  content: "\\";
  margin-left: 0.75rem;
  margin-right: 0.75rem;
}

[dir="rtl"] .breadcrumb-item:first-child::before {
  content: "";
}

/* ========================================
   Case Studies RTL
   ======================================== */

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

[dir="rtl"] .case-study-sidebar {
  border-left: none;
  border-right: 3px solid var(--primary);
  padding-left: 0;
  padding-right: 1.5rem;
}

[dir="rtl"] .sidebar-section li::before {
  left: auto;
  right: 0;
}

[dir="rtl"] .sidebar-section li {
  padding-left: 0;
  padding-right: 1.5rem;
}

/* ========================================
   Blog RTL
   ======================================== */

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

[dir="rtl"] .blog-meta {
  flex-direction: row-reverse;
}

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

[dir="rtl"] .article-callout {
  border-left: none;
  border-right: 4px solid var(--primary);
  padding-left: 0;
  padding-right: 1.5rem;
}

[dir="rtl"] .share-buttons {
  flex-direction: row-reverse;
}

/* ========================================
   Quiz RTL
   ======================================== */

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

[dir="rtl"] .option-card {
  text-align: right;
  flex-direction: row-reverse;
}

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

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

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

/* ========================================
   Cookie Banner RTL
   ======================================== */

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

[dir="rtl"] .cookie-content {
  flex-direction: row-reverse;
}

[dir="rtl"] .cookie-actions {
  flex-direction: row-reverse;
}

/* ========================================
   Legal Pages RTL
   ======================================== */

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

[dir="rtl"] .legal-content ul,
[dir="rtl"] .legal-content ol {
  padding-left: 0;
  padding-right: 1.5rem;
}

/* ========================================
   Responsive RTL Adjustments
   ======================================== */

@media (max-width: 768px) {
  [dir="rtl"] .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  [dir="rtl"] .solution-showcase-item,
  [dir="rtl"] .solution-showcase-item.reverse {
    flex-direction: column;
  }

  [dir="rtl"] .testimonial-card {
    flex-direction: column;
  }

  [dir="rtl"] .gcc-compliance-item {
    flex-direction: column;
    text-align: center;
  }

  [dir="rtl"] .floating-contact {
    left: 10px;
    right: auto;
  }

  .language-switcher {
    margin: 0 !important;
    padding: 4px;
  }

  [dir="rtl"] .language-switcher {
    margin: 0 !important;
  }

  .lang-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* ========================================
   Utility Classes RTL
   ======================================== */

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

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

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

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

[dir="rtl"] .pl-4 {
  padding-left: 0;
  padding-right: 1rem;
}

[dir="rtl"] .pr-4 {
  padding-right: 0;
  padding-left: 1rem;
}

/* ========================================
   Animation Adjustments RTL
   ======================================== */

[dir="rtl"] [data-animate] {
  transform: translateX(20px);
}

[dir="rtl"] [data-animate].animated {
  transform: translateX(0);
}

/* ========================================
   Print Styles RTL
   ======================================== */

@media print {
  [dir="rtl"] {
    direction: rtl;
    text-align: right;
  }
}

/* ========================================
   Regional Suggestion Banner RTL
   ======================================== */

[dir="rtl"] .region-banner {
  flex-direction: row-reverse;
}

/* ========================================
   Regional Site Picker RTL
   ======================================== */

[dir="rtl"] .region-picker-card {
  align-items: flex-start;
}

[dir="rtl"] .region-picker-card::before {
  inset: 0 0 0 auto;
}

[dir="rtl"] .region-picker-go {
  right: auto;
  left: var(--space-6);
  transform: scaleX(-1);
}

[dir="rtl"] .region-picker-card:hover .region-picker-go {
  transform: scaleX(-1) translateX(3px);
}

[dir="rtl"] .region-picker-card.is-current .region-picker-go {
  transform: none;
}

/* ========================================
   Product Card Links RTL
   ======================================== */

[dir="rtl"] .product-card-link {
  padding-right: var(--space-6);
  padding-left: var(--space-10);
}

[dir="rtl"] .product-card-go {
  right: auto;
  left: var(--space-5);
  transform: scaleX(-1);
}

[dir="rtl"] .product-card-link:hover .product-card-go {
  transform: scaleX(-1) translateX(3px);
}

/* Keep both language choices readable against the site's light header. */
[dir="rtl"] .header .language-switcher {
  background: rgba(15, 76, 129, 0.07);
  border-color: rgba(15, 76, 129, 0.16);
}

[dir="rtl"] .header .lang-btn {
  color: var(--gray-700);
  opacity: 1;
}

[dir="rtl"] .header .lang-btn:hover {
  color: var(--primary);
  background: rgba(15, 76, 129, 0.1);
}

[dir="rtl"] .header .lang-btn.active,
[dir="rtl"] .header.scrolled .lang-btn.active {
  background: var(--primary);
  color: var(--white);
}

[dir="rtl"] .mobile-nav .lang-btn {
  color: var(--gray-700);
  opacity: 1;
}

[dir="rtl"] .mobile-nav .lang-btn.active,
[dir="rtl"] .mobile-nav .btn-primary {
  color: var(--white);
}
