/* Reset specific to hub and councils page */
body.hub-page, body.councils-page, .hub-page *, .councils-page * {
    box-sizing: border-box;
}

/* Page wrapper */
.hub-content-wrapper, .councils-content-wrapper {
    display: flex;
    flex: 1;
    width: 100%;
    margin-top: 20px;
    gap: 20px;
}

/* Sidebar */
.hub-sidebar, .councils-sidebar {
    width: 250px;
    background-color: #dbe0f2;
    padding: 20px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height, 0px)); /* flexible height */
    position: sticky;
    top: 0; /* can be dynamically adjusted via JS if needed */
}

.hub-sidebar h3, .councils-sidebar h3 {
    margin-bottom: 15px;
}

.hub-sidebar label, .councils-sidebar label {
    margin-top: 10px;
    display: block;
    font-weight: bold;
}

.hub-sidebar select, .hub-sidebar input,
.councils-sidebar select, .councils-sidebar input {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.hub-sidebar button, .councils-sidebar button {
    margin-top: 10px;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    background-color: #7d88b0;
    color: #fff;
    cursor: pointer;
}

.hub-sidebar button:hover, .councils-sidebar button:hover {
    background-color: #5a6ea6;
}

/* Main content */
.hub-main, .councils-main {
    flex: 1;
    padding: 20px;
    overflow-x: auto;
}

.hub-main h1, .councils-main h1 {
    margin-bottom: 10px;
    color: #5a6ea6;
}

.hub-main p, .councils-main p {
    margin-bottom: 20px;
}

/* Tables */
#hub-projects-table, #councils-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 5px;
    overflow: hidden;
}

#hub-projects-table th, #hub-projects-table td,
#councils-table th, #councils-table td {
    padding: 12px 15px;
    border: 1px solid #d1d5e0;
    text-align: left;
}

#hub-projects-table th, #councils-table th {
    background-color: #5a6ea6;
    color: #fff;
}

#hub-projects-table tr:nth-child(even), #councils-table tr:nth-child(even) {
    background-color: #f2f4f9;
}

/* Responsive adjustments */
@media screen and (max-width: 1024px) {
    .hub-content-wrapper, .councils-content-wrapper {
        flex-direction: column;
    }

    .hub-sidebar, .councils-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
    }

    .hub-main, .councils-main {
        padding: 10px;
    }
}

/* Sort arrows for table headers */
#councils-table th {
    position: relative;
    cursor: pointer;
}

#councils-table th::after {
    content: '▲'; /* default arrow */
    position: absolute;
    right: 10px;
    font-size: 0.7em;
    opacity: 0; /* hidden by default */
}

#councils-table th.sort-asc::after {
    content: '▲';
    opacity: 1;
}

#councils-table th.sort-desc::after {
    content: '▼';
    opacity: 1;
}