
html[dir="rtl"], body[dir="rtl"] {
  direction: rtl;
  unicode-bidi: embed;
  text-align: right;
}
/* =========================================================
   RTL SIDEBAR - DESKTOP
   Mobilde tema kendi responsive yapısını kullansın.
   ========================================================= */

@media (min-width: 992px) {

    html[dir="rtl"] body[data-layout="detached"] .vertical-menu {
        position: absolute !important;
        top: 70px !important;
        bottom: auto !important;
        left: 45px !important;
        right: auto !important;
        width: 250px !important;
        min-width: 250px !important;
        max-width: 250px !important;
    }

    html[dir="rtl"] body[data-layout="detached"] .main-content {
        margin-left: 250px !important;
        margin-right: 0 !important;
        width: calc(100% - 250px) !important;
    }

    html[dir="rtl"] body[data-layout="detached"] .main-content .page-content {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
  text-align: right;
}


[dir="rtl"] p,
[dir="rtl"] span,
[dir="rtl"] a,
[dir="rtl"] li,
[dir="rtl"] label {
  text-align: right;
  direction: rtl;
}


[dir="rtl"] ul,
[dir="rtl"] ol {
  padding-right: 20px;
  padding-left: 0;
  margin-right: 0;
  margin-left: auto;
}


[dir="rtl"] nav,
[dir="rtl"] .navbar,
[dir="rtl"] .menu {
  text-align: right;
}


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


[dir="rtl"] button {
  text-align: center;
}


.force-ltr {
  direction: ltr !important;
  unicode-bidi: embed;
}




/* Mobil alt menü RTL diller için yüzde tabanlı sağ-sol boşluk */
html[dir="rtl"] .menu-mobile .menu-list {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    padding: 0 5% !important;        /* sağ-sol boşluk yüzde ile */
    display: flex !important;
    justify-content: space-between !important;  /* öğeler arası eşit boşluk */
    width: 100% !important;          /* tam genişlik */
    box-sizing: border-box !important;
}


/* Menü öğeleri */
html[dir="rtl"] .menu-mobile .menu-list .menu-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    flex: 1 1 0 !important;       /* her biri eşit genişlik alır */
    min-width: 0 !important;      /* flex shrink çalışsın */
    text-align: center !important;
    white-space: nowrap !important;  /* alt satıra geçmesin */
    overflow: hidden !important;     /* taşarsa gizle */
    text-overflow: ellipsis !important; /* ... koyar */
}


/* Menü öğe içindeki a ve ikon/div */
html[dir="rtl"] .menu-mobile .menu-list .menu-item a {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
}

/* RTL için kart içindeki mini ikon ve metin arasını aç */
html[dir="rtl"] .card-heading .mini-stat-icon {
    float: left !important;       /* İkonu solda göster */
    margin-left: 15px;            /* İkon ile metin arası boşluk */
    margin-right: 0 !important;
}

html[dir="rtl"] .card-heading h5,
html[dir="rtl"] .card-heading h3,
html[dir="rtl"] .card-heading a {
    text-align: right;            /* Başlık ve metin sağa hizalı */
}

/* ---------------------
   LANGUAGE DROPDOWN: robust CSS
   --------------------- */

/* Genel: toggle (görünen dil) ve dropdown içindeki tüm img'leri hedefle */
.navbar .nav-link.dropdown-toggle img,
.language-dropdown .dropdown-item img,
.language-dropdown .dropdown-item .flag-icon,
.navbar .language-item img,
.dropdown-item img {
  display: inline-block !important;
  flex-shrink: 0 !important;
  margin-right: 8px !important;  /* LTR default */
  margin-left: 0 !important;
}

/* Toggle ve dropdown satırlarını flex yap */
.navbar .nav-link.dropdown-toggle,
.language-dropdown .dropdown-item {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important; /* modern tarayıcılar için ek boşluk (text node yoksa işe yarar) */
  white-space: nowrap !important;
}

/* RTL override: margin tersine çevir, iç yönü ters çevir */
html[dir="rtl"] .navbar .nav-link.dropdown-toggle img,
html[dir="rtl"] .language-dropdown .dropdown-item img,
html[dir="rtl"] .dropdown-item img {
  margin-left: 8px !important;
  margin-right: 0 !important;
}

/* RTL: dropdown satırlarını ters sıraya al (img sağda, yazı solda) */
html[dir="rtl"] .language-dropdown .dropdown-item {
  flex-direction: row-reverse !important;
}

/* Eğer metin direct text node ise span.language-name kullanılacak; fallback stil */
.language-name {
  display: inline-block;
  vertical-align: middle;
  margin: 0 !important;
  padding: 0 !important;
}
/* Varsayılan: LTR diller için bayrak ile yazı arasında boşluk */
.language-switch img,
.nav-item.dropdown img {
  margin-right: 8px;
  margin-left: 0;
}

/* RTL diller için ters çevir */
html[dir="rtl"] .language-switch img,
html[dir="rtl"] .nav-item.dropdown img {
  margin-right: 0;
  margin-left: 8px;
}

/* =========================================================
   FAQ RTL
   ========================================================= */

html[dir="rtl"] #faq {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] #faq .card {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] #faq .card-header {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] #faq .card-header h2 {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] #faq .card-header h2 .btn-link {
    display: block !important;
    width: 100% !important;
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] #faq .card-body {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] #faq .card-body p,
html[dir="rtl"] #faq .card-body div,
html[dir="rtl"] #faq .card-body li {
    direction: rtl !important;
    text-align: right !important;
}
