/* RTL Support for Arabic Language */
/* Applied when html has dir="rtl" attribute */

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

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

/* Navigation RTL */
html[dir="rtl"] .navigation {
    float: right;
}

html[dir="rtl"] .navigation li {
    float: right;
}

html[dir="rtl"] .navigation li:last-child {
    margin-left: 0;
    /*margin-right: 20px;*/
}

html[dir="rtl"] .navigation li:first-child {
    margin-right: 0;
    margin-left: 20px;
}

/* Dropdown menus RTL */
html[dir="rtl"] .navigation li.dropdown ul {
    left: auto;
    right: 0;
}

html[dir="rtl"] .navigation li.dropdown ul li {
    text-align: right;
}

/* Main Menu Dropdown Submenu RTL */
html[dir="rtl"] .main-menu .navbar-collapse>ul>li>ul {
    left: auto;
    right: 0;
}

html[dir="rtl"] .main-menu .navbar-collapse>ul>li>ul>li:before {
    content: '\f104';
    /* fa-angle-left for RTL */
    left: auto;
    right: 25px;
}

/* Main Menu Dropdown Arrow RTL */
html[dir="rtl"] .main-menu .navbar-collapse>ul>li.dropdown>a {
    padding-right: 0;
    /* Reset right padding */
    padding-left: 30px;
    /* Extra padding for arrow space in RTL */
}

html[dir="rtl"] .main-menu .navbar-collapse>ul>li.dropdown>a:after {
    margin-left: 0;
    margin-right: 15px;
    /* Increased margin for better spacing */
}

html[dir="rtl"] .main-menu .navbar-collapse>ul>li.dropdown>ul>li>a {
    padding: 9px 40px 10px 38px;
}

/* Logo RTL */
html[dir="rtl"] .logo {
    float: right;
    text-align: right;
}

html[dir="rtl"] .main-menu {
    float: left;
    text-align: left;
}

/* Buttons and Icons RTL */
html[dir="rtl"] .fa {
    margin-left: 0;
    margin-right: 8px;
}

html[dir="rtl"] .fa:last-child {
    margin-right: 0;
    margin-left: 8px;
}

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

html[dir="rtl"] .form-control {
    text-align: right;
    padding-left: 12px;
    padding-right: 15px;
}

html[dir="rtl"] input[type="text"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] textarea {
    text-align: right;
}

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

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

html[dir="rtl"] .contact-form .btn {
    float: right;
}

/* Cards and Content RTL */
html[dir="rtl"] .card,
html[dir="rtl"] .property-item,
html[dir="rtl"] .villa-item {
    text-align: right;
}

html[dir="rtl"] .card-title,
html[dir="rtl"] .property-title,
html[dir="rtl"] .villa-title {
    text-align: right;
}

/* Lists RTL */
html[dir="rtl"] ul,
html[dir="rtl"] ol {
    padding-left: 0;
    padding-right: 40px;
}

html[dir="rtl"] .list-unstyled {
    padding-right: 0;
}

/* Flex Direction RTL */
html[dir="rtl"] .d-flex {
    flex-direction: row-reverse;
}

html[dir="rtl"] .justify-content-start {
    justify-content: flex-end;
}

html[dir="rtl"] .justify-content-end {
    justify-content: flex-start;
}

/* Text Alignment RTL */
html[dir="rtl"] .text-left {
    text-align: right !important;
}

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

/* Margins and Padding RTL */
html[dir="rtl"] .mr-1,
html[dir="rtl"] .mr-2,
html[dir="rtl"] .mr-3,
html[dir="rtl"] .mr-4,
html[dir="rtl"] .mr-5 {
    margin-right: 0 !important;
}

html[dir="rtl"] .mr-1 {
    margin-left: 0.25rem !important;
}

html[dir="rtl"] .mr-2 {
    margin-left: 0.5rem !important;
}

html[dir="rtl"] .mr-3 {
    margin-left: 1rem !important;
}

html[dir="rtl"] .mr-4 {
    margin-left: 1.5rem !important;
}

html[dir="rtl"] .mr-5 {
    margin-left: 3rem !important;
}

html[dir="rtl"] .ml-1,
html[dir="rtl"] .ml-2,
html[dir="rtl"] .ml-3,
html[dir="rtl"] .ml-4,
html[dir="rtl"] .ml-5 {
    margin-left: 0 !important;
}

