/* RTL Support for Arabic Language */
.rtl {
    direction: rtl;
}

.rtl .flex {
    flex-direction: row-reverse;
}

.rtl .space-x-2 > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1;
    margin-right: calc(0.5rem * var(--tw-space-x-reverse));
    margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
}

.rtl .space-x-3 > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1;
    margin-right: calc(0.75rem * var(--tw-space-x-reverse));
    margin-left: calc(0.75rem * calc(1 - var(--tw-space-x-reverse)));
}

.rtl .space-x-4 > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1;
    margin-right: calc(1rem * var(--tw-space-x-reverse));
    margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
}

.rtl .space-x-6 > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1;
    margin-right: calc(1.5rem * var(--tw-space-x-reverse));
    margin-left: calc(1.5rem * calc(1 - var(--tw-space-x-reverse)));
}

.rtl .text-left {
    text-align: right;
}

.rtl .text-right {
    text-align: left;
}

/* RTL Navigation */
.rtl .nav-link::after {
    right: 0;
    left: auto;
}

.rtl .footer-link::after {
    right: 0;
    left: auto;
}

/* RTL Language Dropdown */
.rtl #languageDropdown {
    left: 0;
    right: auto;
}

/* RTL Hero Section */
.rtl .hero-bg {
    text-align: right;
}

/* RTL Grid layouts */
.rtl .grid {
    direction: rtl;
}

/* RTL Form Elements */
.rtl input,
.rtl textarea,
.rtl select {
    text-align: right;
    direction: rtl;
}

.rtl input::placeholder,
.rtl textarea::placeholder {
    text-align: right;
}

/* RTL Icons and Buttons */
.rtl .ri-arrow-right-line:before {
    content: "\EA64"; /* arrow-left-line */
}

.rtl .ri-arrow-left-line:before {
    content: "\EA6C"; /* arrow-right-line */
}

/* RTL Mobile Menu */
.rtl #mobileMenu {
    text-align: right;
}

.rtl #mobileMenu .nav-link {
    display: inline-block;
    text-align: right;
}

/* RTL Benefits Section */
.rtl .flex.items-start {
    flex-direction: row-reverse;
}

.rtl .flex.items-start .space-x-4 > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1;
    margin-right: calc(1rem * var(--tw-space-x-reverse));
    margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
}

/* RTL Footer */
.rtl footer {
    direction: rtl;
}

.rtl footer .text-center {
    text-align: center;
}

/* RTL Cards */
.rtl .rounded-2xl {
    text-align: right;
}

/* RTL Notification */
.rtl .fixed.top-20.right-6 {
    right: auto;
    left: 1.5rem;
}

/* Smooth Transition for RTL */
* {
    transition: margin 0.3s ease, padding 0.3s ease, text-align 0.3s ease;
}

/* Arabic Font Improvements */
.rtl {
    font-family: 'Noto Sans Arabic', 'Cairo', 'Amiri', 'Scheherazade New', 'Inter', sans-serif;
}

.rtl h1, .rtl h2, .rtl h3, .rtl h4, .rtl h5, .rtl h6 {
    font-weight: 600;
    line-height: 1.4;
}

.rtl p {
    line-height: 1.7;
}

/* Fix for specific components */
.rtl .language-option {
    text-align: right;
    justify-content: flex-end;
}

.rtl .language-option .flex {
    flex-direction: row-reverse;
}
