/* src/shared/styles/scrollbar.css */

/* Base SimpleBar container rules */
[data-simplebar] {
    position: relative !important;
    flex: 1 !important;
    min-height: 0 !important;
}

/* Ensure content wrapper takes full height but not more */
.simplebar-content-wrapper {
    min-height: 100% !important;
    max-height: 100% !important;
}

/* Ensure content doesn't expand beyond wrapper */
.simplebar-content {
    min-height: 100% !important;
    max-height: fit-content !important;
}

/* Base SimpleBar Styles */
.simplebar-scrollbar::before {
    background-color: var(--text-muted);
    border-radius: 6px;
}

.simplebar-track {
    position: absolute;
    margin: 0;
    z-index: 1;
}

.simplebar-track.simplebar-vertical {
    width: 15px;
    background: transparent;
    right: 0;
    top: 0;
    bottom: 0;
    pointer-events: all;
    z-index: var(--z-overlay);
}

.simplebar-scrollbar {
    position: absolute;
    right: 0;
    width: 100%;
    min-height: 10px;
    pointer-events: all;
    z-index: var(--z-overlay);
}

.simplebar-track.simplebar-horizontal {
    position: sticky !important;
    bottom: 0 !important;
    margin: 0 !important;
    z-index: var(--z-overlay);
    height: 15px;
    background: transparent;
}

.billing-table-container .simplebar-track.simplebar-horizontal {
    position: sticky !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
}

.simplebar-track.simplebar-horizontal .simplebar-scrollbar {
    height: 8px;
    /* Height of the scrollbar */
    top: 3px;
    /* Center the scrollbar vertically */
}

.simplebar-track.simplebar-horizontal .simplebar-scrollbar::before {
    background-color: var(--text-muted);
    border-radius: 6px;
    opacity: 1;
}

/* Dark theme variation */
body.dark-theme .simplebar-track.simplebar-horizontal .simplebar-scrollbar::before {
    background-color: var(--border-dark);
}

/* Hover state */
.simplebar-track.simplebar-horizontal .simplebar-scrollbar:hover::before {
    background-color: var(--gold-accent);
}

/* Main Container */
.main-scroll-container {
    width: 100%;
    height: 100vh;
    overscroll-behavior-x: none;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
}

/* Theme Variations */
body.dark-theme .simplebar-scrollbar::before {
    background-color: var(--border-dark);
    opacity: 1 !important;
}

/* Hover States */
.simplebar-scrollbar:hover::before {
    background-color: var(--gold-accent);
}

/* Active state (while dragging) */
.simplebar-scrollbar:active::before {
    background-color: var(--gold-accent) !important;
}

/* Make sure the active state has higher specificity */
.simplebar-track .simplebar-scrollbar:active::before {
    background-color: var(--gold-accent) !important;
}

/* Modal scrollbar specific styles */
.modal .custom-thumb::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background-color: var(--text-muted);
    border-radius: 6px;
    opacity: 1;
    transition: background-color var(--transition-speed);
}

.modal .custom-thumb:hover::before {
    background-color: var(--gold-accent);
}

/* Dropdown-specific scrollbar styles */
.dropdown-scrollbar::before {
    background-color: var(--border-dark);
    border-radius: 6px;
    opacity: 1;
}

.dropdown-scrollbar:hover::before {
    background-color: var(--gold-accent);
}

.dropdown-track.simplebar-vertical {
    width: 12px;
    /* Slightly smaller than regular scrollbars */
    background: transparent;
    right: 0;
    top: 0;
    bottom: 0;
}

/* Theme variations */
body.dark-theme .dropdown-scrollbar::before {
    background-color: var(--border-dark);
}

body.dark-theme .dropdown-scrollbar:hover::before {
    background-color: var(--gold-accent);
}

/* Dark theme override */
body.dark-theme .modal .custom-thumb::before {
    background-color: var(--border-dark);
}

body.dark-theme .modal .custom-thumb:hover::before {
    background-color: var(--gold-accent);
}