@import url(https://fonts.bunny.net/css?family=chewy:400|fredoka:400|fredoka-one:400|raleway:400);

:root {
    --font-size-default: 16px;
    --header-height: 80px;
    --subheader-height: 120px;
    --header-padding-sides: clamp(10px, (100% - 460px - 20px) * 0.5, 2rem); /* full - max - padding *2 */
    
    --logo-font: 'Chewy', display;
    --button-font: 'Fredoka One', display;
    --header-font: 'Fredoka', sans-serif;
    --content-font: 'Raleway', sans-serif;

    --white: #ffffff;

    --primary: #ff9671;
    --primary-100: #fff3ee;
    --primary-200: #ffd1be;
    --primary-300: #ffb99e;
    --primary-400: #f57d51;
    --primary-500: #e5784e;
    --primary-600: #b4472f;
    --primary-700: #a3624a;
    --primary-800: #503227;
    --primary-900: #1f1612;

    --secondary: #1f2f35;
    --secondary-300: #2e444d;
    --secondary-500: #13191b;

    --tertiary-1: #ff6f91;
    --tertiary-1-300: #ffb3c1;
    --tertiary-1-400: #e93c65; 
    --tertiary-1-500: #dc3b61;
    --tertiary-1-600: #bb274a;
    --tertiary-1-800: #e00328;
    --tertiary-1-900: #ad0b31;

    --tertiary-2: #ffc75f;
    --tertiary-2-100: #fff3dc;
    --tertiary-2-200: #ffe0a8;
    --tertiary-2-400: #ffd485;
    --tertiary-2-500: #e2b25c;
    --tertiary-2-600: #bd8113;

    --shaded-100: #ebe8e7;
    --shaded-200: #d7d1d2;
    --shaded-300: #b0a6a2;
    --shaded-400: #776862;
    --shaded-500: #54423b;
    --shaded-600: #322520;
    --shaded-700: #4f4846;
    --shaded-800: #2f2c2b;
    --shaded-900: #1f1e1d;

    --accent: #ab47bc;
    --accent-200: #e2bae5;
    --accent-200-focus: rgba(225, 185, 228, 0.8);
    --accent-300: #cc8dd4;
    --accent-500: #e048f4;
    --accent-700: #782386;
    --accent-700-focus: rgba(131, 57, 143, 0.8);

    --standard-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.25);
}

[data-theme='light'] {
    --text-color: var(--secondary);
    --background: var(--white); /* card-back, header-back, manage-back */
    --nav-back: var(--primary); /* + button */
    --main-back: var(--shaded-100);
    --link-col: var(--accent-700);
    --link-hover: var(--accent);
    --link-focus: var(--accent-700-focus);
    --logo-hover: var(--secondary-300);
    --nav-hover-back: var(--primary-100);
    --nav-hover-text: var(--accent);
    --searchbar-back: var(--shaded-100);
    --searchbar-focus: var(--primary);
    --button-hover: var(--primary-300);
    --button-hover-text: var(--secondary-300);
    --actions-col: var(--tertiary-1-400);
    --actions-hover-col: var(--tertiary-1-800);
    --chart-done: var(--tertiary-1-400);
    --chart-prog: var(--primary);
    --chart-todo: var(--tertiary-2-400);
    --task-num: var(--tertiary-1-900);
    --task-num-border: var(--tertiary-1);
    --task-delimeter: var(--shaded-200);
    --footer-back: var(--primary-300);

    --card-gradient:  var(--tertiary-1) 5%, var(--primary) 50%, var(--tertiary-2) 95%;

    --theme: 'light';
}

