/*!
 * SB Admin 2 RTL Core Styles - Complementary to sb-admin-2-rtl.css
 * This file contains additional core styles needed for complete RTL support
 */

/* Import the main RTL file */
@import url('sb-admin-2-rtl.css');

/* Additional RTL Core Styles */

/* RTL Grid System Overrides */
[dir="rtl"] .row {
  flex-direction: row-reverse;
}

[dir="rtl"] .col,
[dir="rtl"] .col-1,
[dir="rtl"] .col-2,
[dir="rtl"] .col-3,
[dir="rtl"] .col-4,
[dir="rtl"] .col-5,
[dir="rtl"] .col-6,
[dir="rtl"] .col-7,
[dir="rtl"] .col-8,
[dir="rtl"] .col-9,
[dir="rtl"] .col-10,
[dir="rtl"] .col-11,
[dir="rtl"] .col-12 {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
}

/* RTL Offset Classes */
[dir="rtl"] .offset-1 { margin-right: 8.333333%; margin-left: 0; }
[dir="rtl"] .offset-2 { margin-right: 16.666667%; margin-left: 0; }
[dir="rtl"] .offset-3 { margin-right: 25%; margin-left: 0; }
[dir="rtl"] .offset-4 { margin-right: 33.333333%; margin-left: 0; }
[dir="rtl"] .offset-5 { margin-right: 41.666667%; margin-left: 0; }
[dir="rtl"] .offset-6 { margin-right: 50%; margin-left: 0; }
[dir="rtl"] .offset-7 { margin-right: 58.333333%; margin-left: 0; }
[dir="rtl"] .offset-8 { margin-right: 66.666667%; margin-left: 0; }
[dir="rtl"] .offset-9 { margin-right: 75%; margin-left: 0; }
[dir="rtl"] .offset-10 { margin-right: 83.333333%; margin-left: 0; }
[dir="rtl"] .offset-11 { margin-right: 91.666667%; margin-left: 0; }

/* RTL Order Classes */
[dir="rtl"] .order-first { order: 12; }
[dir="rtl"] .order-last { order: -1; }

/* RTL Responsive Utilities */
@media (min-width: 576px) {
  [dir="rtl"] .text-sm-left { text-align: right !important; }
  [dir="rtl"] .text-sm-right { text-align: left !important; }
  [dir="rtl"] .float-sm-left { float: right !important; }
  [dir="rtl"] .float-sm-right { float: left !important; }
}

@media (min-width: 768px) {
  [dir="rtl"] .text-md-left { text-align: right !important; }
  [dir="rtl"] .text-md-right { text-align: left !important; }
  [dir="rtl"] .float-md-left { float: right !important; }
  [dir="rtl"] .float-md-right { float: left !important; }
}

@media (min-width: 992px) {
  [dir="rtl"] .text-lg-left { text-align: right !important; }
  [dir="rtl"] .text-lg-right { text-align: left !important; }
  [dir="rtl"] .float-lg-left { float: right !important; }
  [dir="rtl"] .float-lg-right { float: left !important; }
}

@media (min-width: 1200px) {
  [dir="rtl"] .text-xl-left { text-align: right !important; }
  [dir="rtl"] .text-xl-right { text-align: left !important; }
  [dir="rtl"] .float-xl-left { float: right !important; }
  [dir="rtl"] .float-xl-right { float: left !important; }
}

/* RTL Specific Component Fixes */

/* RTL Sidebar Brand */
[dir="rtl"] .sidebar .sidebar-brand {
  text-align: right;
}

[dir="rtl"] .sidebar .sidebar-brand .sidebar-brand-icon {
  margin-left: 0.75rem;
  margin-right: 0;
}

/* RTL Sidebar Navigation */
[dir="rtl"] .sidebar .nav-item .nav-link {
  text-align: right;
}

[dir="rtl"] .sidebar .nav-item .nav-link i {
  margin-left: 0.25rem;
  margin-right: 0;
}

