/* =========================
   GLOBAL RTL STYLES
========================= */

/* Force RTL text direction for the app */
:root {
    direction: rtl;
}

html,
body {
    direction: rtl !important;
    font-size: 1rem
}

/* Sidebar positioning for layout-fixed and off-canvas behavior */
.layout-fixed .main-sidebar {
    right: 0;
}

/* Brand image right aligned in RTL */
.brand-image {
    float: right;
}

/* Default main content margins (desktop) */
.content-wrapper,
.main-footer,
.main-header {
    margin-left: 0;
    margin-right: 250px;
}

/* Compact collapsed sidebar margin */
@media (min-width: 992px) {

    .sidebar-mini.sidebar-collapse .content-wrapper,
    .sidebar-mini.sidebar-collapse .main-footer,
    .sidebar-mini.sidebar-collapse .main-header {
        margin-right: 4.6rem !important;
        margin-left: 0 !important;
    }
}

/* OFF-CANVAS behavior for mobile */
@media (max-width: 767.98px) {

    .main-sidebar,
    .main-sidebar::before {
        margin-right: -250px !important;
        transition: margin .3s ease;
    }

    .sidebar-open .main-sidebar,
    .sidebar-open .main-sidebar::before {
        margin-right: 0 !important;
    }

    .content-wrapper,
    .content-wrapper::before,
    .main-footer,
    .main-footer::before,
    .main-header,
    .main-header::before {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
}

/* Fix nav icon alignment for RTL */
.nav-sidebar .nav-link>.right {
    left: 1rem;
    right: auto;
}

/* small-box icon positioning */
.small-box .icon>i {
    left: 15px;
    right: auto;
}

/* badge styling */
.badge-container {
    position: relative;
    display: inline-block;
}

.badge-container .badge {
    position: absolute;
    top: -6px;
    left: -10px;
    padding: 3px 6px;
    background-color: red;
    color: #fff;
    font-size: 11px;
    border-radius: 50%;
}

/* logout button */
.logout-button {
    padding: 8px 12px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.logout-button:hover {
    background-color: #d32f2f;
}

/* small responsive tweaks */
@media (max-width: 400px) {
    .brand-text {
        font-size: 14px;
    }
}

/* =========================
   REG-PRODUCT PAGE — RTL & RESPONSIVE
========================= */

.reg-product-page {
    direction: rtl;
}

.reg-product-page .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.reg-product-page table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    direction: rtl;
}

.reg-product-page th,
.reg-product-page td {
    text-align: center;
    vertical-align: middle;
}

.reg-product-page td[contenteditable="true"] {
    background: #f8f8f8;
    border: 1px solid #ddd;
    min-width: 90px;
    padding: 6px;
}

.reg-product-page table select {
    width: 100% !important;
    min-width: 120px;
}

.reg-product-page .btn-xs {
    padding: 4px 8px !important;
    font-size: 12px !important;
}

/* Hide backend ID columns */
.reg-product-page td:nth-child(10),
.reg-product-page td:nth-child(11) {
    display: none !important;
}

/* =========================
   MOBILE RESPONSIVE FIXES
========================= */
@media (max-width: 768px) {

    .reg-product-page table {
        font-size: 13px;
    }

    .reg-product-page td[contenteditable="true"] {
        min-width: 110px;
    }

    .reg-product-page select {
        font-size: 13px !important;
    }

    .reg-product-page .btn-xs {
        font-size: 11px !important;
        padding: 3px 6px !important;
    }

    .reg-product-page .table-responsive {
        overflow-x: auto;
    }
}

/* Data Table Css */
.dataTables_wrapper .dataTables_scroll {
    direction: rtl;
}
.dataTables_wrapper .dataTables_scrollHead table,
.dataTables_wrapper .dataTables_scrollBody table {
    direction: rtl;
}

.aparat-player-wrapper {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
    aspect-ratio: 16 / 9;
}

.aparat-player-wrapper iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

.video-frame {
    width: 100%;
    height: 100%;
    border: 0;
}

