/* Scrolling Fix for Dashboard Pages */

/* Fix main content scrolling */
.main-content {
    height: calc(100vh - 0px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 40px;
    max-width: calc(100vw - 280px) !important;
}

/* Ensure tab content can scroll */
.tab-content {
    max-height: none;
    overflow: visible;
}

/* Fix units container scrolling */
.units-container {
    max-height: none;
    overflow: visible;
}

/* Fix gates container scrolling */
.gates-container {
    max-height: none;
    overflow: visible;
}

/* Fix residents container scrolling */
.residents-container {
    max-height: none;
    overflow: visible;
}

/* Fix passes container scrolling */
.passes-container {
    max-height: none;
    overflow: visible;
}

/* Ensure content cards don't restrict height */
.content-card {
    max-height: none;
    overflow: visible;
}

/* Fix data table scrolling */
.data-table-container {
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar for main content */
.main-content::-webkit-scrollbar {
    width: 12px;
}

.main-content::-webkit-scrollbar-track {
    background: var(--background-secondary);
    border-radius: 10px;
    margin: 10px 0;
}

.main-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    border: 2px solid var(--background-secondary);
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1);
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.15);
}

/* Fix sidebar scrolling if needed */
.sidebar {
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.3);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.5);
}

/* Ensure dashboard screen doesn't restrict height */
#dashboardScreen {
    min-height: 100vh;
    height: auto;
    overflow: visible;
}

/* Fix for modal scrolling */
.popup-modal {
    max-height: 90vh;
    overflow-y: auto;
}

.popup-modal::-webkit-scrollbar {
    width: 8px;
}

.popup-modal::-webkit-scrollbar-track {
    background: var(--background-secondary);
    border-radius: 10px;
}

.popup-modal::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}
