@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');
* {
    margin: 0;
    padding: 0;
}

html {
    font-family: Roboto, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5rem;
}

body {
    height: 100vh;
    height: 100dvh;
    background-color: var(--base-clr);
    color: var(--text-clr);
    transition: background-color 0.4s ease, color 0.4s ease;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: 65px 1fr;
    grid-template-areas: "sidebar header" "sidebar main";
}

header {
    width: 100%;
    border-bottom: 2px solid var(--line-clr);
    grid-area: header;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

header h1 {
    color: var(--text-clr);
    font-weight: 700;
}

header button {
    background: none;
    border-radius: 1em;
    border: 2px solid var(--line-clr);
    width: 500px;
    height: 35px;
    color: var(--text-clr);
    font-size: 1rem;
}

header .suchbox {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 350px;
    background-color: #ccc;
}

header div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header div svg {
    fill: var(--accent-clr);
    border-radius: 50%;
    border: 1px solid var(--line-clr);
    width: 35px;
    height: 35px;
}

header div h3 {
    color: var(--text-clr);
    font-weight: 500;
    padding-left: 1rem;
}

@media (max-width: 480px) {
    body {
        grid-template-columns: 1fr;
        grid-template-rows: 35px 1fr 60px;
        grid-template-areas: "header" "main" "sidebar";
    }
    header button {
        border: 1px solid var(--line-clr);
        width: 25%;
        height: 30px;
        font-size: 1rem;
    }
    header h1 {
        font-size: 1rem;
    }
    header div h3 {
        padding-left: 0.5rem;
    }
    header div svg {
        width: 25px;
        height: 25px;
    }
    .user-name {
        display: none;
    }
    li:nth-child(3) img {}
}


/* === Content === */

main {
    padding: min(30px, 7%);
    grid-area: main;
}


/* === Sidebar === */

#sidebar {
    box-sizing: border-box;
    height: 100vh;
    width: 350px;
    padding: 8px 1em;
    background-color: var(--base-clr);
    border-right: 2px solid var(--line-clr);
    position: sticky;
    top: 0;
    align-self: start;
    transition: 300ms ease-in-out;
    overflow: hidden;
    text-wrap: nowarp;
    grid-area: sidebar;
    color: var(--text-clr);
}

#sidebar.close {
    padding: 5px;
    width: 65px;
}

.link-text.close {
    display: none;
}

#sidebar ul {
    list-style: none;
}

#sidebar>ul>li:first-child {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
    .logo {
        font-weight: 600;
    }
}

#sidebar ul li.active a {
    color: var(--accent-clr);
    svg {
        fill: var(--accent-clr);
    }
}

#sidebar a,
#sidebar .dropdown-btn,
#sidebar .logo {
    border-radius: .5rem;
    padding: .85em;
    text-decoration: none;
    color: var(--text-clr);
    display: flex;
    gap: 1rem;
}

.dropdown-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
}

#sidebar a span,
#sidebar .dropdown-btn span {}

button,
a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-clr);
    font-size: clamp(1.1rem, 2vw, 1.4rem);
}

button span {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
}

.dropdown-btn,
.link-text {
    position: relative;
    padding-bottom: 4px;
    display: inline-block;
}

.dropdown-btn::before,
.dropdown-btn::after,
.link-text::before,
.link-text::after {
    content: "";
    position: absolute;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--accent-clr);
    transition: width 300ms ease-in;
}

.dropdown-btn::before,
.link-text::before {
    left: 50%;
}

.dropdown-btn::after,
.link-text::after {
    right: 50%;
}

button:hover .dropdown-btn::before,
button:hover .dropdown-btn::after,
a:hover .link-text::before,
a:hover .link-text::after {
    width: 50%;
}


/*
#sidebar a:hover,
#sidebar .dropdown-btn:hover {
    background-color: var(--hover-clr);
}
*/


/* == Icon == */

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24
}

.line {
    margin-top: 3rem;
    height: 2px;
    width: 100%;
    background-color: var(--accent-clr);
    border-radius: 999px;
}

#sidebar .sub-menu {
    display: grid;
    grid-template-rows: 0fr;
    transition: 300ms ease-in-out;
    >div {
        overflow: hidden;
    }
}

#sidebar .sub-menu.show {
    grid-template-rows: 1fr;
}

.dropdown-btn img {
    transition: 200ms ease;
}

.rotate img:last-child {
    rotate: 180deg;
}

#sidebar .sub-menu a {
    padding-left: 2em;
}

#toggle-btn {
    margin-left: auto;
    padding: 1em;
    border: none;
    border-radius: .5em;
    background: none;
    cursor: pointer;
}

#toggle-btn:hover {
    background-color: var(--hover-clr);
}

@media(max-width: 800px) {
    body {
        grid-template-columns: 1fr;
    }
    main {
        padding: 2em 1em 60px 1em;
    }
    .container {
        border: none;
        padding: 0;
        /*optinal*/
    }
    .line {
        display: none;
    }
    #sidebar {
        height: 60px;
        width: 100%;
        border-right: none;
        border-top: 1px solid var(--line-clr);
        padding: 0;
        position: fixed;
        top: unset;
        bottom: 0;
        >ul {
            padding: 0;
            display: grid;
            grid-auto-columns: 60px;
            grid-auto-flow: column;
            align-items: center;
            overflow-x: scroll;
        }
        ul li {
            height: 100%;
        }
        ul a,
        ul .dropdown-btn {
            width: 60px;
            height: 60px;
            padding: 0;
            border-radius: 0;
            justify-content: center;
        }
        ul li .link-text,
        ul li:first-child,
        .dropdown-btn svg:last-child,
        .sub-menu-icon {
            display: none;
        }
        ul li .sub-menu.show {
            position: fixed;
            bottom: 60px;
            left: 0;
            box-sizing: border-box;
            height: 60px;
            width: 100%;
            border-top: 1px solid var(--line-clr);
            display: flex;
            justify-content: center;
            >div {
                overflow-x: auto;
            }
            li {
                display: inline-flex;
            }
            a {
                box-sizing: border-box;
                padding: 1em;
                width: auto;
                justify-content: center;
            }
        }
    }
}

.theme-switch {
    width: 160px;
    height: 50px;
    background: #ccc;
    border: none;
    border-radius: 50px;
    position: relative;
    cursor: pointer;
}

.theme-switch span {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 44px;
    height: 44px;
    background: var(--accent-clr);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

body.darkmode .theme-switch {
    background: var(--base-clr);
}

body.darkmode .theme-switch span {
    transform: translateX(130px);
}