[data-theme='dark'] {
    --text-color: var(--primary-100);
    --background: var(--shaded-800); /* card-back, header-back, manage-back */
    --nav-back: var(--primary-600); /* + button */
    --main-back: var(--shaded-900);
    --link-col: var(--accent-300);
    --link-hover: var(--accent-200);
    --link-focus: var(--accent-200-focus);
    --logo-hover: var(--primary-300);
    --nav-hover-back: var(--shaded-600);
    --nav-hover-text: var(--accent-500);
    --searchbar-back: var(--shaded-700);
    --searchbar-focus: var(--primary-500);
    --button-hover: var(--primary-500);
    --button-hover-text: var(--secondary-300);
    --actions-col: var(--tertiary-1-400);
    --actions-hover-col: var(--tertiary-1);
    --chart-done: var(--tertiary-1-500);
    --chart-prog: var(--primary-500);
    --chart-todo: var(--tertiary-2-500);
    --task-num: var(--white);
    --task-num-border: var(--tertiary-1-300);
    --task-delimeter: var(--shaded-700);
    --footer-back: var(--shaded-700);

    --card-gradient:  var(--tertiary-1-600) 5%, var(--primary-600) 50%, var(--tertiary-2-600) 95%;

    --theme: 'dark';
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

*:focus-visible {
    transition: all 0.3s;
}

html {
    font-size: var(--font-size-default);
    font-family: var(--content-font);
}

body {
    background-color: var(--background);
    color: var(--text-color);
}

ul > li {
    list-style: none;
}

a {
    outline-width: 2px;
    outline-style: dotted;
    outline-color: transparent;
    color: var(--link-col);
}

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

a:focus-visible {
    box-shadow: 0px 0px 1px 2px var(--link-focus);
    border-radius: 2px;
}

svg {
    display: block;
    min-width: 1.5rem;
    max-width: 2.5rem;
    pointer-events: none;
}

h1, h2 {
    margin-bottom: 0;
    font-family: var(--header-font);
}

button {
    vertical-align: middle;
    transition: all 0.3s;
    outline-width: 2px;
    outline-style: dotted;
    outline-color: transparent;
    border: none;
    background-color: inherit;
    cursor: pointer;
    color: inherit;
}

button:focus-visible {
    box-shadow: 0 0 0 3px var(--link-focus);
}

button:active, 
button:active:not(:focus-visible) {
    transform: translate(1px, 3px);
}

.button {
    box-shadow: var(--standard-shadow);
    border-radius: 1.6rem;
    padding: 0.6rem;
    background-color: var(--nav-back);
    font-size: 1.4rem;
    font-family: var(--button-font);
}

.button:hover,
.button:focus-visible {
    background-color: var(--button-hover);
    color: var(--button-hover-text);
}

.button:focus:not(:focus-visible) {
    box-shadow: var(--standard-shadow);
}

.button:active, 
.button:active:not(:focus-visible) {
    box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.25);
}

.iconName-elem {
    display: flex;
    align-items: center;
}

.memberIcon {
    min-width: 40px;
    max-width: 60px;
}

.memberIcon > img {
    display: block;
    border-radius: 50%;
    width: 100%;
}

.card {
    box-shadow: 1px 4px 5px 3px rgba(0, 0, 0, 0.25);
    border-radius: 1rem;
    padding: 0.8rem;
    background-color: var(--background);
}

.cardFancy {
    transition: all 0.3s;
    margin: 0;
    padding: 0;
}

.cardFancy:hover {
    transform: scale(1.01) translateY(-2px);
}

.cardFancy > * {
    padding: 0 1.2rem;
}

.cardFancy > *:first-child {
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    background: -moz-linear-gradient(left, var(--card-gradient));
    background: -webkit-linear-gradient(left, var(--card-gradient));
    background: linear-gradient(to right, var(--card-gradient));
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-color: var(--nav-back);
}

.cardFancy > *:last-child {
    padding-bottom: 0.8rem;
}

div.mainContainer {
    display: grid;
    grid-template-columns: minmax(60px, max-content) 4fr 1fr;
    grid-template-rows: var(--header-height) 1fr auto;
    grid-template-areas:
        'logo   header header'
        'nav    main   main'
        'nav    footer footer';
}

