/**
 * sidebar.css
 * Styling für die Sidebar der GearBase-Anwendung.
 * @version 0.9.0
 * @date 2025-04-06
 * @author GearBase
 * @description Definiert das Aussehen von Filtern, Buttons und Login/Logout in der Sidebar.
 * @notes Admin-Buttons gestylt (0.6.27), kleiner und nebeneinander (0.6.28), Logout mit rotem Akzent (0.6.29), Logout-Hover mit breiterem Border (0.6.31), Transition entfernt (0.6.32).
 */

.sidebar {
    max-height: 100vh; /* Statt height: 100vh */
    width: auto;
    min-width: 280px;
    max-width: 380px;
    padding: 10px;
    background: rgba(51, 51, 51, 0.7);
    margin: 0 0 0px 10px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    font-size: 0.85em;
    box-sizing: border-box; /* Sicherstellen, dass Padding die Breite nicht überschreitet */
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px); /* Safari support */
}

.admin-buttons {
    padding: 5px;
}

.button-group {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
    margin-bottom: 20px;
}

.admin-btn {
    padding: 8px 15px;
    background: #555;
    color: white;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 1em;
    flex: 1;
    max-width: 200px;
}

.admin-btn:hover {
    background: #777;
}

.logout-form {
    display: flex;
    justify-content: center;
}

.logout-btn {
    padding: 7px 13px;
    background: #555;
    border: 1px solid #b84c4c;
    font-size: 0.9em;
    width: 100%;
    max-width: 200px;
}

.logout-btn:hover {
    background: #777; /* Mit admin-btn konsistent */
    border: 2px solid #ff0000;
}

.login-form {
    padding: 5px;
    overflow: visible;
}

.filter-tab {
    cursor: pointer;
    padding: 5px;
    margin: 5px 0;
    color: white;
}

.admin-section {
    min-height: 150px;
}

.checkbox-list input[type="text"],
.checkbox-list input[type="password"] {
    width: 100%;
    padding: 5px;
    margin: 5px 0;
    background: #555;
    color: white;
    border: none;
    border-radius: 3px;
}

.add-button {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 14px;
    background: #555;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    white-space: nowrap;
}

.add-button:hover {
    background: #777;
}

.add-button:hover::after {
    content: "Ausrüstung vorschlagen";
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 3px;
    border-radius: 3px;
    font-size: 10px;
}

.filter-tab {
    margin-bottom: 10px;
}

.filter-tab h2 {
    cursor: default;
    margin-bottom: 6px;
}

/* Filter-Sektion */
.filter-section {
    display: none; /* Standardmäßig ausgeblendet */
    padding: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
    cursor: default;
}

.filter-section.active {
    display: block; /* Sichtbar, wenn aktiv */
}


.tag-list .filter-icon {
    display: inline-block;
    margin: 2px;
    cursor: pointer;
    width: 20px;
}

.filter-icon {
  width: 20px;
  padding: 2px;
  cursor: pointer;
  border-radius: 10px;
}

.filter-icon img.filter-icon {
  opacity: 0.6;
    -webkit-filter: grayscale(1);filter: grayscale(1);
}

