@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root {
    --base-clr: hsl(245, 100%, 7%);
    --line-clr: #42434a;
    --hover-clr: hsl(245, 100%, 30%);
    --text-clr: hsl(236, 0%, 85%);
    --accent-clr: #fafca4;
    --link-text-clr: #5c8cf3;
    --visited-clr: hsl(265, 91%, 75%)
}

h1, h2 {
    padding-bottom: 8px;
}

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

}

#sidebar {
    box-sizing: border-box;
    height: 100vh;
    width: 13rem;
    padding: 5px 1em;
    position: sticky;
    top: 0;
    align-self: flex-start;
    transition: 300ms ease-in-out;
    text-wrap: nowrap;
    border-right: 3px solid var(--line-clr);
}

#sidebar.close {
    padding: 5px;
    width: 60px;
    span {
        display: none;
    }
    #navbar:nth-child(10){
        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 a, #sidebar .dropdown-btn, #sidebar .logo {
  border-radius: .5em;
  padding: .85em;
  text-decoration: none;
  color: var(--text-clr);
  display: flex;
  align-items: center;
  gap: 1em;  
}

#sidebar svg{
    flex-shrink: 0;
    fill: var(--text-clr);
}

#sidebar a span, #sidebar .dropdown-btn span {
    flex-grow: 1;
}

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

#sidebar ul li.active a, button.active {
    border-radius: .5em;
    color: var(--accent-clr);
    border: 1px solid var(--accent-clr);

    svg {
        fill: var(--accent-clr);
    }
}

#sidebar span.active {
     color: var(--accent-clr);
}

#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;
}

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

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

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

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

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


main section, header {
    border-radius: 10px;
}
ol {
list-style-type: none;
}

main a {
/* color: hsl(192, 99%, 84%); */
color: var(--link-text-clr);
}


main a:visited {
 color: var(--visited-clr);
}

main li:hover, main a:hover {
    width: auto;
    background-color: var(--hover-clr);
    border-radius: 2px;

}

body {
min-height: 100vh;
min-height: 100dvh;
line-height: 1.5rem;
background-color: var(--base-clr);
color: var(--text-clr);
font-family: Open Sans, Arial, Courier New, sans-serif;
display: grid;
grid-template-areas: 
"sidebar main";
grid-template-columns: auto 1fr;

}

nav {
    grid-area: sidebar;
}

main {
    margin-top: 2vh;
    min-height: 100vh;
    grid-area: main;
    display: flex;
    flex-direction: column;
    justify-content: start;
    gap: 2vh;
    text-align: center;
}

section, header {
    width: 75vw;
    display: inline-block;
    justify-items: center;
    margin: 0 auto;
    padding: 1em;
    border: 3px solid var(--line-clr);
}


main > ul {
justify-items: center;
align-items: center;
display: inline;
list-style-position: inside;
padding-left: 50px; /* Optional: remove default padding for better centering */
}


@media(max-width: 800px) {li
    body{
        grid-template-columns: 1fr;
    }
    ol {
    list-style-type: none;
    }
    main{
        padding: 2em 1em 60px 1em;
    }
    .container {
        border: none;
        padding: 0;
    }

    #sidebar {
        height: 60px;
        width: 100%;
        border-right: none;
        border-top: 1 px 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 .sub-menu.show {
            position: fixed;
            bottom; 60px;
            left: 0;
            box-sizing: border-box;
            height: 60px;
            width: 100%;
            background-color: var(--hover-clr);
            border-top: 1 px 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;
            }
        }
    }
    ul li span, ul li:first-child, .dropdown-btn svg:last-child {
        display: none;
    }
}