/* ===== RTL Support Styles ===== */

/* Base RTL styles */
.rtl {
  direction: rtl;
  text-align: right;
}

.ltr {
  direction: ltr;
  text-align: left;
}

/* RTL Float adjustments */
.rtl .float-left {
  float: right !important;
}

.rtl .float-right {
  float: left !important;
}

/* RTL Margin adjustments */
.rtl .ml-1 { margin-right: 0.25rem !important; margin-left: 0 !important; }
.rtl .ml-2 { margin-right: 0.5rem !important; margin-left: 0 !important; }
.rtl .ml-3 { margin-right: 0.75rem !important; margin-left: 0 !important; }
.rtl .ml-4 { margin-right: 1rem !important; margin-left: 0 !important; }
.rtl .ml-auto { margin-right: auto !important; margin-left: 0 !important; }

.rtl .mr-1 { margin-left: 0.25rem !important; margin-right: 0 !important; }
.rtl .mr-2 { margin-left: 0.5rem !important; margin-right: 0 !important; }
.rtl .mr-3 { margin-left: 0.75rem !important; margin-right: 0 !important; }
.rtl .mr-4 { margin-left: 1rem !important; margin-right: 0 !important; }
.rtl .mr-auto { margin-left: auto !important; margin-right: 0 !important; }

/* RTL Padding adjustments */
.rtl .pl-1 { padding-right: 0.25rem !important; padding-left: 0 !important; }
.rtl .pl-2 { padding-right: 0.5rem !important; padding-left: 0 !important; }
.rtl .pl-3 { padding-right: 0.75rem !important; padding-left: 0 !important; }
.rtl .pl-4 { padding-right: 1rem !important; padding-left: 0 !important; }

.rtl .pr-1 { padding-left: 0.25rem !important; padding-right: 0 !important; }
.rtl .pr-2 { padding-left: 0.5rem !important; padding-right: 0 !important; }
.rtl .pr-3 { padding-left: 0.75rem !important; padding-right: 0 !important; }
.rtl .pr-4 { padding-left: 1rem !important; padding-right: 0 !important; }

/* RTL Text alignment */
.rtl .text-left { text-align: right !important; }
.rtl .text-right { text-align: left !important; }

/* RTL Border radius adjustments */
.rtl .rounded-l-none { border-radius: 0 0 0.375rem 0.375rem !important; }
.rtl .rounded-r-none { border-radius: 0.375rem 0.375rem 0 0 !important; }
.rtl .rounded-l { border-radius: 0 0.375rem 0.375rem 0 !important; }
.rtl .rounded-r { border-radius: 0.375rem 0 0 0.375rem !important; }

/* RTL Flexbox adjustments */
.rtl .flex-row { flex-direction: row-reverse !important; }
.rtl .justify-start { justify-content: flex-end !important; }
.rtl .justify-end { justify-content: flex-start !important; }

/* Language Selector RTL adjustments */
.rtl .language-selector {
  direction: rtl;
}

.rtl .language-selector .dropdown-menu {
  right: 0;
  left: auto;
  text-align: right;
}

.rtl .language-selector .current-language {
  flex-direction: row-reverse;
}

.rtl .language-selector .current-language .flag {
  margin-left: 0.5rem;
  margin-right: 0;
}

.rtl .language-selector .language-option {
  text-align: right;
  flex-direction: row-reverse;
}

.rtl .language-selector .language-option .flag {
  margin-left: 0.5rem;
  margin-right: 0;
}

/* Header RTL adjustments */
.rtl .header-desktop {
  direction: rtl;
}

.rtl .header-desktop .nav-menu {
  flex-direction: row-reverse;
}

.rtl .header-desktop .nav-item {
  margin-left: 1rem;
  margin-right: 0;
}

.rtl .header-desktop .auth-buttons {
  order: -1;
}

/* Modal RTL adjustments */
.rtl .modal-content {
  text-align: right;
}

.rtl .modal-header {
  flex-direction: row-reverse;
}

.rtl .modal-close {
  left: 1rem;
  right: auto;
}

/* Form RTL adjustments */
.rtl .form-group label {
  text-align: right;
}

.rtl .form-input {
  text-align: right;
}

.rtl .form-checkbox {
  flex-direction: row-reverse;
}

.rtl .form-checkbox input {
  margin-left: 0.5rem;
  margin-right: 0;
}

/* Button RTL adjustments */
.rtl .btn-with-icon {
  flex-direction: row-reverse;
}

.rtl .btn-with-icon .icon {
  margin-left: 0.5rem;
  margin-right: 0;
}

/* Hero Section RTL adjustments */
.rtl .hero-section {
  text-align: right;
}

.rtl .hero-content {
  text-align: right;
}

/* Footer RTL adjustments */
.rtl .footer {
  direction: rtl;
}

.rtl .footer-content {
  text-align: right;
}

.rtl .footer-links {
  flex-direction: row-reverse;
}

/* Responsive RTL adjustments */
@media (max-width: 768px) {
  .rtl .mobile-menu {
    direction: rtl;
    text-align: right;
  }

  .rtl .mobile-nav-item {
    text-align: right;
  }
}

/* Dark mode RTL adjustments */
.dark .rtl .language-selector .dropdown-menu {
  background: var(--dark-bg);
  border-color: var(--border-color-dark);
}

/* Animation adjustments for RTL */
.rtl .slide-in-left {
  animation: slide-in-right 0.3s ease-out;
}

.rtl .slide-in-right {
  animation: slide-in-left 0.3s ease-out;
}

@keyframes slide-in-right {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slide-in-left {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Tooltip RTL adjustments */
.rtl .tooltip {
  text-align: right;
}

.rtl .tooltip-arrow-left {
  right: -5px;
  left: auto;
  border-left-color: transparent;
  border-right-color: var(--tooltip-bg);
}

.rtl .tooltip-arrow-right {
  left: -5px;
  right: auto;
  border-right-color: transparent;
  border-left-color: var(--tooltip-bg);
}
