/**
 * AqarPro CRM - RTL Stylesheet
 * Arabic/RTL Language Support
 */

/* Base RTL */
.rtl {
    direction: rtl;
    text-align: right;
}

/* Navigation */
.rtl .navbar-menu {
    flex-direction: row-reverse; 
}

.rtl .navbar-nav {
    flex-direction: row-reverse;
}

.rtl .navbar-actions {
    flex-direction: row-reverse;
}

/* Hero */
.rtl .hero-cta {
    flex-direction: row-reverse;
}

.rtl .hero-features {
    flex-direction: row-reverse;
}

/* Features */
.rtl .feature-card {
    text-align: center;
}

/* Pricing */
.rtl .pricing-features li {
    flex-direction: row-reverse;
}

/* Testimonials */
.rtl .testimonial-author {
    flex-direction: row-reverse;
}

/* Contact */
.rtl .contact-item {
    flex-direction: row-reverse;
}

/* Forms */
.rtl .form-options {
    flex-direction: row-reverse;
}

.rtl .checkbox-label {
    flex-direction: row-reverse;
}

/* Auth */
.rtl .auth-features {
    align-items: flex-end;
}

.rtl .auth-feature {
    flex-direction: row-reverse;
}

.rtl .trial-info {
    flex-direction: row-reverse;
}

.rtl .trial-badge {
    flex-direction: row-reverse;
}

/* Footer */
.rtl .footer-contact li {
    flex-direction: row-reverse;
}

.rtl .social-links {
    flex-direction: row-reverse;
}

/* Buttons with icons */
.rtl .btn i {
    order: 1;
}

/* Lists */
.rtl .feature-list li,
.rtl .pricing-features li {
    flex-direction: row-reverse;
}

/* Alerts */
.rtl .alert {
    flex-direction: row-reverse;
}

/* Steps */
.rtl .steps-grid {
    direction: rtl;
}

/* Feature blocks */
.rtl .feature-block {
    direction: rtl;
}

.rtl .feature-block.reverse {
    direction: ltr;
}

.rtl .feature-block .feature-content {
    direction: rtl;
    text-align: right;
}

/* FAQ */
.rtl .faq-item {
    text-align: right;
}

/* Contact info cards */
.rtl .contact-info-card {
    text-align: center;
}

/* Navbar toggle animation - Mobile only */
@media (max-width: 991px) {
    .rtl .navbar-menu {
        transform: translateX(-100%);
        background: #ffffff;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15); 
    }

    .rtl .navbar-menu.active {
        transform: translateX(0); 
    }
    
    .rtl .navbar-nav {
        align-items: stretch;
    }
    
    .rtl .navbar-nav a {
        text-align: right;
        border-left: none;
        border-right: 3px solid transparent;
    }
    
    .rtl .navbar-nav a:hover {
        border-right-color: #d1d5db;
    }
    
    .rtl .navbar-nav a.active {
        border-right-color: var(--primary);
    }
}

/* Dashboard preview */
.rtl .dashboard-preview {
    transform: perspective(1000px) rotateY(5deg) rotateX(5deg);
}

.rtl .dashboard-preview:hover {
    transform: perspective(1000px) rotateY(0) rotateX(0);
}

/* Tables */
.rtl table {
    direction: rtl;
}

.rtl th,
.rtl td {
    text-align: right;
}

/* Dropdowns */
.rtl .dropdown-menu {
    left: auto;
    right: 0;
}

/* Modals */
.rtl .modal-header {
    flex-direction: row-reverse;
}

/* Breadcrumbs */
.rtl .breadcrumb {
    flex-direction: row-reverse;
}

/* Pagination */
.rtl .pagination {
    flex-direction: row-reverse;
}

/* Cards */
.rtl .card-header {
    flex-direction: row-reverse;
}

/* Stats */
.rtl .stat-card {
    text-align: right;
}

/* Dashboard - Horizontal Top Nav RTL */
.rtl .sidebar {
    direction: rtl;
}

.rtl .sidebar-header {
    /* flex-direction: row-reverse;*/
}

.rtl .nav-menu {
    flex-direction: row-reverse;
}

.rtl .nav-link {
    flex-direction: row-reverse;
}

.rtl .nav-badge {
    margin-left: 0;
    margin-right: 6px;
}

