:root {
    --light-border: 1px solid var(--light-border-color);
    --status-completed-color: #2fb344;
    --status-completed-bg-color: rgba(47, 179, 68, 0.1);
    --status-building-color: orange;
    --status-building-bg-color: rgba(255, 165, 0, 0.1);
    --status-publishing-color: #ef01e0;
    --status-publishing-bg-color: rgba(239, 1, 224, 0.1);
    --status-failed-color: #d63939;
    --status-failed-bg-color: rgba(214, 57, 57, 0.1);
    --status-blocked-color: #ca8686;
    --status-blocked-bg-color: rgba(202, 134, 134, 0.1);
    --status-new-color: #009fff;
    --status-new-bg-color: rgba(4, 146, 234, 0.1);
    --status-superseded-color: #90b14c;
    --status-superseded-bg-color: rgba(180, 255, 16, 0.1);
}

@media (prefers-color-scheme: light) {
    :root {
        --body-background-color: #fff;
        --body-text-color: #39373e;
        --light-background-color: #f6f6f8;
        --light-border-color: #dbdbdb;
        --lighter-background-color: #fff;
        --muted-color: #9b9595;
        --link-color: #8b00a3;
        --link-hover-color: #18181b;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --body-background-color: #18181b;
        --body-text-color: #c9c7cc;
        --light-background-color: #27262c;
        --light-border-color: #3c3a46;
        --lighter-background-color: #36343c;
        --muted-color: #9b9595;
        --link-color: #e3b6ed;
        --link-hover-color: #fff;
    }
}