.filter-icon img.filter-icon:hover {
    -webkit-filter: grayscale(0.0);filter: grayscale(0.0) !important;
    -webkit-filter: saturate(2);filter: saturate(2) !important;
    opacity: 1;
    padding: 1px;
    border: 1px solid var(--category-color, #595B5B); /* Umrandung bei Auswahl */
    border-radius: 3px;
}

.filter-icon input[type="checkbox"] {
    display: none; /* Checkbox ausblenden */
}
.filter-icon input:checked + img.filter-icon {
    border: 2px solid var(--category-color, #595B5B); /* Umrandung bei Auswahl */
    border-radius: 3px;
    padding: 0;
      -webkit-filter: saturate(2.5);filter: saturate(2.5);
      opacity: 1;
}

/* Checkbox-Liste */
.checkbox-list {
    max-height: 100px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Highlighted Checkbox-Liste */
.checkbox-list.highlighted {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
    border-radius: 3px;
    border-left: 3px solid var(--category-color, #595B5B);
}

/* Checkbox-Label (als Feld) */
.checkbox-list label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
    color: #ccc;
    white-space: nowrap;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.checkbox-list label:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #000;
}

/* Benutzerdefinierte Checkbox (unsichtbar, nur Häkchen sichtbar) */
.checkbox-list input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: none; /* Kein sichtbarer Rahmen */
    background: transparent; /* Unsichtbar */
    cursor: pointer;
    position: relative;
}

.checkbox-list input[type="checkbox"]:checked::after {
    content: '';
    width: 10px;
    height: 5px;
    border-left: 2px solid #31d344; /* Helles, leuchtendes Grün */
    border-bottom: 2px solid #31d344;
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Range-Slider */
.filter-section input[type="range"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 95%;
    height: 6px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    outline: none;
    transition: background 0.3s ease;
}

.filter-section input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--category-color, #595B5B);
    border: 2px solid #fff;
    border-radius: 35%;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: -10px;
}

.filter-section input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--category-color, #595B5B);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

.filter-section input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.filter-section input[type="range"]::-moz-range-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.filter-section input[type="range"]:hover {
    background: rgba(255, 255, 255, 0.2);
}

.filter-section input[type="range"]:hover::-webkit-slider-thumb {
    background: #fff;
}

.filter-section input[type="range"]:hover::-moz-range-thumb {
    background: #fff;
}

.kategorie-box + #subkategorieContainer {
    margin-top: 0px; /*-17px*/
}

/* Filter-Gruppe */
.filter-group {
    margin-bottom: 0px;
    width: 100%;
    box-sizing: border-box;
    z-index: 50;
}

/* Überschrift (h3) */
.filter-group h3 {
    cursor: pointer;
    margin-bottom: 0px;
    margin-top: 3px ;
    font-size: 0.9em;
    padding: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    color: #fff;
    transition: background-color 0.3s ease;
}

.filter-group h3:hover {
    background: rgba(26, 26, 26, 0.5);
}

/* Dual-Thumb Slider */
.range_container {
    display: flex;
    flex-direction: column;
    width: 95%;
    margin: 0px auto;
}

.sliders_control {
    position: relative;
    min-height: 25px;
    margin-top: 3px;
}

.form_control {
    position: relative;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #ccc;
    margin-top: 5px;
}

.form_control_container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form_control_container__time {
    font-size: 12px;
    color: #ccc;
    margin-bottom: 2px;
}

.form_control_container__time__input {
    width: auto;
    font-size: 12px;
    color: #ccc;
    background: #555;
    border: 1px solid var(--category-color, #595B5B);
    border-radius: 3px;
    padding: 2px;
    text-align: center;
}

.form_control_container__time__input::-webkit-inner-spin-button,
.form_control_container__time__input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form_control_container__time__input[type="number"] {
    -moz-appearance: textfield;
}

.range_container input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 0px;
    width: 94%;
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    outline: none;
    pointer-events: none;
    transition: background 0.3s ease;
}

.range_container input[type="range"][name^="min_"] {
    background: transparent;
    height: 0; /* Track vollständig unsichtbar */
    z-index: 2;
    border: none;
    outline: none;
}
.range_container input[type="range"][name^="min_"]::-webkit-slider-runnable-track {
    background: transparent;
    height: 0;
    border: none;
}
.range_container input[type="range"][name^="min_"]::-moz-range-track {
    background: transparent;
    height: 0;
    border: none;
}
.range_container input[type="range"][name^="max_"] {
    z-index: 1;
    border: none;
    outline: none;
}

.range_container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: all;
    width: 20px;
    height: 20px;
    background: var(--category-color, #595B5B);
    border: 2px solid #fff; /* Deine Anpassung */
    border-radius: 35%;
    cursor: pointer;
    margin-top: -10px;
    outline: none;
    box-shadow: none;
}
.range_container input[type="range"]::-moz-range-thumb {
    pointer-events: all;
    width: 20px;
    height: 20px;
    background: var(--category-color, #595B5B);
    border: 2px solid #fff; /* Deine Anpassung */
    border-radius: 50%;
    cursor: pointer;
    outline: none;
    box-shadow: none;
}

.range_container input[type="range"]::-webkit-slider-thumb:hover {
    background: #fff;
}

.range_container input[type="range"]::-moz-range-thumb:hover {
    background: #fff;
}

.range_container input[type="range"]::-webkit-slider-thumb:active {
    box-shadow: inset 0 0 3px #387bbe, 0 0 9px #387bbe;
}

.range_container input[type="range"]::-moz-range-thumb:active {
    box-shadow: inset 0 0 3px #387bbe, 0 0 9px #387bbe;
}

.apply-filter-button {
    padding: 6px;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    background:  #777;
}

.apply-filter-button:hover {
    background: var(--category-color, #ccc);
    color: var(--category-text-color, white);
}

.subcategory-group {
    display: flex;
    flex-direction: column;
    gap: 5px; /* Abstand zwischen Checkboxen innerhalb einer Gruppe */
}
.subcat-divider {
    border: 1;
    border-top: 1px solid var(--category-color, #ccc);
    margin: 4px 0;
}

/* Anpassung von #subcategoryContainer */
#subcategoryContainer {
    margin: 0px 0 0 25px; /* Erhöhter linker Versatz für Einrückung */
    width: calc(100% - 25px); /* 100% minus ca. 20px (10px schmaler + 10px Margin) */
    box-sizing: border-box;
    padding: 0 6px 0px 6px; /* Wie .checkbox-list.highlighted */
    display: flex;
    flex-direction: column;
    gap: 0; /* Kein zusätzlicher Abstand zwischen Gruppen, da <hr> das übernimmt */
    background: rgba(255, 255, 255, 0.1); /* Wie .checkbox-list.highlighted */
    border-radius: 3px 3px 8px 8px; /* Wie .checkbox-list.highlighted */
    border-bottom: 3px solid var(--category-color, #595B5B); /* Wie .checkbox-list.highlighted */
}

/* Sicherstellen, dass die Checkbox-Liste konsistent bleibt */
#subcategoryContainer .checkbox-list {
    background: none; /* Entfernt zusätzlichen Hintergrund */
    padding: 0; /* Entfernt zusätzliches Padding */
    border: none; /* Entfernt unnötige Ränder */
}

/* Anpassung der Labels in #subcategoryContainer */
/* Anpassung der Labels in #subcategoryContainer */
#subcategoryContainer label {
    display: flex; /* Flexbox für nebeneinanderliegende Elemente */
    align-items: center; /* Vertikale Zentrierung */
    gap: 8px; /* Abstand zwischen Checkbox und Text */
    font-size: 0.82em;
    color: #ccc;
    white-space: nowrap;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5); /* Wie .checkbox-list label */
    transition: background-color 0.3s ease, color 0.3s ease;
    z-index: 2;
}

#subcategoryContainer label:hover {
    background: rgba(255, 255, 255, 0.3); /* Wie .checkbox-list label:hover */
    color: #000;
}

