/* RTL (Right-to-Left) Styles for Arabic Language Support */

/* Only apply RTL styles when html has rtl class and dir="rtl" */
html.rtl[dir="rtl"] {
  /* Text direction and alignment */
  text-align: right;
}

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

/* Navigation and Menu RTL */
html.rtl[dir="rtl"] .navbar-nav {
  margin-right: 0;
  margin-left: auto;
}

html.rtl[dir="rtl"] .navbar-nav .nav-link {
  padding-right: 0.5rem;
  padding-left: 1rem;
}

html.rtl[dir="rtl"] .dropdown-menu {
  right: 0;
  left: auto;
  text-align: right;
}

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

/* Button and Form RTL */
html.rtl[dir="rtl"] .btn {
  text-align: center;
}

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

/* Grid and Layout RTL */
html.rtl[dir="rtl"] .container,
html.rtl[dir="rtl"] .container-fluid {
  direction: rtl;
}

html.rtl[dir="rtl"] .row {
  direction: rtl;
}

/* Text alignment utilities RTL override */
html.rtl[dir="rtl"] .text-left {
  text-align: right !important;
}

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

html.rtl[dir="rtl"] .text-start {
  text-align: right !important;
}

html.rtl[dir="rtl"] .text-end {
  text-align: left !important;
}

/* Margin and Padding RTL */
html.rtl[dir="rtl"] .ms-1 { margin-left: 0 !important; margin-right: 0.25rem !important; }
html.rtl[dir="rtl"] .ms-2 { margin-left: 0 !important; margin-right: 0.5rem !important; }
html.rtl[dir="rtl"] .ms-3 { margin-left: 0 !important; margin-right: 1rem !important; }
html.rtl[dir="rtl"] .ms-4 { margin-left: 0 !important; margin-right: 1.5rem !important; }
html.rtl[dir="rtl"] .ms-5 { margin-left: 0 !important; margin-right: 3rem !important; }

html.rtl[dir="rtl"] .me-1 { margin-right: 0 !important; margin-left: 0.25rem !important; }
html.rtl[dir="rtl"] .me-2 { margin-right: 0 !important; margin-left: 0.5rem !important; }
html.rtl[dir="rtl"] .me-3 { margin-right: 0 !important; margin-left: 1rem !important; }
html.rtl[dir="rtl"] .me-4 { margin-right: 0 !important; margin-left: 1.5rem !important; }
html.rtl[dir="rtl"] .me-5 { margin-right: 0 !important; margin-left: 3rem !important; }

html.rtl[dir="rtl"] .ps-1 { padding-left: 0 !important; padding-right: 0.25rem !important; }
html.rtl[dir="rtl"] .ps-2 { padding-left: 0 !important; padding-right: 0.5rem !important; }
html.rtl[dir="rtl"] .ps-3 { padding-left: 0 !important; padding-right: 1rem !important; }
html.rtl[dir="rtl"] .ps-4 { padding-left: 0 !important; padding-right: 1.5rem !important; }
html.rtl[dir="rtl"] .ps-5 { padding-left: 0 !important; padding-right: 3rem !important; }

html.rtl[dir="rtl"] .pe-1 { padding-right: 0 !important; padding-left: 0.25rem !important; }
html.rtl[dir="rtl"] .pe-2 { padding-right: 0 !important; padding-left: 0.5rem !important; }
html.rtl[dir="rtl"] .pe-3 { padding-right: 0 !important; padding-left: 1rem !important; }
html.rtl[dir="rtl"] .pe-4 { padding-right: 0 !important; padding-left: 1.5rem !important; }
html.rtl[dir="rtl"] .pe-5 { padding-right: 0 !important; padding-left: 3rem !important; }

/* Float RTL */
html.rtl[dir="rtl"] .float-left {
  float: right !important;
}

html.rtl[dir="rtl"] .float-right {
  float: left !important;
}

html.rtl[dir="rtl"] .float-start {
  float: right !important;
}

html.rtl[dir="rtl"] .float-end {
  float: left !important;
}

/* Border RTL */
html.rtl[dir="rtl"] .border-left {
  border-left: 0 !important;
  border-right: 1px solid #dee2e6 !important;
}

html.rtl[dir="rtl"] .border-right {
  border-right: 0 !important;
  border-left: 1px solid #dee2e6 !important;
}

html.rtl[dir="rtl"] .border-start {
  border-left: 0 !important;
  border-right: 1px solid #dee2e6 !important;
}

html.rtl[dir="rtl"] .border-end {
  border-right: 0 !important;
  border-left: 1px solid #dee2e6 !important;
}

/* Icons RTL - Flip directional icons */
html.rtl[dir="rtl"] .fa-chevron-left::before {
  content: "\f054"; /* chevron-right */
}

html.rtl[dir="rtl"] .fa-chevron-right::before {
  content: "\f053"; /* chevron-left */
}

html.rtl[dir="rtl"] .fa-arrow-left::before {
  content: "\f061"; /* arrow-right */
}

html.rtl[dir="rtl"] .fa-arrow-right::before {
  content: "\f060"; /* arrow-left */
}

html.rtl[dir="rtl"] .fa-angle-left::before {
  content: "\f105"; /* angle-right */
}

html.rtl[dir="rtl"] .fa-angle-right::before {
  content: "\f104"; /* angle-left */
}


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

/* Card and Content RTL */
html.rtl[dir="rtl"] .card-body {
  text-align: right;
}

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

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

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