.rtl .sidebar-user {
    flex-direction: row-reverse;
}

.rtl .main-content {
    margin-right: 0;
    margin-left: 0;
}

/* Form icons */
.rtl .input-icon i:first-child {
    left: auto;
    right: 16px;
}

.rtl .input-icon input,
.rtl .input-icon select {
    padding-left: 16px;
    padding-right: 44px;
}

.rtl .toggle-password {
    right: auto;
    left: 16px;
}

/* Search */
.rtl .search-box i {
    left: auto;
    right: 16px;
}

.rtl .search-box input {
    padding-left: 16px;
    padding-right: 44px;
}

/* Notifications */
.rtl .notification-item {
    flex-direction: row-reverse;
}

/* User menu */
.rtl .user-menu {
    flex-direction: row-reverse;
}

/* Dashboard Top Header RTL Fix */
.rtl .top-header {
    /*flex-direction: row-reverse;*/
}

.rtl .header-left {
    flex-direction: row-reverse;
}

.rtl .header-right {
    flex-direction: row-reverse;
    margin-left: 0;
    margin-right: auto;
}

.rtl .header-actions {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    gap: 8px;
}

.rtl .header-actions .header-btn,
.rtl .header-actions .dropdown {
    display: flex !important;
    visibility: visible !important;
    flex-shrink: 0;
}

/* RTL Dropdown positioning */
.rtl .dropdown {
    position: relative;
}

.rtl .dropdown-menu {
    left: 0;
    right: auto;
    min-width: 180px;
    z-index: 1050;
}

.rtl .header-actions .dropdown .dropdown-menu {
    left: auto;
    right: 0;
}

/* Ensure header buttons don't overflow */
.rtl .top-header .header-right {
    flex-shrink: 0;
    min-width: fit-content;
    overflow: visible;
}

/* RTL search box */
.rtl .search-box {
    margin-left: 0;
    margin-right: auto;
}

.rtl .search-box input {
    padding: 10px 40px 10px 16px;
}

.rtl .search-box i {
    left: auto;
    right: 14px;
}

/* RTL Sidebar nav */
.rtl .nav-link {
    flex-direction: row-reverse;
    text-align: right;
}

.rtl .nav-badge {
    margin-left: 0;
    margin-right: auto;
}

.rtl .sidebar-user {
    flex-direction: row-reverse;
}

.rtl .sidebar-user .dropdown-toggle {
    flex-direction: row-reverse;
    width: 100%;
}

.rtl .sidebar-user .fa-chevron-down {
    margin-left: 0;
    margin-right: auto;
}

/* RTL Dropdown items */
.rtl .dropdown-item {
    flex-direction: row-reverse;
    text-align: right;
}

.rtl .sidebar-footer .dropdown-menu {
    left: auto;
    right: 0;
    bottom: 100%;
    top: auto;
}

/* Action buttons */
.rtl .action-buttons {
    flex-direction: row-reverse;
}

/* Tags */
.rtl .tag {
    flex-direction: row-reverse;
}

/* Timeline */
.rtl .timeline {
    padding-right: 30px;
    padding-left: 0;
}

.rtl .timeline::before {
    left: auto;
    right: 0;
}

.rtl .timeline-item::before {
    left: auto;
    right: -35px;
}

/* Charts */
.rtl .chart-legend {
    flex-direction: row-reverse;
}

/* Data tables */
.rtl .datatable-actions {
    flex-direction: row-reverse;
}

/* File upload */
.rtl .file-upload-label {
    flex-direction: row-reverse;
}

/* Progress bars */
.rtl .progress-bar {
    direction: ltr;
}

/* Tooltips */
.rtl .tooltip {
    text-align: right;
}

/* Badges */
.rtl .badge-with-icon {
    flex-direction: row-reverse;
}

/* Mobile menu */
@media (max-width: 991px) {
    .rtl .navbar-nav {
        flex-direction: column; 
        align-items: stretch; 
    }
    
    .rtl .navbar-nav a {
        text-align: right;
        padding: 10px 14px;
    }
    
    .rtl .navbar-actions {
        flex-direction: column; 
        align-items: stretch;
    }
    
    .rtl .navbar-actions .lang-btn {
        width: auto;
        align-self: center;
    }
}
