/* Arabic Language Support CSS */

/* Import Google Fonts for Arabic */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@300;400;500;600;700&display=swap');

/* Arabic Font Classes */
.arabic-font {
    font-family: 'Cairo', 'Noto Sans Arabic', 'Segoe UI', 'Tahoma', sans-serif;
}

/* RTL Layout Styles */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] body,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, 
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6,
[dir="rtl"] p, [dir="rtl"] span, [dir="rtl"] div,
[dir="rtl"] a, [dir="rtl"] button, [dir="rtl"] input,
[dir="rtl"] textarea, [dir="rtl"] select {
    font-family: 'Cairo', 'Noto Sans Arabic', 'Segoe UI', 'Tahoma', sans-serif;
    line-height: 1.8;
}

/* Fix Bootstrap RTL Issues */
[dir="rtl"] .navbar-nav {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-item {
    margin-left: 0;
    margin-right: 1rem;
}

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

[dir="rtl"] .dropdown-item {
    text-align: right;
    padding-right: 1rem;
    padding-left: 3rem;
}

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

/* Form Elements RTL */
[dir="rtl"] .form-control,
[dir="rtl"] .form-select {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .input-group > .form-control {
    text-align: right;
}

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

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

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

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

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

[dir="rtl"] .modal-body {
    text-align: right;
}

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

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

/* Pagination RTL */
[dir="rtl"] .pagination {
    flex-direction: row-reverse;
}

/* Breadcrumb RTL */
[dir="rtl"] .breadcrumb {
    flex-direction: row-reverse;
}

/* List Group RTL */
[dir="rtl"] .list-group-item {
    text-align: right;
}

/* Progress Bar RTL */
[dir="rtl"] .progress-bar {
    flex-direction: row-reverse;
}

/* Carousel RTL */
[dir="rtl"] .carousel-control-prev {
    left: auto;
    right: 0;
}

[dir="rtl"] .carousel-control-next {
    right: auto;
    left: 0;
}

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

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

/* Language Switcher Improvements */
.language-switcher .dropdown-toggle {
    font-weight: 500;
    transition: all 0.3s ease;
}

.language-switcher .dropdown-item {
    font-weight: 400;
    transition: all 0.2s ease;
}

.language-switcher .dropdown-item:hover {
    transform: translateX(-2px);
}

[dir="rtl"] .language-switcher .dropdown-item:hover {
    transform: translateX(2px);
}

/* Mobile Responsive for Arabic */
@media (max-width: 768px) {
    [dir="rtl"] .navbar-collapse {
        text-align: right;
    }
    
    [dir="rtl"] .navbar-nav .nav-link {
        text-align: right;
        padding-right: 0;
        padding-left: 1rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    [dir="rtl"] .dropdown-item:hover {
        background-color: #000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .language-switcher .dropdown-toggle,
    .language-switcher .dropdown-item {
        transition: none;
    }
    
    .language-switcher .dropdown-item:hover {
        transform: none;
    }
}

/* Print styles for Arabic */
@media print {
    [dir="rtl"] {
        direction: rtl;
        text-align: right;
    }
}