/* Language Support CSS */

/* RTL Support for Arabic */
html[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .navbar-nav {
    margin-right: auto !important;
    margin-left: 0 !important;
}

html[dir="rtl"] .ml-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

html[dir="rtl"] .mr-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
}

html[dir="rtl"] .float-right {
    float: left !important;
}

html[dir="rtl"] .float-left {
    float: right !important;
}

html[dir="rtl"] .text-left {
    text-align: right !important;
}

html[dir="rtl"] .text-right {
    text-align: left !important;
}

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

html[dir="rtl"] .fas.fa-long-arrow-alt-right {
    transform: scaleX(-1);
}

/* Language Switcher Buttons */
.language-switcher {
    display: flex;
    gap: 5px;
    margin-left: 15px;
}

html[dir="rtl"] .language-switcher {
    margin-left: 0;
    margin-right: 15px;
}

.lang-btn {
    min-width: 45px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.lang-btn.active {
    background-color: #007bff !important;
    color: white !important;
    border-color: #007bff !important;
}

/* Language dropdown styling */
.language-switcher .dropdown-toggle {
    padding: 5px 15px;
    font-size: 14px;
}

.lang-option {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.lang-option:hover {
    background-color: #f8f9fa;
}

.lang-option.active {
    background-color: #007bff;
    color: white !important;
}

.lang-option.active:hover {
    background-color: #0056b3;
    color: white !important;
}

.flag-icon {
    margin-right: 8px;
    font-size: 16px;
}

html[dir="rtl"] .flag-icon {
    margin-right: 0;
    margin-left: 8px;
}

/* Smooth transition for language changes */
[data-translate] {
    transition: opacity 0.2s ease;
}

/* Mobile responsive language switcher */
@media (max-width: 991px) {
    .language-switcher {
        justify-content: center;
        margin: 10px 0;
        padding: 10px 0;
        border-top: 1px solid #eee;
    }
    
    html[dir="rtl"] .language-switcher {
        margin: 10px 0;
    }
}

/* Ensure proper spacing for Arabic text */
html[lang="ar"] {
    font-family: 'Arial', 'Helvetica', sans-serif;
    line-height: 1.8;
}

/* Fix alignment issues in forms for RTL */
html[dir="rtl"] .form-control {
    text-align: right;
}

html[dir="rtl"] .input-group-btn {
    direction: ltr;
}

/* Keep owl carousel in LTR mode for all languages */
#customers-slider.owl-carousel {
    direction: ltr !important;
}

.customers-box {
    direction: ltr;
}

html[dir="rtl"] .customers-box {
    direction: ltr;
}