/**
 * Nomino i18n Styles
 * RTL support and language switcher styling
 */

/* Language Switcher */
.language-switcher {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: currentColor;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='currentColor' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
  padding-right: 2.5rem;
  min-width: 150px;
}

.language-switcher:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.language-switcher:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.language-switcher option {
  background: #1f2937;
  color: #ffffff;
  padding: 0.5rem;
}

/* RTL Support */
html[dir="rtl"] {
  direction: rtl;
}

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

/* RTL Navigation */
html[dir="rtl"] .nav_menu-list {
  flex-direction: row-reverse;
}

html[dir="rtl"] .nav_left {
  order: 2;
}

html[dir="rtl"] .nav_menu {
  order: 1;
}

html[dir="rtl"] .nav_right {
  order: 0;
}

/* RTL Language Switcher */
html[dir="rtl"] .language-switcher {
  background-position: left 0.75rem center;
  padding-left: 2.5rem;
  padding-right: 1rem;
}

/* RTL Text Alignment */
html[dir="rtl"] .text-rich-text,
html[dir="rtl"] .w-richtext {
  text-align: right;
}

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

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

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

/* RTL Lists */
html[dir="rtl"] ul,
html[dir="rtl"] ol {
  padding-right: 1.5rem;
  padding-left: 0;
}

html[dir="rtl"] li {
  text-align: right;
}

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

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

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

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

/* RTL Flexbox adjustments */
html[dir="rtl"] .flex_horizontal {
  flex-direction: row-reverse;
}

html[dir="rtl"] .is-space-between {
  flex-direction: row-reverse;
}

/* RTL Margin adjustments */
html[dir="rtl"] .margin-right_medium {
  margin-right: 0;
  margin-left: 1.5rem;
}

html[dir="rtl"] .margin-left_medium {
  margin-left: 0;
  margin-right: 1.5rem;
}

/* RTL Support page sidebar */
html[dir="rtl"] .support-sidebar {
  order: 2;
}

html[dir="rtl"] .support-content {
  order: 1;
}

html[dir="rtl"] .support-page-wrapper {
  flex-direction: row-reverse;
}

/* RTL Button groups */
html[dir="rtl"] .button-group {
  flex-direction: row-reverse;
}

/* Mobile RTL adjustments */
@media (max-width: 991px) {
  html[dir="rtl"] .nav_menu-list-item {
    text-align: right;
  }
  
  html[dir="rtl"] .language-switcher {
    width: 100%;
    margin-top: 0.5rem;
  }
}

/* Ensure proper font rendering for RTL */
html[dir="rtl"] {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* Arabic-specific font adjustments */
html[lang="ar"] {
  font-family: -apple-system, BlinkMacSystemFont, "SF Arabic", "Segoe UI", Arial, sans-serif;
}

/* Chinese/Japanese/Korean font support */
html[lang^="zh"],
html[lang="ja"],
html[lang="ko"] {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Meiryo", "Malgun Gothic", sans-serif;
}

/* Ensure proper line height for CJK languages */
html[lang^="zh"],
html[lang="ja"],
html[lang="ko"] {
  line-height: 1.8;
}

