/* Language Selector */
.language-selector {
  position: relative;
  margin-left: 15px;
}

.language-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-color);
  font-weight: 500;
  font-size: 0.9rem;
}

.language-btn:hover {
  background: var(--light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-light);
}

.language-btn i:first-child {
  color: var(--primary);
}

.current-lang {
  font-weight: 600;
  min-width: 30px;
}

.language-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  overflow: hidden;
}

.language-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  color: var(--dark);
  font-size: 0.95rem;
}

.lang-option:hover {
  background: var(--light);
}

.lang-option.active {
  background: var(--primary);
  color: white;
}

.lang-option.active .lang-flag {
  opacity: 1;
}

.lang-flag {
  font-size: 0.7rem;
  color: var(--gray);
  opacity: 0.8;
}

.lang-text {
  flex: 1;
}

/* RTL support for Arabic */
[dir="rtl"] .language-selector {
  margin-left: 0;
  margin-right: 15px;
}

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

[dir="rtl"] .lang-option {
  text-align: right;
}

/* RTL Support */
[dir="rtl"] body {
  text-align: right;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

[dir="rtl"] .logo h1 {
  font-family: "Poppins", "Segoe UI", sans-serif;
  margin-right: 8px;
}

[dir="rtl"] header nav ul li {
  margin-left: 0;
  margin-right: 30px;
}

[dir="rtl"] .theme-toggle {
  margin-left: 0;
  margin-right: 20px;
  flex-direction: row-reverse;
}

[dir="rtl"] .logos-slider {
  flex-direction: row-reverse;
}

[dir="rtl"] .fa-chevron-right::before {
  content: "\f053" !important;
}

[dir="rtl"] .fa-chevron-left::before {
  content: "\f054" !important;
}

[dir="rtl"] .about .container {
  direction: rtl;
}

[dir="rtl"] .home-content {
  text-align: right;
}

[dir="rtl"] .owner-card {
  flex-direction: row-reverse;
}

[dir="rtl"] .btns {
  flex-direction: row-reverse;
}

[dir="rtl"] .fa-arrow-right:before {
  content: "\f060" !important;
}

[dir="rtl"] .contact-method {
  direction: ltr;
  flex-direction: row-reverse;
}

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

[dir="rtl"] .spec-icon {
  margin-left: 15px;
}

[dir="rtl"] .card-ficon {
  margin-left: 20px;
}

[dir="rtl"] .spec-value {
  direction: ltr;
}

[dir="rtl"] .min-value {
  direction: ltr;
}

[dir="rtl"] .rec-value {
  direction: ltr;
}

[dir="rtl"] .screenshot {
  flex-direction: row-reverse;
}

[dir="rtl"] .footer-links a i {
  margin-right: 0;
  margin-left: 10px;
}

[dir="rtl"] .footer-lang i {
  margin-right: 0;
  margin-left: 10px;
}

[dir="rtl"] .footer-column h3::after {
  right: 0;
}

/* Arabic font fallback */
[lang="ar"] {
  font-family: "Segoe UI", "Arial", sans-serif;
}

[lang="ar"] h1,
[lang="ar"] h2,
[lang="ar"] h3,
[lang="ar"] h4 {
  font-weight: 600;
}

/* Footer languages */
.footer-lang {
  background: none;
  border: none;
  color: #cbd5e0;
  text-align: left;
  cursor: pointer;
  transition: color 0.3s;
  font-size: 1rem;
}

.footer-lang:hover {
  color: var(--primary);
}

/* Dark mode */
[data-theme="dark"] .language-btn {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .language-dropdown {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .lang-option {
  color: var(--text-color);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .language-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .language-btn span:not(.current-lang) {
    display: none;
  }

  .language-dropdown {
    min-width: 160px;
  }
}

/* Add to index.css */
.multiple-text {
  min-height: 60px;
  display: inline-block;
  vertical-align: middle;
}

/* Loading state during language switch */
.multiple-text.loading {
  opacity: 0.5;
}

.multiple-text.loading::after {
  content: "...";
  animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
  0%,
  20% {
    content: ".";
  }
  40% {
    content: "..";
  }
  60%,
  100% {
    content: "...";
  }
}