/* RTL (Right-to-Left) Styles for Arabic Language */

/* Base RTL Direction */
html[dir="rtl"] {
  direction: rtl;
}

/* Arabic Font Family */
html[dir="rtl"] body,
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6,
html[dir="rtl"] .hero-title,
html[dir="rtl"] .feature-card h5,
html[dir="rtl"] .apply-text h2,
html[dir="rtl"] .programs-section .section-title,
html[dir="rtl"] .program-card h4,
html[dir="rtl"] .legacy-edu h2,
html[dir="rtl"] .calendar-title,
html[dir="rtl"] .video-tour h2,
html[dir="rtl"] .news-section .section-title,
html[dir="rtl"] .event-content h5,
html[dir="rtl"] .events-section .section-title {
  font-family: "Almarai", "Segoe UI", Tahoma, sans-serif !important;
}

/* Navbar RTL Adjustments */
html[dir="rtl"] .navbar-nav {
  padding-right: 0;
}

html[dir="rtl"] .navbar-brand {
  margin-left: 1rem;
  margin-right: 0;
}

html[dir="rtl"] .navbar-nav .nav-link {
  text-align: right;
}

html[dir="rtl"] .dropdown-menu {
  text-align: right;
}

html[dir="rtl"] .dropdown-item {
  text-align: right;
}

/* Button Adjustments */
html[dir="rtl"] .btn-login i {
  margin-left: 0.5rem;
  margin-right: 0;
}

html[dir="rtl"] .ms-lg-2 {
  margin-left: 0 !important;
  margin-right: 0.5rem !important;
}

/* Footer RTL */
html[dir="rtl"] .footer-main h5,
html[dir="rtl"] .footer-main ul,
html[dir="rtl"] .footer-main li {
  text-align: right;
}

html[dir="rtl"] .footer-main ul {
  padding-right: 0;
}

html[dir="rtl"] .text-md-end {
  text-align: left !important;
}

html[dir="rtl"] .social-links {
  justify-content: flex-start;
}

/* Container Adjustments */
html[dir="rtl"] .container {
  text-align: right;
}

/* Hero Section RTL */
html[dir="rtl"] .hero-content {
  text-align: center;
}

/* Cards RTL */
html[dir="rtl"] .card-body {
  text-align: center;
}

/* Form Elements RTL */
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
  text-align: right;
}

html[dir="rtl"] .form-label {
  text-align: right;
  display: block;
}

/* Icon Adjustments */
html[dir="rtl"] .fa-chevron-right:before {
  content: "\f053"; /* chevron-left */
}

html[dir="rtl"] .fa-chevron-left:before {
  content: "\f054"; /* chevron-right */
}

html[dir="rtl"] .fa-arrow-right:before {
  content: "\f060"; /* arrow-left */
}

html[dir="rtl"] .fa-arrow-left:before {
  content: "\f061"; /* arrow-right */
}

/* Margin/Padding Utilities - Mirror */
html[dir="rtl"] .me-1,
html[dir="rtl"] .me-2,
html[dir="rtl"] .me-3,
html[dir="rtl"] .me-4,
html[dir="rtl"] .me-5 {
  margin-right: 0 !important;
}

html[dir="rtl"] .me-1 {
  margin-left: 0.25rem !important;
}
html[dir="rtl"] .me-2 {
  margin-left: 0.5rem !important;
}
html[dir="rtl"] .me-3 {
  margin-left: 1rem !important;
}
html[dir="rtl"] .me-4 {
  margin-left: 1.5rem !important;
}
html[dir="rtl"] .me-5 {
  margin-left: 3rem !important;
}

html[dir="rtl"] .ms-1,
html[dir="rtl"] .ms-2,
html[dir="rtl"] .ms-3,
html[dir="rtl"] .ms-4,
html[dir="rtl"] .ms-5 {
  margin-left: 0 !important;
}

html[dir="rtl"] .ms-1 {
  margin-right: 0.25rem !important;
}
html[dir="rtl"] .ms-2 {
  margin-right: 0.5rem !important;
}
html[dir="rtl"] .ms-3 {
  margin-right: 1rem !important;
}
html[dir="rtl"] .ms-4 {
  margin-right: 1.5rem !important;
}
html[dir="rtl"] .ms-5 {
  margin-right: 3rem !important;
}

/* Language Switcher */
.lang-switch {
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-switch:hover {
  opacity: 0.8;
}

/* ================= RTL RESPONSIVE ================= */
@media (max-width: 991px) {
  /* Mobile navbar RTL */
  html[dir="rtl"] .navbar-collapse {
    text-align: right;
  }
  
  html[dir="rtl"] .navbar-nav .nav-link {
    padding-right: 0;
  }
  
  html[dir="rtl"] .navbar-toggler {
    margin-left: 0;
    margin-right: auto;
  }
  
  /* Footer RTL mobile */
  html[dir="rtl"] .footer-right-col {
    justify-content: center;
  }
  
  html[dir="rtl"] .footer-center-col {
    text-align: center;
  }
  
  html[dir="rtl"] .footer-left-col {
    text-align: center;
  }
  
  html[dir="rtl"] .footer-info-item {
    justify-content: center;
  }
}

@media (max-width: 767px) {
  /* RTL sidebar on mobile */
  html[dir="rtl"] .sidebar-menu a:hover,
  html[dir="rtl"] .sidebar-menu a.active {
    padding-right: 25px;
    padding-left: 25px;
  }
  
  /* RTL footer fully centered on mobile */
  html[dir="rtl"] .main-footer .footer-info-title::after {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  
  html[dir="rtl"] .main-footer .copyright {
    text-align: center;
  }
  
  /* Calendar RTL mobile */
  html[dir="rtl"] .calendar-event-item {
    border-right: none !important;
    border-left: none !important;
  }
  
  /* Breadcrumb wrapping RTL */
  html[dir="rtl"] .ds-breadcrumb {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  html[dir="rtl"] .ds-tabs {
    justify-content: flex-start;
  }
}
