/* styles.css – responsive Layout für Lageranmeldung - Version 1.1.3 */
/* Überarbeitet am 2025-08-02 07:56 für bessere Responsive-Performance */

body {
    font-family: system-ui, sans-serif;
    margin: 0;
    padding: 20px;
    line-height: 1.5;
    min-width: 320px; /* Minimale Breite für sehr kleine Bildschirme */
}

/* Container-Breite für volle Bildschirmnutzung */
.container {
    max-width: 100% !important; /* Volle Breite nutzen */
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

/* Responsive Container für verschiedene Bildschirmgrößen */
@media (min-width: 576px) {
    .container {
        max-width: 100%;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 100%;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 100%;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 100%;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 100%;
    }
}

h1, h2 {
    text-align: center;
}

/* Formular-Layout verbessert */
form {
    width: 100%;
    margin: 0 auto;
}

/* Flexbox-Layout für Formular-Zeilen */
.form-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 0.6rem;
    flex-wrap: wrap; /* Erlaubt Umbrechung bei Bedarf */
}

.form-row.column {
    flex-direction: column;
    align-items: flex-start;
}

.form-input-fixed {
    flex: 0 0 180px;
}

/* Label-Styling */
label {
    margin: 0;
    cursor: pointer;
    white-space: nowrap; /* Verhindert Label-Umbrechung */
}

/* Eingabefelder */
input[type=text],
input[type=email],
input[type=date],
textarea,
select {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    min-width: 0; /* Verhindert Überbreite */
}

textarea {
    min-height: 4rem;
    resize: vertical;
}

select.yes-no {
    max-width: 130px;
    text-align-last: center;
}

option {
    text-align: center;
}

/* Submit-Button */
input[type=submit] {
    margin-top: 22px;
    padding: 10px 24px;
    width: 100%;
    font-size: 16px;
}

input[type=submit]:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Hilfsklassen */
.hint {
    text-align: center;
    color: #c00;
    font-weight: bold;
}

.required::after {
    content: ' *';
    color: red;
}

/* Backend-Tab-Navigation verbessert */
.nav-tabs {
    display: flex;
    flex-direction: row !important;
    border-bottom: 1px solid #dee2e6;
    flex-wrap: wrap;
    overflow-x: auto; /* Horizontales Scrollen bei Bedarf */
}

.nav-tabs .nav-item {
    margin-bottom: -1px;
    flex-shrink: 0; /* Verhindert Schrumpfen */
}

.nav-tabs .nav-link {
    border: 1px solid transparent;
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
    white-space: nowrap; /* Verhindert Tab-Text-Umbrechung */
    padding: 0.5rem 1rem;
}

.nav-tabs .nav-link:hover, 
.nav-tabs .nav-link:focus {
    border-color: #e9ecef #e9ecef #dee2e6;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    color: #495057;
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
}

/* Filter-Formular-Layout verbessert */
.search-form {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.search-form .form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.search-form .form-control {
    flex: 1 1 auto;
    min-width: 120px;
    max-width: 200px;
}

.search-form label {
    margin-right: 5px;
    font-weight: 500;
}

.search-form .btn {
    flex-shrink: 0;
}

/* Tabellen-Responsive-Verbesserungen */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Scrollleiste IMMER sichtbar */
    overflow-y: scroll !important;
    max-height: 70vh !important; /* Maximale Höhe für bessere Übersicht */
    /* Firefox-spezifische Scrollleiste */
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
    /* Padding für bessere Sichtbarkeit */
    padding: 2px;
    /* Border für bessere Sichtbarkeit */
    border: 1px solid #dee2e6;
    border-radius: 4px;
    /* Zusätzliche Eigenschaften für Firefox */
    display: block;
    position: relative;
}

.table {
    min-width: 600px; /* Minimale Tabellenbreite */
    margin-bottom: 0; /* Entfernt Bootstrap-Margin */
}

.table th,
.table td {
    white-space: nowrap;
    vertical-align: middle;
}