/* Breadcrumb RTL */
html.rtl[dir="rtl"] .breadcrumb {
  direction: rtl;
}

html.rtl[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  float: right;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

/* Modal RTL */
html.rtl[dir="rtl"] .modal-body {
  text-align: right;
}

html.rtl[dir="rtl"] .modal-header {
  text-align: right;
}

html.rtl[dir="rtl"] .modal-footer {
  text-align: left; /* Keep buttons on the left for consistency */
}

/* Pagination RTL */
html.rtl[dir="rtl"] .pagination {
  direction: rtl;
}

html.rtl[dir="rtl"] .page-link {
  text-align: center;
}

/* Font adjustments for Arabic */
html.rtl[dir="rtl"] {
  font-family: 'Arial', 'Tahoma', 'Noto Sans Arabic', sans-serif;
}

html.rtl[dir="rtl"] h1, 
html.rtl[dir="rtl"] h2, 
html.rtl[dir="rtl"] h3, 
html.rtl[dir="rtl"] h4, 
html.rtl[dir="rtl"] h5, 
html.rtl[dir="rtl"] h6 {
  font-family: 'Arial', 'Tahoma', 'Noto Sans Arabic', sans-serif;
  font-weight: bold;
}

/* Responsive adjustments for RTL */
@media (max-width: 768px) {
  html.rtl[dir="rtl"] .navbar-toggler {
    margin-left: 0;
    margin-right: auto;
  }
  
  html.rtl[dir="rtl"] .navbar-collapse {
    text-align: right;
  }
}

.mobile-menu-wrapper {
  position: relative;
}

.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.hamburger-line {
  width: 25px;
  height: 3px;
  background-color: #333;
  transition: all 0.3s ease;
  transform-origin: center;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 400px;
  height: 100vh;
  background-color: #fff;
  z-index: 1000;
  transition: right 0.3s ease;
  overflow-y: auto;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
}

.mobile-menu-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.mobile-menu-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #333;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-nav {
  padding: 20px 0;
}

.mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-menu-item {
  border-bottom: 1px solid #f0f0f0;
}

.mobile-menu-link {
  display: block;
  padding: 15px 20px;
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.mobile-menu-link:hover {
  background-color: #f8f9fa;
}

.mobile-menu-toggle-submenu {
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
}

.submenu-icon {
  font-size: 18px;
  font-weight: bold;
  transition: transform 0.3s ease;
}

.submenu-icon.active {
  transform: rotate(180deg);
}

.mobile-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background-color: #f8f9fa;
}

.mobile-submenu.active {
  max-height: 500px;
}

.mobile-submenu-item {
  border-bottom: 1px solid #e9ecef;
}

.mobile-submenu-link {
  display: block;
  padding: 12px 20px 12px 40px;
  color: #666;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.mobile-submenu-link:hover {
  background-color: #e9ecef;
}

/* RTL Support */
html.rtl[dir="rtl"] .mobile-menu {
  right: auto;
  left: -100%;
}

html.rtl[dir="rtl"] .mobile-menu.active {
  left: 0;
  right: auto;
}

html.rtl[dir="rtl"] .mobile-submenu-link {
  padding: 12px 40px 12px 20px;
}

/* Responsive adjustments */
@media (min-width: 993px) {
  .mobile-menu-wrapper {
    display: none;
  }
}
.language-switcher .dropdown-item:hover {
  background-color: #f8f9fa !important;
  color: #212529 !important;
}

.language-switcher .dropdown-item.active:hover {
  background-color: #0056b3 !important;
  color: white !important;
}

.language-flag {
  font-size: 1.2em;
}

.language-dropdown {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Navbar Language Switcher Styles */
.menu-area .language-switcher .btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #333;
  font-size: 14px;
  padding: 8px 12px;
  transition: all 0.3s ease;
}

.menu-area .language-switcher .btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: #333;
}

.menu-area .language-switcher .language-flag {
  font-size: 16px;
}

.menu-area .language-switcher .language-name {
  font-size: 12px;
  font-weight: 500;
}

/* Mobile Menu Language Switcher Styles */
.mobile-menu .language-switcher .btn {
  background: transparent;
  border: 1px solid #dee2e6;
  color: #333;
  font-size: 14px;
  padding: 6px 10px;
}

.mobile-menu .language-switcher .btn:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

/* Mobile Menu Responsive Fixes */
@media (max-width: 992px) {
  .mobile-menu-wrapper {
    display: flex !important;
    align-items: center;
    justify-content: end;
  }
  
  .main-menu {
    display: none !important;
  }
  
  .mobile-menu-toggle {
    display: flex !important;
  }
}

@media (min-width: 993px) {
  .mobile-menu-wrapper {
    display: none !important;
  }
  
  .main-menu {
    display: block !important;
  }
}

/* Ensure mobile menu works on all devices */
.mobile-menu-wrapper {
  position: relative;
  z-index: 1000;
}

.mobile-menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 400px;
  height: 100vh;
  background: white;
  z-index: 1001;
  transition: right 0.3s ease;
  overflow-y: auto;
  box-shadow: -2px 0 10px rgba(0,0,0,0.1);
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

/* RTL Mobile Menu Support */
html.rtl[dir="rtl"] .mobile-menu {
  right: auto;
  left: -100%;
}

html.rtl[dir="rtl"] .mobile-menu.active {
  left: 0;
  right: auto;
}