.sideContainer {
    position: sticky;
    top: 0;
    z-index: 1;
    grid-row: 1 / -1;
    transition: max-width 0.4s ease-out;
    max-width: 60px;
    background-color: var(--nav-back);
}

.sideContainer:hover,
.sideContainer:focus-within {
    max-width: max(200px, 17vw);
}

.logo {
    position: sticky;
    top: 0;
    z-index: 2;
    grid-area: logo;
    display: flex;
    overflow: hidden;
    padding: 0.8rem 0.6rem 0.6rem 0.4rem;
    background-color: var(--nav-back);
    font-size: 1.7rem;
    line-height: 0.9;
    font-family: var(--logo-font);
    text-transform: uppercase;
    letter-spacing: 0.1rem;
}

.logo:hover {
    color: var(--logo-hover);
}

.logo a {
    gap: 0.4rem;
    text-decoration: none;
    color: inherit;
}

nav {
    position: sticky;
    top: var(--header-height);
    z-index: 1;
    grid-area: nav;
    background-color: var(--nav-back);
    font-size: 1.4rem;
    font-family: var(--button-font);
}

nav > div {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    overflow-y: auto;
    height: calc(100vh - var(--header-height) - 0.6rem);
}

nav svg {
    min-width: 40px;
    max-width: 40px;
}

nav a {
    gap: 0.6rem;
    overflow: hidden; 
    transition: all 0.2s;
    padding: 0.2rem 0;
    padding-left: calc(7% + 6px);
    text-decoration: none;
    color: inherit;
}

nav a:hover,
.selectedMenu {
    border-right: 6px solid var(--nav-hover-text);
    background-color: var(--nav-hover-back);
    color: var(--nav-hover-text);
}

nav a:focus-visible {
    box-shadow: inset 0px 0px 1px 2px var(--nav-hover-text);
    border-right: 6px solid var(--nav-hover-text);
    background-color: var(--nav-hover-back);
    color: var(--nav-hover-text);
}


.logOut {
    margin-top: auto;
}

header {
    position: sticky;
    z-index: 1;
    top: 0;
    grid-area: header;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    padding: 0 var(--header-padding-sides);
    padding-top: 0.6rem;
    padding-bottom: 0.4rem;
    background-color: var(--background);
}

header ul {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.searchBar {
    gap: 3px;
}

.searchBar svg {
    max-width: 1.8rem;
}

.searchBar input {
    outline-width: 2px;
    outline-style: dotted;
    outline-color: transparent;
    border: none;
    border-radius: 0.8rem;
    width: max(6rem, 100%);
    padding: 0.4rem;
    background-color: var(--searchbar-back);
    color: inherit;
}

.searchBar input:focus {
    box-shadow: 0 0 1px 3px var(--searchbar-focus);
}

#themeSwitch {
    border-radius: 4px;
    padding: 0.2rem;
}

.profile-notifications {
    margin-right: 2px;
    padding-left: 0.6rem;
}

.profile-profileLink svg {
    min-width: 1rem;
}

main {
    grid-area: main;
    display: grid;
    grid-template-columns: subgrid;
    grid-template-rows: var(--subheader-height) 4rem auto;
    grid-template-areas: 
        'manage   manage'
        'projects aside '
        'projects aside ';
    column-gap: min(1.4rem, 2%);
    padding-bottom: 1rem;
    background-color: var(--main-back);
}

section.manage {
    grid-area: manage;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    overflow: hidden;
    box-shadow: 0px 5px 6px 1px rgba(0, 0, 0, 0.25);
    padding: 0 var(--header-padding-sides);
    padding-top: 0.2rem;
    padding-bottom: 0.8rem;
    background-color: var(--background);
}

.manage > .iconName-elem {
    gap: 1rem;
}

.manage .memberIcon {
    max-width: calc(var(--subheader-height) - 1rem);
}

.manage-greeting {
    display: flex;
    flex-flow: column;
    gap: 0.4rem;
    font-size: 1rem;
    font-family: var(--header-font);
}