/* Anpassung der Checkboxes in #subcategoryContainer */
#subcategoryContainer input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    margin: 0; /* Kein zusätzlicher Margin, der das Layout verschiebt */
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
    flex-shrink: 0; /* Verhindert, dass die Checkbox schrumpft */
}

#subcategoryContainer input[type="checkbox"]:checked::after {
    content: '';
    width: 10px;
    height: 5px;
    border-left: 2px solid #31d344;
    border-bottom: 2px solid #31d344;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Beibehaltung der HR-Trennung */
#subcategoryContainer hr {
    border: 0;
    border-top: 1px solid #ccc;
    margin: 5px 0;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 5px;
    }
}

.form-row {
    display: flex;
    gap: 20px;
}
.form-row div {
    flex: 1;
}
.form-row select, .form-row input[type="text"] {
    width: 100%;
}
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
}

.admin-login {
    padding: 10px;
    background: #333;
    border-radius: 5px;
    color: white;
}

.admin-login h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.admin-login label {
    display: block;
    margin: 5px 0 2px;
    font-size: 14px;
}

.admin-login input[type="text"],
.admin-login input[type="password"] {
    width: 96%;
    padding: 5px;
    margin-bottom: 10px;
    border: none;
    border-radius: 3px;
}

/* Neuer Button-Stil */
.admin-login-btn {
    background: #555;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.admin-login-btn:hover {
    background: #666;
}
img.sidebar-compass {
  margin-top: 50px;
  padding: 10px;
  justify-content: center;
  opacity: 0.1;
  width: 100%;
  cursor: auto;
}
.tag-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 3px 6px 3px 6px; /* Wie #subcategoryContainer */
    background: rgba(200, 200, 200, 0.1); /* Wie #subcategoryContainer */
    border-radius: 3px 3px 8px 8px; /* Wie #subcategoryContainer */
    border: 3px solid var(--category-color, #595B5B); /* Wie #subcategoryContainer */
    border-top: none;
    margin: 0px 0 0 0px; /* Wie #subcategoryContainer */
    width: 93%; /* Wie #subcategoryContainer */
    min-height: 25px;
    align-items: center;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px; /* Wie #subcategoryContainer label */
    background: rgba(0, 0, 0, 0.5); /* Wie #subcategoryContainer label */
    border-radius: 5px; /* Wie #subcategoryContainer label */
    font-size: 0.80em; /* Wie #subcategoryContainer label */
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    user-select: none;
    color: #ccc; /* Wie #subcategoryContainer label */
}

