/* RTL (Right-to-Left) Support for Arabic */

/* Base RTL Setup */
[dir="rtl"] {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
}

/* Hero Section RTL */
[dir="rtl"] .hero-content {
    font-family: 'Cairo', sans-serif;
    text-align: right;
}

[dir="rtl"] .hero-title {
    text-align: right;
}

[dir="rtl"] .hero-subtitle {
    text-align: right;
}

/* Login Options RTL */
[dir="rtl"] .login-options-grid {
    direction: ltr; /* Keep grid layout LTR for consistency */
}

[dir="rtl"] .login-option-card {
    text-align: center; /* Center content for cards */
}

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

[dir="rtl"] .btn-arrow {
    transform: rotate(180deg);
}

[dir="rtl"] .login-btn:hover .btn-arrow {
    transform: translateX(-5px) rotate(180deg);
}

/* Features Section RTL */
[dir="rtl"] .features-grid {
    direction: ltr; /* Keep grid layout LTR */
}

[dir="rtl"] .feature-card {
    text-align: center;
}

/* Sidebar RTL */
[dir="rtl"] .sidebar {
    box-shadow: -2px 0 10px var(--shadow-color);
}

[dir="rtl"] .nav-link {
    border-left: none;
    border-right: 4px solid transparent;
    padding-left: 20px;
    padding-right: 20px;
}

[dir="rtl"] .nav-link:hover,
[dir="rtl"] .nav-link.active {
    border-right-color: var(--primary-color);
    border-left-color: transparent;
}

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

/* Header RTL */
[dir="rtl"] .top-header {
    flex-direction: row-reverse;
}

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

/* Dropdown RTL */
[dir="rtl"] .dropdown-content {
    right: auto;
    left: 0;
}

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

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

/* Form RTL */
[dir="rtl"] .form-group {
    text-align: right;
}

/* Table RTL */
[dir="rtl"] .table th,
[dir="rtl"] .table td {
    text-align: right;
}

/* Modal RTL */
[dir="rtl"] .modal-header {
    flex-direction: row-reverse;
}

/* Button RTL */
[dir="rtl"] .btn {
    text-align: center;
}

/* Card RTL */
[dir="rtl"] .card {
    text-align: right;
}

/* Language Toggle RTL */
[dir="rtl"] .lang-toggle {
    order: -1;
}

/* Responsive RTL Adjustments */
@media (max-width: 768px) {
    [dir="rtl"] .hero-section {
        text-align: center;
    }

    [dir="rtl"] .hero-content {
        text-align: center;
    }

    [dir="rtl"] .hero-title {
        text-align: center;
    }

    [dir="rtl"] .hero-subtitle {
        text-align: center;
    }

    [dir="rtl"] .top-header {
        flex-direction: column;
        text-align: center;
    }

    [dir="rtl"] .top-header h1 {
        margin-bottom: 15px;
    }

    [dir="rtl"] .header-controls {
        justify-content: center;
        flex-direction: row;
    }
}

/* Font Adjustments for Arabic */
[dir="rtl"] body {
    font-family: 'Cairo', sans-serif;
}

/* Specific Arabic Font Support */
[dir="rtl"] .hero-title,
[dir="rtl"] .section-title,
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0;
}

/* Adjust spacing for Arabic text */
[dir="rtl"] .hero-subtitle,
[dir="rtl"] .feature-card p,
[dir="rtl"] .login-option-card p {
    line-height: 1.8;
}

/* Navigation adjustments */
[dir="rtl"] .sidebar-nav a {
    text-align: right;
}

/* Ensure proper spacing in RTL */
[dir="rtl"] .container {
    padding-left: 20px;
    padding-right: 20px;
}

/* Adjust margins for RTL */
[dir="rtl"] .nav-link {
    margin-left: 0;
    margin-right: 0;
}

/* Dropdown positioning */
[dir="rtl"] .notifications-dropdown,
[dir="rtl"] .messages-dropdown {
    position: relative;
}

[dir="rtl"] .notifications-dropdown .dropdown-content,
[dir="rtl"] .messages-dropdown .dropdown-content {
    left: 0;
    right: auto;
}

/* Button text alignment */
[dir="rtl"] .login-btn span:first-child {
    text-align: right;
}

/* Card content alignment */
[dir="rtl"] .login-option-card h3,
[dir="rtl"] .login-option-card p {
    text-align: center;
}

/* Feature card alignment */
[dir="rtl"] .feature-card h3,
[dir="rtl"] .feature-card p {
    text-align: center;
}

/* Modal content alignment */
[dir="rtl"] .modal-content {
    text-align: right;
}

/* Form alignment */
[dir="rtl"] .form-input,
[dir="rtl"] .form-select {
    text-align: right;
}

/* Table alignment */
[dir="rtl"] .table {
    direction: rtl;
}

/* Ensure consistent spacing */
[dir="rtl"] .card {
    text-align: right;
}

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

/* Adjust for mobile */
@media (max-width: 480px) {
    [dir="rtl"] .hero-content,
    [dir="rtl"] .hero-image {
        padding-left: 20px;
        padding-right: 20px;
    }

    [dir="rtl"] .login-options-section {
        padding-left: 20px;
        padding-right: 20px;
    }

    [dir="rtl"] .features-section {
        padding-left: 20px;
        padding-right: 20px;
    }
}
