/* RTL Support Styles */

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

html[dir="rtl"] body {
    direction: rtl;
    overflow-x: hidden;
}

/* Sidebar RTL - Already positioned correctly in main file */

/* Flexbox RTL */
html[dir="rtl"] .flex {
    direction: rtl;
}

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

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

/* Padding and Margin RTL */
html[dir="rtl"] .pl-4 {
    padding-left: 0;
    padding-right: 1rem;
}

html[dir="rtl"] .pr-4 {
    padding-right: 0;
    padding-left: 1rem;
}

html[dir="rtl"] .ml-4 {
    margin-left: 0;
    margin-right: 1rem;
}

html[dir="rtl"] .mr-4 {
    margin-right: 0;
    margin-left: 1rem;
}

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

/* Navbar RTL */
html[dir="rtl"] .navbar {
    direction: rtl;
}

/* Cart badge RTL */
html[dir="rtl"] .cart-badge {
    right: auto;
    left: -5px;
}

/* Marquee RTL */
html[dir="rtl"] .marquee-inner {
    animation: marquee-rtl 22s linear infinite;
}

@keyframes marquee-rtl {
    0% { transform: translateX(0); }
    100% { transform: translateX(50%); }
}

/* Input RTL */
html[dir="rtl"] input[type="text"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="password"],
html[dir="rtl"] textarea {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] input::placeholder {
    text-align: right;
}

/* Buttons RTL */
html[dir="rtl"] button {
    direction: rtl;
}

/* Modals and Dialogs RTL */
html[dir="rtl"] .modal,
html[dir="rtl"] .dialog {
    direction: rtl;
    text-align: right;
}

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

/* Tooltips RTL */
html[dir="rtl"] .tooltip {
    direction: rtl;
}

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

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

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

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

/* Breadcrumbs RTL */
html[dir="rtl"] .breadcrumb {
    direction: rtl;
}

html[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    content: " / ";
    margin: 0 0.5rem;
}

/* Pagination RTL */
html[dir="rtl"] .pagination {
    direction: rtl;
}

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

/* Badges RTL */
html[dir="rtl"] .badge {
    direction: rtl;
}

/* Progress bars RTL */
html[dir="rtl"] .progress {
    direction: rtl;
}

/* Tabs RTL */
html[dir="rtl"] .nav-tabs {
    direction: rtl;
}

/* Sidebar navigation RTL */
html[dir="rtl"] .admin-nav-link {
    direction: rtl;
    text-align: right;
}

/* Icons positioning RTL */
html[dir="rtl"] svg {
    direction: rtl;
}

/* Transitions and transforms RTL */
html[dir="rtl"] .transition-transform {
    direction: rtl;
}

/* Specific admin dashboard fixes */
html[dir="rtl"] .admin-kpi-icon {
    direction: rtl;
}

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

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

/* Search input RTL */
html[dir="rtl"] .search-input {
    direction: rtl;
    text-align: right;
    padding-right: 2.5rem;
    padding-left: 1rem;
}

html[dir="rtl"] .search-icon {
    right: 0.75rem;
    left: auto;
}

/* Mobile nav RTL */
html[dir="rtl"] .mobile-nav-btn {
    direction: rtl;
}

/* Sidebar scroll RTL */
html[dir="rtl"] .sidebar-scroll {
    direction: rtl;
}

/* Ensure proper text direction for all elements */
html[dir="rtl"] * {
    direction: rtl;
}

html[dir="rtl"] svg,
html[dir="rtl"] img {
    direction: ltr;
}
