/**
 * Amanah GO - RTL Support for Arabic
 */

/* RTL-specific overrides */
[dir="rtl"] {
  text-align: right;
}

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

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

/* Flip margins and paddings */
[dir="rtl"] .ml-2 { margin-right: 0.5rem; margin-left: 0; }
[dir="rtl"] .mr-2 { margin-left: 0.5rem; margin-right: 0; }
[dir="rtl"] .ml-3 { margin-right: 0.75rem; margin-left: 0; }
[dir="rtl"] .mr-3 { margin-left: 0.75rem; margin-right: 0; }
[dir="rtl"] .ml-4 { margin-right: 1rem; margin-left: 0; }
[dir="rtl"] .mr-4 { margin-left: 1rem; margin-right: 0; }

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

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

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

/* Language switcher */
.lang-switcher {
  position: relative;
  display: inline-block;
}

.lang-switcher-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-switcher-button:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

/* Compact button - Flag only */
.lang-switcher-button-compact {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.6rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 60px;
  justify-content: center;
}

.lang-switcher-button-compact:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.lang-flag-large {
  font-size: 1.5rem;
  line-height: 1;
}

/* Minimal button - Flag only (no chevron, no border) */
.lang-switcher-minimal {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 0.375rem;
}

.lang-switcher-minimal:hover {
  background: #f3f4f6;
  transform: scale(1.1);
}

.lang-flag-only {
  font-size: 1.75rem;
  line-height: 1;
  display: block;
}

.lang-switcher-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 50;
}

[dir="rtl"] .lang-switcher-dropdown {
  /* Centering works the same in RTL */
  left: 50%;
  transform: translateX(-50%);
}

.lang-switcher-dropdown.show {
  display: block;
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.lang-option:hover {
  background: #f3f4f6;
}

.lang-option:first-child {
  border-radius: 0.5rem 0.5rem 0 0;
}

.lang-option:last-child {
  border-radius: 0 0 0.5rem 0.5rem;
}

.lang-option.active {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}

.lang-flag {
  font-size: 1.5rem;
  line-height: 1;
}

.lang-option > span:nth-child(2) {
  flex: 1;
  text-align: left;
}

.lang-option > i {
  margin-left: auto;
}