/* Moderne Scrollleiste für Webkit-Browser (Chrome, Safari, Edge) */
.table-responsive::-webkit-scrollbar {
    height: 12px;
    width: 12px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Firefox-spezifische Scrollleiste */
.table-responsive {
    /* Firefox Scrollleiste immer sichtbar */
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* Zusätzliche Regel für maximale Kompatibilität */
div.table-responsive {
    overflow-y: scroll !important;
    max-height: 70vh !important;
    /* Firefox-spezifische Eigenschaften */
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* Firefox-spezifische Optimierungen */
@-moz-document url-prefix() {
    .table-responsive {
        /* Firefox-spezifische Scrollleiste */
        scrollbar-width: thin;
        scrollbar-color: #888 #f1f1f1;
        /* Zusätzliche Firefox-Optimierungen */
        overflow-y: scroll !important;
        max-height: 70vh !important;
        /* Zusätzliche Eigenschaften für Firefox */
        display: block;
        position: relative;
    }
}

/* Spezifische Regel für die Anmeldungen-Tabelle */
#anmeldungen .table-responsive {
    overflow-y: scroll !important;
    max-height: 70vh !important;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
    display: block;
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 2px;
}

/* Doppelte horizontale Scrollleiste (oben) nur im Admin/Anmeldungen-Tab) */
#anmeldungen .table-scroll-wrapper { width: 100%; position: relative; }

#anmeldungen .table-scrollbar-top {
    overflow-x: auto;
    overflow-y: hidden;
    height: 6px; /* schmal wie unten/rechts */
    margin: 0 0 6px 0;
    border: none;
    border-radius: 0;
    background: #f8f9fa;
}

#anmeldungen .table-scrollbar-top-inner { height: 1px; }

/* WebKit-Scrollbar-Styling für die obere Leiste */
#anmeldungen .table-scrollbar-top::-webkit-scrollbar { height: 6px; }
#anmeldungen .table-scrollbar-top::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 6px; }
#anmeldungen .table-scrollbar-top::-webkit-scrollbar-thumb { background: #999; border-radius: 6px; }
#anmeldungen .table-scrollbar-top::-webkit-scrollbar-thumb:hover { background: #666; }

/* Firefox-Styling */
@-moz-document url-prefix() {
  #anmeldungen .table-scrollbar-top { scrollbar-width: thin; scrollbar-color: #6c757d #e9ecef; }
}

/* Mobile-Optimierungen verbessert */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    /* Formular-Zeilen auf Mobile */
    .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .form-input-fixed {
        flex: none;
        width: 100%;
    }
    
    /* Eingabeelemente auf volle Breite */
    .form-row > input,
    .form-row > select,
    .form-row > textarea {
        width: 100%;
    }
    
    /* Yes/No Selects auf Mobile */
    select.yes-no {
        max-width: none;
        width: 100%;
    }
    
    /* Tab-Navigation auf Mobile */
    .nav-tabs {
        flex-direction: column !important;
        border-bottom: none;
    }
    
    .nav-tabs .nav-item {
        margin-bottom: 0;
        border-bottom: 1px solid #dee2e6;
    }
    
    .nav-tabs .nav-link {
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
    }
    
    /* Filter-Formular auf Mobile */
    .search-form .form-inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form .form-control {
        max-width: none;
        width: 100%;
    }
    
    .search-form label {
        margin-bottom: 5px;
        margin-right: 0;
    }
    
    /* Tabellen auf Mobile */
    .table {
        min-width: 100%;
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 8px 4px;
    }
}

/* Sehr kleine Bildschirme */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .container {
        padding: 0 5px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 4px 2px;
    }
}

/* Druck-Optimierungen */
@media print {
    body {
        margin: 0;
        padding: 0;
    }
    
    .nav-tabs,
    .search-form,
    .btn {
        display: none !important;
    }
    
    .table {
        min-width: auto;
    }
}
