﻿/* =====================================================
   RTL Support - aktiviert via body.rtl Klasse
   ===================================================== */

/* ===== HEADER ===== */

/* Logo: rechts */
body.rtl #header-logo {
    float: right;
}

/* Profilmenue: ganz links, am Ende der Kopfzeile (Nutzerwunsch 30.09.2026) */
body.rtl #header-nav-left {
    float: left;
    margin: 0 15px;
}
body.rtl #header-nav-left .dropdown-menu {
    left: 0;
    right: auto;
}

/* Nav-Right (ausgeblendete Knoepfe): rechts neben dem Menue-Umschalter */
body.rtl #header-nav-right {
    float: right;
    margin: 15px 20px 0 0;
}

/* Close-Sidebar-Button: links statt rechts */
body.rtl #page-header #close-sidebar {
    right: auto;
    left: 10px;
}

/* ===== SIDEBAR: rechts ===== */

body.rtl #page-sidebar {
    float: right !important;
    left: auto !important;
    right: 0 !important;
    margin-left: -100% !important;
    margin-right: 0 !important;
}

/* Content: Platz fuer Sidebar rechts */
body.rtl #page-content {
    margin-left: 0 !important;
    margin-right: 260px !important;
    direction: rtl;
    text-align: right;
}

/* Closed-Sidebar RTL */
body.rtl.closed-sidebar #page-sidebar {
    transform: translateX(260px) !important;
    -webkit-transform: translateX(260px) !important;
}

body.rtl.closed-sidebar #page-content {
    margin-right: 0 !important;
}

/* ===== SEITENINHALT ===== */

body.rtl #page-title {
    direction: rtl;
    text-align: right;
}

body.rtl .breadcrumb {
    direction: rtl;
    text-align: right;
}

body.rtl .panel,
body.rtl .panel-heading,
body.rtl .panel-body,
body.rtl .content-box,
body.rtl .content-box-header {
    direction: rtl;
    text-align: right;
}

body.rtl .dashboard-box,
body.rtl .info-box,
body.rtl .tile-box {
    direction: rtl;
    text-align: right;
}

body.rtl table {
    direction: rtl;
}

body.rtl th,
body.rtl td {
    text-align: right;
}

body.rtl .form-group,
body.rtl .control-label,
body.rtl #page-content label {
    text-align: right !important;
}

body.rtl .form-horizontal .control-label {
    text-align: right !important;
}

body.rtl .form-control,
body.rtl input[type="text"],
body.rtl input[type="number"],
body.rtl input[type="email"],
body.rtl input[type="date"],
body.rtl textarea,
body.rtl select {
    text-align: right;
    direction: rtl;
}

/* Bootstrap Grid RTL - Spalten von rechts nach links */
body.rtl .form-horizontal .row > [class*="col-"],
body.rtl .form-horizontal .form-group > [class*="col-"] {
    float: right;
}

/* Label und Input-Container richtig anordnen */
body.rtl .form-horizontal .control-label {
    float: right;
    text-align: right !important;
}

body.rtl .form-horizontal .form-group::after {
    clear: both;
    display: table;
    content: " ";
}

body.rtl .tab-content {
    direction: rtl;
    text-align: right;
}

body.rtl .list-group-item {
    text-align: right;
}

body.rtl .input-group {
    direction: rtl;
}

body.rtl .input-group .input-group-addon:first-child {
    border-radius: 0 4px 4px 0;
    border-left: 0;
    border-right: 1px solid #ccc;
}

body.rtl .input-group .input-group-addon:last-child {
    border-radius: 4px 0 0 4px;
    border-right: 0;
    border-left: 1px solid #ccc;
}

body.rtl .input-group .form-control:first-child {
    border-radius: 0 4px 4px 0;
}

body.rtl .input-group .form-control:last-child {
    border-radius: 4px 0 0 4px;
}

body.rtl .alert {
    direction: rtl;
    text-align: right;
}

