/* Universal box sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Basic reset */
body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: auto;
}

/* Header */
header {
    position: fixed;
    height: 72px;
}

/* Sidebar */
#sidebar {
    position: fixed;
    top: 72px; /* below header */
    left: 0;
    width: 250px;
    height: calc(100vh - 72px); /* Full screen height minus the header */
    overflow-y: auto; /* Enable vertical scrolling */
    transition: width 0.3s;
    z-index: 999;
    background-color: white;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Collapsed sidebar */
#sidebar.collapsed {
    width: 80px;
}

#sidebar.collapsed .sidebar-label {
    display: none;
}

/* Main content */
#mainContent {
    margin-left: 250px;
    transition: margin-left 0.3s;
    height: calc(100vh - 72px);
    overflow-y: auto;
}

/* Adjust main content when sidebar is collapsed */
#sidebar.collapsed ~ #mainContent {
    margin-left: 80px;
}

/* Nav link styles */
#sidebar .nav-link {
    display: flex;
    align-items: center;
    padding-left: 5px;
}

#sidebar .nav-link i {
    width: 30px;
    text-align: center;
}

/* Sidebar toggle hover */
#toggleBtn:hover {
    background-color: #e0e0e0;
    opacity: 0.8;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

/* Flex content area inside main */
.flex-grow-1 {
    padding: 0;
    overflow-y: auto;
}

/* Sticky footer */
footer {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    bottom: 0;
    background: #f8f9fa;
}

/* Responsive handling for smaller screens */
@media (max-width: 768px) {
    #sidebar {
        width: 80px;
    }

    #sidebar .sidebar-label {
        display: none;
    }

    #mainContent {
        margin-left: 80px;
    }
}