body {
    background-color: var(--body-background-color);
    color: var(--body-text-color);
    font-family: sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

a {
    color: var(--link-color);
}

a:hover {
    color: var(--link-hover-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header h1 {
    margin: 0 0 0 12px;
    font-size: 1em;
}

.title-bar {
    background-color: var(--light-background-color);
    border-bottom: var(--light-border);
    padding: 16px 0;
    font-size: 1.4em;
}

.menu-bar {
    background-color: var(--light-background-color);
    border-bottom: var(--light-border);
    padding: 16px 0;
}

.menu-bar__items {
    margin: 0;
    padding: 0;
    display: flex;
    list-style: none;
    gap: 12px;
}

.menu-bar__items a {
    color: var(--body-text-color);
    padding: 0 12px;
    text-decoration: none;
}

.overview {
    margin: 24px;
}

.overview-info {
    flex: 1;
}

.overview-info h3 {
    margin-top: 0;
}

.overview-info__content {
    border: 1px solid var(--light-border-color);
    border-radius: 3px;
    padding: 24px;
    background-color: var(--light-background-color);
    line-height: 1.5em;
}

.overview-info__content h4 {
    margin-top: 0;
}

.overview-info__content p:first-child {
    margin-top: 0;
}

.overview-info__content p:last-child {
    margin-bottom: 0;
}

.overview-recent {
    flex: 1;
}

.overview-recent__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.overview-recent__list__item {
    margin: 0;
    border: 1px solid var(--light-border-color);
    border-radius: 3px;
    padding: 24px;
    background-color: var(--light-background-color);
    font-size: 1em;
    color: var(--muted-color);
    position: relative;
    margin-bottom: 24px;
}

.overview-recent__list__item::before {
    width: 12px;
    height: 12px;
    background-color: gray;
    content: " ";
    position: absolute;
    bottom: 24px;
    right: 24px;
    border-radius: 12px;
}

.overview-recent__list__item.overview-recent__list__item--completed::before {
    background-color: var(--status-completed-color);
}

.overview-recent__list__item.overview-recent__list__item--building ::before {
    background-color: var(--status-building-color);
}

.overview-recent__list__item.overview-recent__list__item--publishing::before {
    background-color: var(--status-publishing-color);
}

.overview-recent__list__item.overview-recent__list__item--failed::before {
    background-color: var(--status-failed-color);
}

.overview-recent__list__item.overview-recent__list__item--blocked::before {
    background-color: var(--status-blocked-color);
}

.overview-recent__list__item.overview-recent__list__item--new::before {
    background-color: var(--status-new-color);
}

.overview-recent__list__item:last-child {
    margin-bottom: 0;
}

.overview-recent__list__item h4 {
    margin: 0;
    color: var(--body-text-color);
}

.overview-builders {
    flex: 1;
}

.overview-builders h3 {
    margin-top: 0;
}

.overview-builders__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.overview-builders__list__item {
    margin: 0;
    border: 1px solid var(--light-border-color);
    border-radius: 3px;
    padding: 24px;
    background-color: var(--light-background-color);
    font-size: 1em;
    color: var(--muted-color);
    position: relative;
    margin-bottom: 24px;
}

.overview-builders__list__item::before {
    width: 12px;
    height: 12px;
    background-color: gray;
    content: " ";
    position: absolute;
    bottom: 24px;
    right: 24px;
    border-radius: 12px;
}

.overview-builders__list__item.overview-builders__list__item--Disconnected::before {
    background-color: var(--status-failed-color);
}

.overview-builders__list__item.overview-builders__list__item--Idle::before {
    background-color: var(--status-blocked-color);
}

.overview-builders__list__item.overview-builders__list__item--Building::before {
    background-color: var(--status-building-color);
}

.overview-builders__list__item:last-child {
    margin-bottom: 0;
}

.overview-builders__list__item h4 {
    margin: 0;
    color: var(--body-text-color);
}

.tasks-total-filter {
    padding: 24px 0;
    color: var(--body-text-color);
    display: flex;
    flex-direction: row;
    gap: 24px;
    text-align: center;
    margin-left: 12px;
    justify-content: space-between;
}

.tasks-total-filter__search {
    background: #27262c;
    border: 1px solid #3c3a46;
    border-radius: 3px;
    color: white;
}

.tasks-total-filter__filter-sort {
    display: flex;
    gap: 24px;
}

.tasks-total-filter__filter-sort select {
    text-transform: capitalize;
}

.tasks__list__item.tasks__list__item--not-found {
    flex-direction: row;
    justify-content: center;
}

/*** Projects ***/
.projects {
    display: grid;
    grid-gap: 12px;
    grid-template-columns: 1fr 1fr;
}

.project {
    border: 1px solid #32183e;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: var(--light-background-color);
    border-radius: 6px;
    text-decoration: none;
    color: white;
}

.project__title {
    font-size: 1.4em;
}

.project__summary {
    color: #823fa2;
}

.project__profile {
    display: flex;
    gap: 12px;
}

.project__profile__arch {
    border-radius: 3px;
    border: var(--light-border);
    padding: 6px;
    background-color: var(--light-background-color);
    color: var(--muted-color);
}

/*** Tasks ***/
.tasks {
    border: var(--light-border);
    border-radius: 6px;
}

.tasks__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
}

.tasks__list__item {
    display: flex;
    flex-direction: column;
    padding: 12px 24px;
    border-top: var(--light-border);
    margin: 0;
    gap: 12px;
    background-color: var(--light-background-color);
}

.tasks__list__item--not-found span {
    text-transform: capitalize;
}

.tasks__list__item:first-child {
    border-top: none;
}

.tasks__list__item__id {
    display: flex;
    justify-content: center;
    align-items: center;
}

.tasks__list__item__id span {
    border-radius: 3px;
    border: var(--light-border);
    padding: 6px;
    background-color: var(--lighter-background-color);
    color: var(--muted-color);
    width: 80px;
    text-align: center;
}

.tasks__list__item__detail {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
}

.tasks__list__item__timing {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #5e2e75;
    margin: 0 24px;
    font-size: 0.8em;
    justify-content: center;
    text-align: center;
    color: var(--muted-color);
}

.tasks__list__item__arch {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tasks__list__item__arch span {
    border-radius: 3px;
    border: var(--light-border);
    padding: 6px;
    background-color: var(--lighter-background-color);
    color: var(--muted-color);
}

.tasks__list__item__status {
    display: flex;
    justify-content: center;
    align-items: center;
}

.tasks__list__item__status span {
    width: 120px;
    text-align: center;
}

.badge {
    border-radius: 20px;
    padding: 6px 12px;
    text-transform: capitalize;
}

.badge--completed {
    color: var(--status-completed-color);
    background-color: var(--status-completed-bg-color);
}

.badge--building {
    color: var(--status-building-color);
    background-color: var(--status-building-bg-color);
}

.badge--publishing {
    color: var(--status-publishing-color);
    background-color: var(--status-publishing-bg-color);
}

.badge--failed {
    color: var(--status-failed-color);
    background-color: var(--status-failed-bg-color);
}

.badge--blocked {
    color: var(--status-blocked-color);
    background-color: var(--status-blocked-bg-color);
}

.badge--new {
    color: var(--status-new-color);
    background-color: var(--status-new-bg-color);
}

.badge--superseded {
    color: var(--status-superseded-color);
    background-color: var(--status-superseded-bg-color);
}

.pagination-wrap {
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    flex-wrap: nowrap;
    list-style: none;
    padding: 0;
    margin: 1em 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border: var(--light-border);
    border-radius: 3px;
}

.pagination::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.page-item {
}

.page-link {
    display: inline-block;
    padding: 0.5em 0.75em;
    border-right: var(--light-border);
    background: var(--light-background-color);
    color: var(--link-color);
    text-decoration: none;
    font-size: 0.9em;
    min-width: 1.5em;
    text-align: center;
}

.page-link:hover {
    background: var(--lighter-background-color);
}

.page-item.active .page-link {
    background: var(--muted-color);
    color: #fff;
    border-color: var(--light-border-color);
}

.page-item.disabled .page-link {
    color: #504057;
    pointer-events: none;
    background: var(--light-background-color);
}

.custom-select-wrapper {
    position: relative;
    display: inline-block;
}

.custom-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    padding: 2px 30px 2px 10px;
    border: 1px solid var(--light-border-color);
    border-radius: 4px;
    background-color: var(--light-background-color);
    background-image: none;
    cursor: pointer;
    color: var(--body-text-color);
    font-size: 0.8em;
}

.custom-select-wrapper::after {
    content: "▼";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 12px;
    color: var(--body-text-color);
}

@media (max-width: 480px) {
    .page-link {
        padding: 0.4em 0.6em;
        font-size: 0.8em;
    }
}

@media (min-width: 800px) {
    .overview {
        display: flex;
        gap: 24px;
        margin: 24px 0 0 0;
    }

    .overview-recent h3 {
        margin-top: 0;
    }

    .tasks-total-filter {
        flex-direction: row;
        justify-content: space-between;
    }

    .tasks-total-filter__filter-sort__item {
        display: flex;
        gap: 6px;
        align-items: center;
    }

    .tasks__list__item {
        flex-direction: row;
    }

    .tasks__list__item.tasks__list__item--not-found {
        justify-content: flex-start;
    }

    .tasks__list__item__id {
        margin-right: 24px;
    }

    .tasks__list__item__status {
        margin-left: 24px;
    }

    .tasks__list__item__detail {
        text-align: left;
    }

    .tasks__list__item__timing {
        text-align: left;
    }

    .page-link {
        min-width: 2.5em;
    }
}

@media (min-width: 1200px) {
    header h1 {
        margin-left: 0;
    }

    .tasks-total-filter {
        margin-left: 0;
    }
}