.tag-chip:hover {
    background: rgba(255, 255, 255, 0.3); /* Wie #subcategoryContainer label:hover */
    color: #000;
}

.tag-chips-container .tag-chip.selected {
    background-color: var(--category-color, #595B5B);
    color: var(--category-text-color, #fff); /* Kontrast-Text: dunkel auf hellem Akzent */
    font-weight: bold;
}

.tag-chip input[type="checkbox"] {
    display: none; /* Checkbox verstecken */
}

/* === Gewichtsverifikations-Filter (v0.49.0: volle Breite im Gewicht-Block, Stil wie Kategorieauswahl) === */
.weight-verified-list {
    margin-top: 8px;        /* Abstand zu den Slidern */
    max-height: none;       /* kein Scroll-Container für die eine Zeile */
}
.weight-verified-list label {
    white-space: normal;    /* langer Text darf umbrechen statt zu überlaufen */
}
.weight-verified-icon-inline {
    color: #c8a87a;
    font-size: 1.1em;
    margin-left: 2px;
}

/* === enum_icon-Switch (field_map: z. B. Geschlecht, single-select) === */
.enum-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.enum-switch .enum-opt {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 5px 2px 2px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #d8d4cc;
    cursor: pointer;
    font: inherit;
    font-size: 0.85em;
    transition: border-color 0.15s, background 0.15s;
}
.enum-switch .enum-opt:hover {
    border-color: #c8a87a;
}
.enum-switch .enum-opt img {
    width: 18px;
    height: 18px;
    filter: grayscale(1);
    opacity: 0.55;
    transition: filter 0.15s, opacity 0.15s;
}
.enum-switch .enum-opt.is-selected {
    border-color: #c8a87a;
    background: rgba(200, 168, 122, 0.16);
    color: #fff;
}
.enum-switch .enum-opt.is-selected img {
    filter: none;
    opacity: 1;
}
