:root {
    color-scheme: dark;
    font-family: sans-serif;
    --inner-background: #2b2a33;
    --background-color: #282a36;
    --text-color: #f8f8f2;
    --gray-text-color: #75747a;

    --orange: #f28f3bff;
    --purple: #cbbaedff;
    --yellow: #f7ef81ff;
    --green: #61e786ff;
    --red: #aa4465ff;
    --blue: #2892d7ff;

    /* color for meta */
    --meta-color: #3556f9;

    background: var(--background-color);
    color: var(--text-color);

    --nav-height: 50px;
    --sidebar-width: 200px;
}

.orange {
    color: var(--orange);
}
.purple {
    color: var(--purple);
}
.yellow {
    color: var(--yellow);
}
.green {
    color: var(--green);
}
.red {
    color: var(--red);
}
.blue {
    color: var(--blue);
}
.gray {
    color: var(--gray-text-color);
}

#root-wrapper {
    align-items: center;
    justify-content: center;
    display: flex;
    min-width: 70%;
    margin: 8px;
}

#root {
    width: 100%;
    max-width: 100%;
    @media (min-width: 768px) {
        max-width: 750px;
    }
}

#auth-container {
    justify-content: center;
    display: flex;
}
button {
    padding: 1em;
}
#auth-button {
    flex-grow: 1;
    max-width: 70%;
}

a:link,
a:visited {
    color: var(--blue);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

input[type="password"],
input[type="text"] {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 4px;
    padding-left: 6px;
    padding-right: 6px;
    padding-top: 8px;
    padding-bottom: 8px;
    flex-grow: 1;
    flex-shrink: 0;
    background: var(--inner-background);
    color: var(--text-color);
    border: 1px solid var(--gray-text-color);
}
input[type="password"]:focus,
input[type="text"]:focus {
    border: 1px solid var(--accent-color);
    outline: none;
}

#ficus-wrapper {
    align-items: center;
    justify-content: center;
    display: flex;
    min-width: 70%;
}

#ficus {
    width: 100%;
    max-width: 100%;
    @media (min-width: 768px) {
        max-width: 750px;
    }
}

.budget-chooser {
    list-style: none;
    padding: unset;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.budget-choice {
    width: 100%;
}

.new-budget-form {
    display: flex;
    flex-direction: column;
    row-gap: 10px;
}

.budget-frequency * {
    display: unset;
}

.flooter {
    /* center content */
    justify-content: center;
    display: flex;
    flex-direction: row;
    /* left and right makes it full width */
    left: 0px;
    right: 0px;
    /* float at bottom */
    position: fixed;
    bottom: 55px;
    margin-bottom: 10px;
}
.flooter > button {
    width: 75%;
}

main {
    margin: 8px;
}

/* Mobile nav (bottom nav) */
@media (max-width: 767px) {
    main {
        padding-bottom: var(--nav-height);
    }

    nav {
        background-color: var(--inner-background);
        position: fixed;
        bottom: 0;
        width: 100%;
        height: var(--nav-height);
    }

    nav > ul {
        list-style: none;
        display: flex;
        flex-direction: row;
        margin: 0;
        padding: 0;
        column-gap: 10px;
        justify-content: center;
    }

    nav > ul > li {
        padding-bottom: 12px;
        padding-top: 12px;
        flex-grow: 3;
        text-align: center;
        cursor: pointer;
    }

    nav > ul > li.selected {
        position: relative;
    }

    nav > ul > li.selected::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 2px;
        background-color: white;
    }

    nav > ul > li:first-child {
        padding-left: 10px;
    }

    nav > ul > li:last-child {
        padding-right: 10px;
    }
}

/* Desktop nav (sidebar) */
@media (min-width: 768px) {
    main {
        margin-left: calc(var(--sidebar-width) + 8px);
    }

    nav {
        background-color: var(--inner-background);
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: var(--sidebar-width);
    }

    nav > ul {
        list-style: none;
        display: flex;
        flex-direction: column;
        margin: 0;
        padding: 20px 0;
        row-gap: 10px;
    }

    nav > ul > li {
        padding: 12px 20px;
        text-align: left;
        cursor: pointer;
    }

    nav > ul > li.selected {
        position: relative;
    }

    nav > ul > li.selected::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 3px;
        height: 100%;
        background-color: white;
    }
}
body {
    margin: 0;
}

ficus-budget-bars {
    width: 100%;
    display: flex;
}
ficus-budget-bars > div {
    height: 0.3em;
    display: inline;
    flex-grow: 1;
}
ficus-budget-bars > .spent {
    background-color: var(--orange);
}
ficus-budget-bars > .target {
    background-color: var(--green);
}
ficus-budget-bars > .rollover {
    background-color: var(--yellow);
}

ficus-history-transaction {
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
}
ficus-history-transaction > div {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
}
ficus-history-transaction > div > span {
    flex-grow: 1;
}
ficus-history-transaction .money,
ficus-history-transaction .time {
    font-size: 150%;
}
ficus-history-transaction .money,
ficus-history-transaction .budget {
    text-align: right;
}
ficus-history-transaction .budget,
ficus-history-transaction .description {
    color: var(--gray-text-color);
}
