/* === General sidebar styling === */
.sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    margin: 10px;
    border-radius: var(--border-radius);
    background-color: var(--background-light1);
    position: relative;
    transition: all 0.3s ease;

    font-size: 0.9em;

    gap: 4px;

    padding: 4px;
}

/* === Sidebar content styling === */
.sidebar-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
    height: auto;
    background-color: var(--secondary-dark5);
    border-radius: var(--border-radius-sm);
}

.sidebar-header {
    display: flex;
    justify-content: center;
    align-items: center;

    width: 100%;
    padding-inline: 8px;
    
    border-bottom: 1px solid var(--border);
    background-color: var(--background-dark3);

    overflow: hidden;

    font-size: 1.1em;
    font-weight: bold;

    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}
.sidebar-content:first-child .sidebar-header {
    border-radius: inherit inherit 0 0;
}
.sidebar-header:only-child {
    border-radius: inherit;
    border: none;
}
.sidebar-header span {
    width: 100%;
    text-align: center;
}
.sidebar-header.hoverable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}
.sidebar-header.hoverable:hover {
    background-color: var(--secondary-dark3);;
}

.sidebar-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;

    width: 100%;
    height: auto;

    overflow: visible;

    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
}
.sidebar-body > :last-child {
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
}

/* Sidebar buttons */
.sidebar-button {
    background-color: transparent;
    transition: background 0.2s ease;
}
.button-wrapper.striped:nth-of-type(odd) .sidebar-button {
    background-color: var(--secondary-dark3);
}
.sidebar-button:hover {
    background-image: linear-gradient(rgba(0, 0, 0, 0.2));
    cursor: pointer;
}

.button-wrapper .sidebar-input:checked + .sidebar-button {
    background-color: var(--secondary) !important;
    font-weight: 700;
}
.button-wrapper .sidebar-input.current:not(:checked) + .sidebar-button {
    background-color: var(--secondary-light2);
}

/* === Sidebar Filter styles === */
.filter-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}
.filter-wrapper.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.filter-wrapper.disabled .filter-header {
    background-color: var(--background-dark5);
    pointer-events: none;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    cursor: pointer;
    user-select: none;
    position: relative;

    padding: 5px 10px;
    width: 100%;

    transition: background 0.2s ease;
    background-color: var(--background-dark2);
    box-shadow: 0px 4px 14px rgba(0, 0, 0, 0.2)
}
.filter-header:hover {
    background-color: rgba(0,0,0,.5);
}

.arrow {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 6px solid #6b7280;
  transition: transform 0.2s ease;
}
.filter-wrapper.open .arrow {
  transform: rotate(90deg);
}

.filter-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease;
}
.filter-wrapper.open .filter-body {
  max-height: 500px;
  overflow: visible;
}

/* == Sidebar Navigation == */
.sidebar-body > ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}
.sidebar-body > ul > a {
    display: flex;
    text-align: center;
    align-items: center;
    white-space: nowrap;
    width: 100%;
    padding: 6px 8px;
    gap: 5px;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;

    text-decoration: none;
    color: inherit;
}
.sidebar-body > ul > a i {
    font-size: 18px;
    line-height: 18px;
}
.sidebar-body > ul > a:hover {
    color: var(--text);
}
.sidebar-body > ul > :last-child {
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
}

/* Sidebar collapse button styling */
.sidebar-collapser {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 5px;
    cursor: pointer;
    user-select: none;
    background-color: var(--accent);
    box-shadow: 5px 5px 13px rgba(0,0,0,.4);
    position: absolute;
    left: 100%;
    top: 5px;
    transform: translateX(-50%);
    border-radius: 50%;
    transition: transform 0.2s ease;
}

/* Hover transform depends on sidebar state */
.sidebar.active .sidebar-collapser:hover {
    transform: scale(1.1);
}
.sidebar:not(.active) .sidebar-collapser:hover {
    transform: translateX(5%) scale(1.1);
}

/* Sidebar Backdrop for scrolling on mobile */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 999;
}

.sidebar-backdrop.active {
    display: block;
}