/* ===== DATATABLE ===== */
body.rtl .dataTables_wrapper {
    direction: rtl;
}

body.rtl .dataTables_filter {
    text-align: left;
}

body.rtl .dataTables_info,
body.rtl .dataTables_length {
    text-align: right;
}

/* ===== SIDEBAR MENU TEXT ===== */
body.rtl #sidebar-menu li a {
    text-align: right;
    padding-right: 20px;
    padding-left: 10px;
}

body.rtl #page-sidebar li a .glyph-icon {
    float: right;
    margin-right: 0;
    margin-left: 8px;
}

/* ===== CHOSEN/SELECT ===== */
body.rtl .chosen-container {
    direction: rtl;
    text-align: right;
}

/* ===== RESPONSIVE: Mobile ===== */
@media only screen and (max-width: 56.24em) {
    body.rtl #page-content {
        margin-right: 0 !important;
    }
}

/* === Seiteninhalt Richtung === */
body.rtl #page-content {
    direction: rtl;
    text-align: right;
}

/* === Titel === */
body.rtl #page-title {
    direction: rtl;
    text-align: right;
}

/* Login: addon-inside Icon rechts bei RTL */
body.rtl .input-group-addon.addon-inside {
    left: auto !important;
    right: 6px !important;
}
body.rtl .input-group-lg .input-group-addon.addon-inside {
    left: auto !important;
    right: 10px !important;
}
body.rtl .input-group-addon.addon-inside + input,
body.rtl .input-group-addon.addon-inside + .form-control {
    padding-left: 12px !important;
    padding-right: 48px !important;
}

/* Dashboard Kacheln RTL: von rechts nach links */
body.rtl .example-box-wrapper [class*="col-md-"] {
    float: right;
}


/* ===== TIMETABLE ===== */
/* Knoepfe wie "Hinzufuegen" bleiben auch in RTL rechts (Nutzerwunsch 30.09.2026);
   die fruehere Spiegelung von .float-right nach links ist entfernt. */

body.rtl .col-md-2[style*='border-right'] {
    border-right: none !important;
    border-left: 1px solid #cacaca !important;
    text-align: center;
}

body.rtl [class*='row-monday'],
body.rtl [class*='row-tuesday'],
body.rtl [class*='row-wednesday'],
body.rtl [class*='row-thursday'],
body.rtl [class*='row-friday'],
body.rtl [class*='row-saturday'],
body.rtl [class*='row-sunday'] {
    direction: rtl;
}

body.rtl .tile-box {
    text-align: right;
}
/* ===== CREATE/EDIT FORM ===== */
body.rtl .form-horizontal .col-sm-4,
body.rtl .form-horizontal .col-md-4.control-label {
    float: right;
    text-align: right;
}

body.rtl .form-horizontal .form-group {
    direction: rtl;
}

body.rtl .form-horizontal .col-sm-4 {
    float: right;
    padding-right: 15px;
    padding-left: 0;
}

/* ===== ATTENDANCE TABLE ===== */
/* Horizontal scroll container for wide attendance tables */
#datatable-responsive_wrapper .table-responsive,
#datatable-responsive_wrapper > div[style*="overflow-x"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Fixed first column (student names) while scrolling */
#datatable-responsive thead th:first-child,
#datatable-responsive tbody td:first-child {
/*    position: sticky;
    left: 0;
    z-index: 10;
    background-color: #fff;
    text-align: right;
    padding-right: 10px;*/
    width: 200px;
    /*min-width: 170px;*/
}

/* RTL: First column sticky on the right side */
body.rtl #datatable-responsive thead th:first-child,
body.rtl #datatable-responsive tbody td:first-child {
    left: auto;
    right: 0;
}

/* Day columns - compact width */
#datatable-responsive thead th:not(:first-child),
#datatable-responsive tbody td:not(:first-child) {
    /*min-width: 40px;*/
    /*max-width: 100px;*/
    text-align: center;
    padding: 8px 4px;
}
