/* Global Scrollbar Styles for Desktop */

/* Webkit Scrollbars (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    transition: background-color 0.2s ease-in-out;
}

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

::-webkit-scrollbar-thumb:active {
    background: rgba(0, 0, 0, 0.6);
}

::-webkit-scrollbar-corner {
    background: rgba(0, 0, 0, 0.05);
}

/* Firefox Scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.05);
}

/* Dark Mode Scrollbar Styles */
.darkMode * {
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

/* Dark Theme Scrollbar Styles */
[data-mui-color-scheme="dark"] ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

[data-mui-color-scheme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

[data-mui-color-scheme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

[data-mui-color-scheme="dark"] ::-webkit-scrollbar-thumb:active {
    background: rgba(255, 255, 255, 0.6);
}

[data-mui-color-scheme="dark"] ::-webkit-scrollbar-corner {
    background: rgba(255, 255, 255, 0.05);
}

[data-mui-color-scheme="dark"] * {
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

/* Drawer Specific Scrollbar Styling */
.darkMode .MuiDrawer-paper * {
    scrollbar-color: rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.05);
}

.MuiDrawer-paper ::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.MuiDrawer-paper ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
}

.MuiDrawer-paper ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.MuiDrawer-paper ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Table/DataGrid Scrollbar Styling */
.MuiDataGrid-root ::-webkit-scrollbar,
.MuiTable-root ::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.MuiDataGrid-root ::-webkit-scrollbar-track,
.MuiTable-root ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
}

.MuiDataGrid-root ::-webkit-scrollbar-thumb,
.MuiTable-root ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

.MuiDataGrid-root ::-webkit-scrollbar-thumb:hover,
.MuiTable-root ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Mobile - Hide Scrollbars on Touch Devices */
@media (hover: none) and (pointer: coarse) {
    ::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }
    
    * {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
}

/* Smooth Scrolling for Better UX */
html {
    scroll-behavior: smooth;
}

/* Enhanced Scrolling for Webkit */
* {
    -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar for Specific Components */
.ovrc-scrollable {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.05);
}

.ovrc-scrollable::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.ovrc-scrollable::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

.ovrc-scrollable::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    transition: background-color 0.2s ease-in-out;
}

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