/**
 * Sidebar Custom Scrollbar CSS
 * Styling für die SimpleBar Scrollbar in der Sidebar
 */

/* Sidebar Scrollbar Container - WICHTIG: Muss scrollbar sein! */
.app-sidebar {
    height: 100vh;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
}

.app-sidebar .logo-box {
    flex-shrink: 0;
}

.app-sidebar .scrollbar {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

/* Fallback: Normale Scrollbar wenn SimpleBar nicht funktioniert */
.app-sidebar .scrollbar::-webkit-scrollbar {
    width: 8px;
}

.app-sidebar .scrollbar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

.app-sidebar .scrollbar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    transition: background 0.2s;
}

.app-sidebar .scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Firefox Scrollbar */
.app-sidebar .scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* SimpleBar Wrapper - nur wenn SimpleBar aktiv ist */
.app-sidebar .scrollbar[data-simplebar] {
    overflow: hidden;
}

.app-sidebar .simplebar-wrapper {
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.app-sidebar .simplebar-mask {
    direction: inherit;
    position: absolute;
    overflow: hidden;
    padding: 0;
    margin: 0;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    width: auto !important;
    height: auto !important;
    z-index: 0;
}

.app-sidebar .simplebar-offset {
    direction: inherit !important;
    box-sizing: inherit !important;
    resize: none !important;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    padding: 0;
    margin: 0;
    -webkit-overflow-scrolling: touch;
}

.app-sidebar .simplebar-content-wrapper {
    direction: inherit;
    box-sizing: border-box !important;
    position: relative;
    display: block;
    height: 100%;
    width: auto;
    max-height: 100%;
    max-width: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.app-sidebar .simplebar-content-wrapper::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.app-sidebar .simplebar-content {
    overflow: visible;
    min-width: 100%;
    box-sizing: border-box;
}

/* Scrollbar Track */
.app-sidebar .simplebar-track {
    z-index: 10;
    position: absolute;
    right: 0;
    bottom: 0;
    width: 8px;
    pointer-events: auto;
    overflow: hidden;
}

.app-sidebar .simplebar-track.simplebar-vertical {
    top: 0;
    width: 8px;
}

.app-sidebar .simplebar-track.simplebar-horizontal {
    left: 0;
    height: 8px;
}

/* Scrollbar - Standard: Versteckt, nur sichtbar wenn nötig */
.app-sidebar .simplebar-scrollbar {
    position: absolute;
    right: 2px;
    width: 4px;
    min-height: 10px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s linear;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    cursor: pointer;
}

/* Scrollbar sichtbar machen wenn nötig */
.app-sidebar .simplebar-scrollbar.simplebar-visible {
    opacity: 0.6;
}

/* Scrollbar beim Hover */
.app-sidebar .simplebar-scrollbar:hover,
.app-sidebar .simplebar-scrollbar.simplebar-hover {
    opacity: 0.9;
    background: rgba(0, 0, 0, 0.5);
}

/* Scrollbar beim Draggen */
.app-sidebar .simplebar-scrollbar.simplebar-dragging {
    opacity: 1;
    background: rgba(0, 0, 0, 0.7);
}

/* Track sichtbar machen wenn benötigt */
.app-sidebar .simplebar-track.simplebar-vertical {
    opacity: 0;
    transition: opacity 0.2s linear;
}

.app-sidebar .simplebar-track.simplebar-vertical.simplebar-visible {
    opacity: 1;
}

/* Track beim Hover sichtbar machen */
.app-sidebar:hover .simplebar-track.simplebar-vertical.simplebar-visible {
    opacity: 1;
}

/* Dark Mode Support */
[data-bs-theme="dark"] .app-sidebar .scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] .app-sidebar .scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

[data-bs-theme="dark"] .app-sidebar .scrollbar {
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

[data-bs-theme="dark"] .app-sidebar .simplebar-scrollbar {
    background: rgba(255, 255, 255, 0.3);
}

[data-bs-theme="dark"] .app-sidebar .simplebar-scrollbar:hover,
[data-bs-theme="dark"] .app-sidebar .simplebar-scrollbar.simplebar-hover {
    background: rgba(255, 255, 255, 0.5);
}

[data-bs-theme="dark"] .app-sidebar .simplebar-scrollbar.simplebar-dragging {
    background: rgba(255, 255, 255, 0.7);
}

/* Smooth Scrolling */
.app-sidebar .scrollbar,
.app-sidebar .simplebar-content {
    scroll-behavior: smooth;
}

/* Mobile Optimierung */
@media (max-width: 768px) {
    .app-sidebar .scrollbar::-webkit-scrollbar {
        width: 6px;
    }
    
    .app-sidebar .simplebar-scrollbar {
        width: 6px;
        right: 1px;
    }
    
    .app-sidebar .simplebar-track.simplebar-vertical {
        width: 6px;
    }
}

