@import "styles.css";

/* Dashboard Section */
div.dashboard {
    display: grid;
    grid-template-columns: max-content auto;
    gap: 1em;
    margin: 2em auto;
    max-width: var(--pageWidth);
    align-items: start;
}

div.dashboard > div { 
    padding: 1.5em;
    border-radius: 8px;
    /* border: solid 1px rgba(0, 0, 0, 0.25); */
}

/* Dashboard Menu */
div.dashboard > div.dashboard-menu {
    background-color: var(--dimmed);
    min-width: 200px;
    position: relative;
}

div.dashboard > div.dashboard-menu > div.section-heading {
    text-transform: uppercase;
    font-weight: normal;
    font-size: medium;
    margin-bottom: 0.8em;
    padding: 0 0.2em;
}

div.dashboard > div.dashboard-menu > nav {
    display: flex;
    flex-direction: column;
    margin-bottom: 1em;
}

div.dashboard > div.dashboard-menu > nav.end {
    margin-bottom: 0;
}

div.dashboard > div.dashboard-menu > nav > button {
    max-width: max-content;
    font-weight: lighter;
    font-size: medium;
    cursor: pointer;
    border: none;
    color: black;
    background-color: transparent;
    text-align: left;
    padding: 0;
    margin: 0.5em 0.2em;
    position: relative;

    transition: all 0.125s ease-in-out;
}

div.dashboard > div.dashboard-menu > nav > button::before {
    content: "";
    position: absolute;
    height: 50%; width: 0%;
    bottom: 0; left: 0;
    background-color: var(--design);
    transform: rotate(-1deg);
    z-index: -1;
    transition: all 0.25s ease-in-out;
}

div.dashboard > div.dashboard-menu > nav > button:hover::before { width: 100%; }
div.dashboard > div.dashboard-menu > nav > button:focus::before  { width: 100%; }
div.dashboard > div.dashboard-menu > nav > button.active { font-weight: lighter; }
div.dashboard > div.dashboard-menu > nav > button.active::before { width: 100%; }

/* Collapse */
@media (min-width: 600px) {
    div.dashboard > div.dashboard-menu > div.collapse {
        display: none;
    }
}

@media (max-width: 600px) {
    div.dashboard > div.dashboard-menu.closed {
        max-height: 67.5px;
        overflow: hidden;
    }
}

div.dashboard > div.dashboard-menu > div.collapse {
    position: absolute;
    right: 0; top: 0;
    margin: 1em;
    aspect-ratio: 1/1;
    cursor: pointer;
}

div.dashboard > div.dashboard-menu > div.collapse img {
    padding: 0.2em;
    border-radius: 100px;
}

div.dashboard > div.dashboard-menu.closed > div.collapse img {
    transform: rotate(180deg);
}

div.dashboard > div.dashboard-menu > div.collapse img:hover {
    background-color: white;
}

/* Dashboard Pages */
div.dashboard > div.pages > div.dash-page {
    display: none;
}

/* Dashboard tags group */
div.tag-group {
    padding: 0.5em;
    border-radius: 8px;
    background-color: var(--dimmed);
    margin-top: 1em;
}

div.tag-group > a.tags {
    display: inline-block;
    padding: 0.5em 1em;
    margin: 0.25em 0.1em;
    background: white;
    border-radius: 100px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: black;
    font-size: small;
    font-weight: normal;
    text-decoration: none;
    transition: box-shadow 0.15s ease-in-out;
}

div.tag-group > a.tags.disabled:hover {
    cursor: default;
    box-shadow: none;
}

div.tag-group > a.tags:hover {
    box-shadow: 0 0.2em 0.5rem rgba(0, 0, 0, 0.15);
}

/* Other */
div.dash-page :is(h1, h2, h3, h4).remove-top {
    margin-block-start: 0;
}

div.gap-top { margin-top: 1.2em; }

/* Table */
table {
    border-collapse: collapse;
    width: 100%;
}

@media (max-width: 600px) {
    table {
        font-size: small;
    }

    table :is(tr, td) {
        padding: 0.33em;
    }
}

table progress { 
    width: 100%;
}

@keyframes loadprogress {
    100% { width: 100%; }
}

table progress[value] {
    appearance: none;
    background: var(--dimmed);
    border: none;
    border-radius: 8px;
}

table progress[value]::-webkit-progress-value {
    background: var(--design);
    border-radius: 12px;
}

table progress[value]::-moz-progress-bar {
    background: var(--design);
    border-radius: 12px;
}

table progress[value]::-webkit-progress-bar {
    border-radius: 12px;
    background: var(--dimmed);
}

table > thead {
    background-color: var(--dimmed);
}

table :is(tr, td) {
    border: #ccc solid 1px;
    padding: 1em;
}

table > :not(thead) td {
    font-weight: lighter;
}

/* Media - Responsiveness */
@media (max-width: 600px) {
    div.dashboard {
        display: block;
    }

    div.dashboard > div:nth-child(2) {
        margin-top: 1em;
    }
}