/* RTL Content Overrides for Eldahan Admin Panel */
/* SCOPED TO .main-panel ONLY - Keeps Shell (Sidebar/Nav) LTR */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700&display=swap');

/* Apply Cairo font ONLY to the main content area in RTL mode */
/* Also apply to generic body for consistency if needed, but primary focus is content */
/* We keep it on body for modals/alerts that might pop up, but Shell is LTR so it won't affect layout there much */
body .main-panel[dir="rtl"],
body .main-panel[dir="rtl"] .h1,
body .main-panel[dir="rtl"] .h2,
body .main-panel[dir="rtl"] .h3,
body .main-panel[dir="rtl"] .h4,
body .main-panel[dir="rtl"] .h5,
body .main-panel[dir="rtl"] .h6,
body .main-panel[dir="rtl"] h1,
body .main-panel[dir="rtl"] h2,
body .main-panel[dir="rtl"] h3,
body .main-panel[dir="rtl"] h4,
body .main-panel[dir="rtl"] h5,
body .main-panel[dir="rtl"] h6,
body .main-panel[dir="rtl"] .btn {
    font-family: 'Cairo', sans-serif !important;
}

/* 
   SIDEBAR & NAVBAR RULES REMOVED 
   They will now inherit standard LTR styles from style.css 
*/

/* Main Panel Content - RTL Handling */
.main-panel[dir="rtl"] {
    text-align: right;
}

/* Dropdowns within Content */
.main-panel[dir="rtl"] .dropdown-menu {
    text-align: right;
    right: 0 !important;
    left: auto !important;
}

.main-panel[dir="rtl"] .dropdown-item i {
    margin-left: 10px;
    margin-right: 0 !important;
}

/* Cards */
.main-panel[dir="rtl"] .card-title {
    text-align: right;
}

/* Tables */
.main-panel[dir="rtl"] .table th,
.main-panel[dir="rtl"] .table td {
    text-align: right;
}

/* Forms */
.main-panel[dir="rtl"] .form-group label {
    float: right;
}

.main-panel[dir="rtl"] .form-control {
    text-align: right;
}

.main-panel[dir="rtl"] .form-check {
    padding-right: 1.5rem;
    padding-left: 0;
}

.main-panel[dir="rtl"] .form-check .form-check-input {
    float: right;
    margin-right: -1.5rem;
    margin-left: 0;
}

/* Modals (might be outside main-panel, so keep generic or scope if possible) */
/* Assuming Modals append to body, we might need a specific class or JS to set dir on modal */
/* For now, let's keep basic text alignment for modals if they inherit RTL from somewhere, 
   but since body is LTR, modals might default LTR. We might need to wrap modal content in a dir="rtl" div in PHP */

/* Footer */
.main-panel[dir="rtl"] .footer {
    text-align: right !important;
}

.main-panel[dir="rtl"] .footer .d-sm-flex {
    justify-content: space-between;
    flex-direction: row-reverse;
}

.main-panel[dir="rtl"] .footer span {
    float: none !important;
}

/* Specific Utilities Scoped to Content */
.main-panel[dir="rtl"] .text-right {
    text-align: left !important;
}

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

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

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

/* Margin/Padding Utilities (Basic) */
.main-panel[dir="rtl"] .me-2 {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

.main-panel[dir="rtl"] .ms-2 {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

.main-panel[dir="rtl"] .me-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
}

.main-panel[dir="rtl"] .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

/* Dashboard Specifics */
.main-panel[dir="rtl"] .statistics-details .statistics-title {
    text-align: right;
}

/* 3D Login Page Specifics - Keep generic body rule for Login as it has no main-panel */
body[dir="rtl"] .login-container {
    direction: rtl;
    font-family: 'Cairo', sans-serif !important;
}