.manage-greeting > .userName-label {
    display: block;
    font-size: 1.6rem;
    font-weight: 600;
}

.manage-project {
    flex-basis: 32rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.manage-project > button {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.manage-project > button > svg {
    min-width: 1rem;
    max-width: 1.8rem;
}

section.projectsGrid {
    grid-area: projects;
    display: grid;
    grid-template-rows: subgrid;
    margin-left: 0.8rem;
}

.projectsGrid > div {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: minmax(200px, max-content);
    gap: 1.4rem;
}

.projectsGrid-projectCard {
    display: flex;
    flex-flow: column;
    gap: 0.8rem;
}

.projectsGrid-projectCard > p {
    margin-bottom: auto;
}

.projectActions {
    align-self: flex-end;
    display: flex;
    gap: 0.6rem;
}

.projectActions button {
    border-radius: 4px;
    width: 30px;
    color: var(--actions-col);
}

.projectActions button:hover,
.projectActions button:focus-visible {
    color: var(--actions-hover-col);
}

aside {
    grid-area: aside;
    display: flex;
    flex-flow: column;
    gap: 0.8rem;
    margin-right: 0.8rem;
}

aside h1 {
    margin-bottom: 0.3rem;
}

.statsInfo h1 {
    display: flex;
    align-items: flex-end;
    margin-top: 0.4rem;
    min-height: 3.3rem;
}

.doughnutChart {
    --percentage-done: 60;
    --percentage-prog: 30;
    --percentage-todo: 10;
    position: relative;
    margin-bottom: 0.8rem;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, var(--chart-done) calc(var(--percentage-done) * 1%),
        var(--chart-prog) 0 calc((var(--percentage-done) + var(--percentage-prog)) * 1%),
        var(--chart-todo) 0);
}

@supports (background: conic-gradient(black, white)) {
    .doughnutChart {
        border-radius: 50%;
        aspect-ratio: 1 / 1;
        background: conic-gradient(var(--chart-done) calc(var(--percentage-done) * 1%),
        var(--chart-prog) 0 calc((var(--percentage-done) + var(--percentage-prog)) * 1%),
        var(--chart-todo) 0);
    }
    
    .doughnutChart::before {
        content: "";
        position: absolute;
        left: 15%;
        top: 15%;
        display: inline-block;
        border-radius: 50%;
        height: 70%;
        width: 70%;
        background-color: var(--background);
    }
}

.doughnutChart > div {
    position: relative;
    display: flex;
    flex-flow: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding-top: 4px;
    line-height: 0.9;
}

.doughnutChart span {
    font-size: 2rem;
    font-family: var(--header-font);
    font-weight: 600;
}

.chart-key {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
}

.chart-key span {
    display: inline-block;
    vertical-align: middle;
    border: 1px solid var(--shaded-300);
    height: 1.8rem;
    padding: 0.2rem;
    padding-top: 0.3rem;
    font-weight: 700;
}

span.done {
    background-color: var(--chart-done);
}

span.inProgress {
    background-color: var(--chart-prog);
}

span.notStarted {
    background-color: var(--chart-todo);
}

.taskList ol {
    counter-reset: tl-counter;
    font-size: 1.2rem;
    list-style: none;
}

.taskList li::before {
    content: counter(tl-counter);
    flex-shrink: 0;
    margin-right: 0.6rem;
    border: 2px solid var(--task-num-border);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    font-size: 1.4rem;
    line-height: 1.25;
    font-family: var(--header-font);
    text-align: center;
    color: var(--task-num);
}

.taskList li:first-of-type:before {
    padding-left: 0.5rem;
    text-align: left;
}

.taskList li {
    counter-increment: tl-counter;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--task-delimeter);
    padding: 0.8rem 0;
}

.taskList li:last-of-type {
    border-bottom: none;
}

footer {
    grid-area: footer;
    padding: 4px;
    background-color: var(--footer-back);
    text-align: center;
}

.invisible {
    display: none;
}

