/**
 * Language Support Styles
 * RTL/LTR layout switching and language-specific styling
 */

/* ============================================
   Arabic Font Families
   ============================================ */

html[lang="ar"] {
  font-family: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6 {
  font-family: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  font-weight: 700;
}

/* ============================================
   RTL Base Styles
   ============================================ */

[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="ltr"] {
  direction: ltr;
  text-align: left;
}

/* ============================================
   Navigation RTL Support
   ============================================ */

[dir="rtl"] .navbar-nav {
  flex-direction: row-reverse;
}

[dir="rtl"] .navbar-nav .nav-link {
  text-align: right;
}

[dir="rtl"] .dropdown-menu {
  text-align: right;
  right: 0;
  left: auto;
}

[dir="rtl"] .dropdown-item {
  text-align: right;
}

/* ============================================
   Language Switcher Component
   ============================================ */

/* DISABLED: Language switcher hidden - Arabic support paused */
.language-switcher {
  display: none !important; /* Forcing English only - client paused Arabic */
  /* Original styles preserved for future use:
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 15px;
  */
}

[dir="rtl"] .language-switcher {
  margin-left: 0;
  margin-right: 15px;
}

.lang-btn {
  background: none;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--default-color, #444444);
  transition: all 0.3s ease;
  border-radius: 4px;
  position: relative;
}

.lang-btn:hover {
  color: var(--accent-color, #546738);
  background-color: rgba(84, 103, 56, 0.1);
}

.lang-btn:focus {
  outline: 2px solid var(--accent-color, #546738);
  outline-offset: 2px;
}

.lang-btn.active {
  color: var(--accent-color, #546738);
  font-weight: 700;
  background-color: rgba(84, 103, 56, 0.15);
}

.lang-btn.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 12px;
  right: 12px;
  height: 2px;
  background-color: var(--accent-color, #546738);
}

.lang-separator {
  color: var(--default-color, #444444);
  opacity: 0.3;
  font-weight: 300;
}

/* ============================================
   RTL Layout Adjustments
   ============================================ */

/* Flex Direction Reversals */
[dir="rtl"] .d-flex {
  flex-direction: row-reverse;
}

[dir="rtl"] .row {
  flex-direction: row-reverse;
}

/* Text Alignment */
[dir="rtl"] .text-start {
  text-align: right !important;
}

[dir="rtl"] .text-end {
  text-align: left !important;
}

[dir="rtl"] .text-lg-start {
  text-align: right !important;
}

[dir="rtl"] .text-lg-end {
  text-align: left !important;
}

/* Margin and Padding Adjustments */
[dir="rtl"] .me-1 { margin-right: 0 !important; margin-left: 0.25rem !important; }
[dir="rtl"] .me-2 { margin-right: 0 !important; margin-left: 0.5rem !important; }
[dir="rtl"] .me-3 { margin-right: 0 !important; margin-left: 1rem !important; }
[dir="rtl"] .me-4 { margin-right: 0 !important; margin-left: 1.5rem !important; }
[dir="rtl"] .me-5 { margin-right: 0 !important; margin-left: 3rem !important; }

[dir="rtl"] .ms-1 { margin-left: 0 !important; margin-right: 0.25rem !important; }
[dir="rtl"] .ms-2 { margin-left: 0 !important; margin-right: 0.5rem !important; }
[dir="rtl"] .ms-3 { margin-left: 0 !important; margin-right: 1rem !important; }
[dir="rtl"] .ms-4 { margin-left: 0 !important; margin-right: 1.5rem !important; }
[dir="rtl"] .ms-5 { margin-left: 0 !important; margin-right: 3rem !important; }

[dir="rtl"] .pe-1 { padding-right: 0 !important; padding-left: 0.25rem !important; }
[dir="rtl"] .pe-2 { padding-right: 0 !important; padding-left: 0.5rem !important; }
[dir="rtl"] .pe-3 { padding-right: 0 !important; padding-left: 1rem !important; }
[dir="rtl"] .pe-4 { padding-right: 0 !important; padding-left: 1.5rem !important; }
[dir="rtl"] .pe-5 { padding-right: 0 !important; padding-left: 3rem !important; }

[dir="rtl"] .ps-1 { padding-left: 0 !important; padding-right: 0.25rem !important; }
[dir="rtl"] .ps-2 { padding-left: 0 !important; padding-right: 0.5rem !important; }
[dir="rtl"] .ps-3 { padding-left: 0 !important; padding-right: 1rem !important; }
[dir="rtl"] .ps-4 { padding-left: 0 !important; padding-right: 1.5rem !important; }
[dir="rtl"] .ps-5 { padding-left: 0 !important; padding-right: 3rem !important; }

/* ============================================
   Icon Positioning for RTL
   ============================================ */

[dir="rtl"] .bi::before {
  transform: scaleX(-1);
}

/* Don't flip certain icons */
[dir="rtl"] .bi-telephone::before,
[dir="rtl"] .bi-envelope::before,
[dir="rtl"] .bi-geo-alt::before,
[dir="rtl"] .bi-calendar::before,
[dir="rtl"] .bi-clock::before,
[dir="rtl"] .bi-award::before,
[dir="rtl"] .bi-shield::before,
[dir="rtl"] .bi-lightbulb::before,
[dir="rtl"] .bi-tree::before,
[dir="rtl"] .bi-eye::before,
[dir="rtl"] .bi-bullseye::before {
  transform: none;
}

/* ============================================
   Button and Link RTL Adjustments
   ============================================ */

[dir="rtl"] .btn i:first-child {
  margin-right: 0;
  margin-left: 8px;
}

[dir="rtl"] .btn i:last-child {
  margin-left: 0;
  margin-right: 8px;
}

/* ============================================
   Form Elements RTL
   ============================================ */

[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select {
  text-align: right;
}

[dir="rtl"] input::placeholder,
[dir="rtl"] textarea::placeholder {
  text-align: right;
}

[dir="rtl"] .form-check {
  padding-left: 0;
  padding-right: 1.5em;
}

[dir="rtl"] .form-check-input {
  float: right;
  margin-left: 0;
  margin-right: -1.5em;
}

/* ============================================
   List and Content RTL
   ============================================ */

[dir="rtl"] ul,
[dir="rtl"] ol {
  padding-left: 0;
  padding-right: 2rem;
}

[dir="rtl"] li {
  text-align: right;
}

/* ============================================
   Card and Component RTL
   ============================================ */

[dir="rtl"] .card {
  text-align: right;
}

[dir="rtl"] .card-body {
  text-align: right;
}

/* ============================================
   Breadcrumb RTL
   ============================================ */

[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
  float: right;
  padding-right: 0;
  padding-left: 0.5rem;
  content: "/";
}

/* ============================================
   Modal RTL
   ============================================ */

[dir="rtl"] .modal-header .btn-close {
  margin: -0.5rem auto -0.5rem -0.5rem;
}

/* ============================================
   Smooth Transitions
   ============================================ */

html,
body {
  transition: direction 0.3s ease;
}

/* Font transition for smooth switching */
html {
  transition: font-family 0.2s ease;
}

/* ============================================
   Mobile Responsive RTL
   ============================================ */

@media (max-width: 991.98px) {
  [dir="rtl"] .navbar-collapse {
    text-align: right;
  }
  
  [dir="rtl"] .navbar-nav {
    align-items: flex-end;
  }
  
  .language-switcher {
    margin-left: 0;
    margin-top: 10px;
    justify-content: flex-start;
  }
  
  [dir="rtl"] .language-switcher {
    margin-right: 0;
    justify-content: flex-end;
  }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .language-switcher {
    display: none;
  }
}

/* ============================================
   Accessibility Enhancements
   ============================================ */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .lang-btn.active {
    outline: 2px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  html,
  body,
  .lang-btn {
    transition: none;
  }
}

/* ============================================
   Language-Specific Typography Adjustments
   ============================================ */

/* Arabic text typically needs slightly larger line height */
html[lang="ar"] {
  line-height: 1.8;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3 {
  line-height: 1.4;
}

/* Adjust letter spacing for Arabic */
html[lang="ar"] {
  letter-spacing: 0;
}

/* ============================================
   Custom Component RTL Support
   ============================================ */

/* Hero section */
[dir="rtl"] .hero-content {
  text-align: center;
}

/* Stats section */
[dir="rtl"] .stats-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .stats-item i {
  margin-right: 0;
  margin-left: 20px;
}

/* Footer */
[dir="rtl"] footer {
  text-align: right;
}

[dir="rtl"] .footer-links ul {
  padding-right: 0;
}

/* Scroll to top button */
[dir="rtl"] #scroll-top {
  left: 20px;
  right: auto;
}