/* RTL Sidebar Collapse */
[dir="rtl"] .sidebar .nav-item .collapse .collapse-inner {
  text-align: right;
}

[dir="rtl"] .sidebar .nav-item .collapse .collapse-inner .collapse-header {
  text-align: right;
}

[dir="rtl"] .sidebar .nav-item .collapse .collapse-inner .collapse-item {
  text-align: right;
}

/* RTL Topbar Navigation */
[dir="rtl"] .topbar .nav-item .nav-link {
  text-align: right;
}

[dir="rtl"] .topbar .dropdown-list .dropdown-item {
  text-align: right;
}

/* RTL Card Headers */
[dir="rtl"] .card .card-header {
  text-align: right;
}

[dir="rtl"] .card .card-header .dropdown {
  float: left;
}

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

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

/* RTL Buttons */
[dir="rtl"] .btn-icon-split .icon {
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  border-right: 0;
}

[dir="rtl"] .btn-icon-split .text {
  border-right: 1px solid rgba(255, 255, 255, 0.3);
  border-left: 0;
}

/* RTL Tables */
[dir="rtl"] .table-responsive {
  direction: rtl;
}

[dir="rtl"] .table-responsive .table {
  direction: rtl;
}

/* RTL Modals */
[dir="rtl"] .modal-header {
  text-align: right;
}

[dir="rtl"] .modal-footer {
  text-align: left;
}

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

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

/* RTL Badges */
[dir="rtl"] .badge {
  text-align: center;
}

/* RTL Tooltips and Popovers */
[dir="rtl"] .tooltip-inner {
  text-align: right;
}

[dir="rtl"] .popover-header {
  text-align: right;
}

[dir="rtl"] .popover-body {
  text-align: right;
}

/* RTL Specific Fixes for SB Admin 2 Components */

/* RTL Sidebar Toggle */
[dir="rtl"] #sidebarToggle {
  transform: rotate(180deg);
}

[dir="rtl"] .sidebar.toggled #sidebarToggle {
  transform: rotate(0deg);
}

/* RTL Scroll to Top */
[dir="rtl"] .scroll-to-top {
  right: 1rem;
  left: auto;
}

/* RTL Error Page */
[dir="rtl"] .error {
  text-align: center;
}

/* RTL Login/Register Forms */
[dir="rtl"] form.user .form-control-user {
  text-align: right;
}

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

/* RTL Footer */
[dir="rtl"] footer.sticky-footer .copyright {
  text-align: center;
}

/* RTL Charts */
[dir="rtl"] .chart-area,
[dir="rtl"] .chart-bar,
[dir="rtl"] .chart-pie {
  direction: ltr; /* Charts should remain LTR for proper rendering */
}

/* RTL Background Images */
[dir="rtl"] .bg-login-image,
[dir="rtl"] .bg-register-image,
[dir="rtl"] .bg-password-image {
  background-position: center;
}

/* RTL Animation Fixes */
[dir="rtl"] .animated--grow-in {
  animation-direction: normal;
}

[dir="rtl"] .animated--fade-in {
  animation-direction: normal;
}

/* RTL Print Specific */
@media print {
  [dir="rtl"] .sidebar,
  [dir="rtl"] .topbar,
  [dir="rtl"] .scroll-to-top {
    display: none !important;
  }
  
  [dir="rtl"] #wrapper #content-wrapper {
    margin: 0 !important;
    padding: 0 !important;
  }
  
  [dir="rtl"] .container-fluid {
    width: 100% !important;
    max-width: none !important;
  }
}

/* RTL High Contrast Mode Support */
@media (prefers-contrast: high) {
  [dir="rtl"] .sidebar {
    border-left: 2px solid #000;
    border-right: 0;
  }
  
  [dir="rtl"] .topbar {
    border-bottom: 2px solid #000;
  }
}

/* RTL Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  [dir="rtl"] *,
  [dir="rtl"] *::before,
  [dir="rtl"] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
} 