html[dir="rtl"] .ml-1 {
    margin-right: 0.25rem !important;
}

html[dir="rtl"] .ml-2 {
    margin-right: 0.5rem !important;
}

html[dir="rtl"] .ml-3 {
    margin-right: 1rem !important;
}

html[dir="rtl"] .ml-4 {
    margin-right: 1.5rem !important;
}

html[dir="rtl"] .ml-5 {
    margin-right: 3rem !important;
}

/* Padding RTL */
html[dir="rtl"] .pr-1,
html[dir="rtl"] .pr-2,
html[dir="rtl"] .pr-3,
html[dir="rtl"] .pr-4,
html[dir="rtl"] .pr-5 {
    padding-right: 0 !important;
}

html[dir="rtl"] .pr-1 {
    padding-left: 0.25rem !important;
}

html[dir="rtl"] .pr-2 {
    padding-left: 0.5rem !important;
}

html[dir="rtl"] .pr-3 {
    padding-left: 1rem !important;
}

html[dir="rtl"] .pr-4 {
    padding-left: 1.5rem !important;
}

html[dir="rtl"] .pr-5 {
    padding-left: 3rem !important;
}

html[dir="rtl"] .pl-1,
html[dir="rtl"] .pl-2,
html[dir="rtl"] .pl-3,
html[dir="rtl"] .pl-4,
html[dir="rtl"] .pl-5 {
    padding-left: 0 !important;
}

html[dir="rtl"] .pl-1 {
    padding-right: 0.25rem !important;
}

html[dir="rtl"] .pl-2 {
    padding-right: 0.5rem !important;
}

html[dir="rtl"] .pl-3 {
    padding-right: 1rem !important;
}

html[dir="rtl"] .pl-4 {
    padding-right: 1.5rem !important;
}

html[dir="rtl"] .pl-5 {
    padding-right: 3rem !important;
}

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

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

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

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

/* Border Radius RTL */
html[dir="rtl"] .rounded-left {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 0.25rem !important;
    border-bottom-right-radius: 0.25rem !important;
}

html[dir="rtl"] .rounded-right {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 0.25rem !important;
    border-bottom-left-radius: 0.25rem !important;
}

/* Gallery RTL */
html[dir="rtl"] .gallery-item {
    text-align: right;
}

html[dir="rtl"] .gallery-caption {
    text-align: right;
}

/* Banner RTL */
html[dir="rtl"] .banner-content {
    text-align: right;
}

html[dir="rtl"] .banner .address p {
    text-align: right;
}

/* Section Titles RTL */
html[dir="rtl"] .section-title {
    text-align: right;
}

html[dir="rtl"] .section-title h2,
html[dir="rtl"] .section-title h3 {
    text-align: right;
}

/* About Section RTL */
html[dir="rtl"] .about-text {
    text-align: right;
}

/* Footer RTL */
html[dir="rtl"] .footer {
    text-align: right;
}

html[dir="rtl"] .footer .widget {
    text-align: right;
}

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

html[dir="rtl"] .footer ul li {
    text-align: right;
}

/* Social Media Icons RTL */
html[dir="rtl"] .social-links {
    text-align: right;
}

html[dir="rtl"] .social-links a {
    margin-left: 10px;
    margin-right: 0;
}

html[dir="rtl"] .social-links a:first-child {
    margin-left: 0;
}

/* Language Switcher Styles */
.language-switcher {
    position: relative;
    display: inline-block;
    margin-left: 15px;
}

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

.language-switcher .current-lang {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    min-width: 80px;
    justify-content: center;
    transition: all 0.3s ease;
}

.language-switcher .current-lang:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
}

.language-switcher .lang-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

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

.language-switcher:hover .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-switcher .lang-dropdown a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.language-switcher .lang-dropdown a:hover {
    background-color: #f8f9fa;
    color: #333;
}

.language-switcher .lang-dropdown a.active {
    background-color: #007bff;
    color: white;
}

/* Responsive RTL */
@media (max-width: 768px) {
    html[dir="rtl"] .navbar-toggle {
        float: left;
        margin-left: 15px;
        margin-right: 0;
    }

    html[dir="rtl"] .logo {
        float: left;
    }

    html[dir="rtl"] .main-menu {
        float: none;
        text-align: center;
    }

    html[dir="rtl"] .navigation li {
        float: none;
        display: block;
        text-align: center;
    }
}