.sort-dropdown, .filter-dropdown, .search-dropdown, .past-dropdown {
    position: absolute;
    display: inline-block;
}

.sort-dropdown {
    right: 1rem;
}

.past-dropdown {
    left: 12rem;
}

.filter-dropdown {
    right: 12rem;
}

.search-dropdown {
    left: 1rem;
}

.sort-btn,
.filter-btn,
.search-btn,
.past-btn {
    background-color: var(--bg-dark);
    color: var(--text);
    border: 1px solid var(--text);
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font-size: 1rem;
    border-radius: 1rem;
    margin: 0;
    cursor: pointer;
    padding: 0 0.5rem;
    padding-left: 1rem;
    width: 10rem;
    justify-content: space-between;
}

.sort-btn:hover,
.filter-btn:hover,
.search-btn:hover,
.past-btn:hover {
    background-color: var(--bg) !important;
}
.sort-options,
.filter-options,
.past-options,
#searchInput {
    display: none;
    position: absolute;
    background-color: var(--bg-dark);
    box-shadow: 0px 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: 1px solid var(--text);
    border-radius: 1rem;
    z-index: 10;
    margin-top: 0.25rem;
}
#searchInput {
    min-width: 20rem;
}
.sort-options a,
.filter-options a,
.past-options a
{
    display: flex;
}
.sort-options a,
.filter-options a,
.past-options a,
#searchInput {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    color: var(--text);
    padding: 0.75rem 1rem;
    box-sizing: border-box;
    text-decoration: none;
    font-size: 0.875rem;
}

.filter-options details:not(:last-child) {
    border-bottom: 1px solid var(--text);
}

.filter-options a {
    padding: 0.2rem 1rem;
}
.filter-options summary {
    width: 100%;
    color: var(--text);
    padding: 0.5rem 1rem;
    box-sizing: border-box;
    font-size: 0.875rem;
}
/* Box is rounded, so first and last need to be as well */
.sort-options > a:first-child,
.past-options > a:first-child,
.filter-options > a:first-child,
.filter-options details:first-child,
.filter-options details:first-child > summary {
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}
.sort-options > a:last-child,
.past-options > a:last-child,
.filter-options > a:last-child,
.filter-options details:last-child,
.filter-options details:last-child:not([open]) > summary,
.filter-options details:last-child[open] > :last-child {
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
}
.sort-options a.use,
.filter-options a.use {
    font-weight: bold;
}

.filter-options details:hover {
    background-color: var(--bg);
}

.filter-options a:hover,
.filter-options details[open] summary:hover {
    background-color: var(--bg-dark);
}

.sort-options a:hover,
.filter-options details:not([open]) summary:hover,
.filter-options details summary:last-child:hover,
.past-options a:hover {
    background-color: var(--bg);
}
.sort-options.show,
.filter-options.show,
#searchInput.show,
.past-options.show {
    min-width: 10rem;
    display: block;
}

@media screen and (max-width: 768px) {
    
    .filter-dropdown {
        right: 1rem;
        /* left: auto; */
    }
    .sort-dropdown {
        left: 3.5rem;
        width: max-content;
    }

    .sort-options.show,
    .filter-options.show {
        width: 80vw;
    }
    .sort-options {
        left: 0;
        right: auto;
    }
    .filter-options {
        right: 0;
        left: auto;
    }
    .sort-btn,
    .filter-btn {
        width: 2rem;
        padding: 0.1rem !important;
            justify-content: center;
    }
    .btn-text {
        display: none;
    }

    .search-dropdown {
        left: 1rem;
        .search-btn {
            width: 2rem;
            padding: 0.1rem !important;
            justify-content: center;
        }
        #searchInput {
            width: 80vw;
        }
    }
}