/*IMPORT FONTS FOR THE PAGE*/
@import url('https://fonts.googleapis.com/css2?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');
/* Define CSS variables for colors */
:root
{

    /*LIGHT MODE COLOR PALETTE*/
    --hover-color: #eaeaea;
    --active-color: #419133;
    --background-color: #eaeaea;
    --text-color: #000000;
    --sidebar-color: #eaeaea;
    --border-color: #000000;
    --shadow-color: #ffffff;
    --icon-color: #000000;

    /*FONT*/
    --font-family: "Poppins", "Segoe UI";
}

.darkmode
{
    /*DARK MODE COLOR PALETTE*/
    --hover-color: #0e2f44;
    --active-color: #2dfe54;
    --background-color: #0e2f44;
    --text-color: #fff;
    --sidebar-color: #0e2f44;
    --border-color: #3e5869;
    --shadow-color: #1a3f4a;
    --icon-color: #ffffff;
}

*
{
    margin: 0;
    padding: 0;
}

html
{
    font-family: var(--font-family);
    line-height: 1.5rem;
}

body
{
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--background-color);
    color: var(--text-color);
    display: grid;
    grid-template-columns: auto 1fr;
}

#sidebar
{
    box-sizing: border-box;
    height: 100vh;
    width: 250px;
    padding: 5px 1em;
    background-color: var(--sidebar-color);
    border-right: 1px solid var(--border-color);

    position: sticky;
    top: 0;
    align-self: start;
    transition: 300ms ease-in-out;
    overflow: hidden;
    text-wrap: nowrap;
}

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

#sidebar ul
{
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1em;
}

#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(--active-color);
    svg
    {
        fill: var(--active-color);
    }
}

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

.dropdown-button
{
    width: 100%;
    text-align: left;
    background: none;
    background-color: var(--sidebar-color);
    border: none;
    font: inherit;
    cursor: pointer;
}

#sidebar svg{
    flex-shrink: 0;
    fill: var(--icon-color);
}

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

}

#sidebar a:hover, #sidebar .dropdown-button:hover
{
    background-color: var(--hover-color);
    box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.25),
                -2px -2px 2px var(--shadow-color);
}

#sidebar .submenu
{
    display: none;
    grid-template-rows: 0fr;
    transition: 300ms ease-in-out;
}

#sidebar .submenu a:hover
{
    background-color: var(--hover-color);
    box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.25),
                -2px -2px 2px var(--shadow-color);
}

#sidebar .submenu.show
{
    display: grid;
    grid-template-rows: 1fr;
}

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

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

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

#toggle-button
{
    margin-left: auto;
    padding: 13.3px;
    border: none;
    border-radius: .5em;
    background: none;
    cursor: pointer;

    svg
    {
        transition: rotate 150ms ease;
    }
}

#toggle-button:hover
{
    background-color: var(--hover-color);
    box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.25),
                -2px -2px 2px var(--shadow-color);
}

.content
{
    padding: 1em 1em 60px 1em;
    background-color: var(--background-color);
    display: flex;
    flex-wrap: wrap;
    width: auto;
    height: auto;
    margin: 0;
    gap: 2rem;
}

.content .item
{
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: auto;

    width: 32%;
    min-width: 640px;

    border-radius: .5rem;
}

.item img
{
    width: 100%;
    height: 100%;
    border-radius: .5rem;

    lighting-color: darkgray;
}

.content .item img:hover
{
    box-shadow: 12px 12px 20px rgba(0, 0, 0, 0.25),
                -10px -10px 10px var(--shadow-color);
}

#theme-switch
{
    padding: 1em;
    border-radius: .5em;
    background-color: var(--sidebar-color);
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    bottom: 10px;
    margin-left: auto;
    border-style: none;
    box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.25),
                -2px -2px 2px var(--shadow-color);
}

#theme-switch:hover
{
    background-color: var(--hover-color);
    cursor: pointer;
}

#theme-switch svg
{
    width: 24px;
    height: 24px;
    fill: var(--icon-color);
    transition: fill 200ms ease;
}

#theme-switch svg:last-child
{
    display: none;
}

.darkmode #theme-switch svg:first-child
{
    display: none;
}

.darkmode #theme-switch svg:last-child
{
    display: block;
}

@media (max-width: 768px)
{
    body
    {
        grid-template-columns: 1fr;
    }
    
    .content
    {
        padding: unset;
        padding-top: 1rem;
        padding-bottom: 76px;
        width: 100vw;
        height: 100%;
        margin: 0;
        justify-content: center;
    }

    .content .item
    {
        width: 90vw;
        min-width: unset;
        min-width: 100px;
        max-width: 90vw;
    }

    #sidebar ul
    {
        flex-direction: row;
        gap: 1em;
        margin-left: 10px;
    }

    #sidebar
    {
        position: fixed;
        width: 100%;
        height: 60px;
        border-right: none;
        border-top: 1px solid var(--border-color);
        padding: 0;
        top: unset;
        bottom: 0;
    
        > ul
        {
            height: 60px;
            padding: 0;
            display: flex;
            flex-wrap: nowrap;
            justify-content: flex-start;
            align-items: center;
            overflow-x: scroll;
            gap: .5em;
        }

        ul li
        {
            height: 100%;
            margin-bottom: unset;
        }

        ul a, ul .dropdown-button
        {
            height: 40px;
            width: 40px;
            padding: 0;
            margin-top: 10px;
            border-radius: 5px;
            justify-content: center;
        }

        ul li .submenu.show
        {
            position: fixed;
            bottom:60px;
            left: 0;
            box-sizing: border-box;
            height: 60px;
            width: 100%;
            background-color: var(--sidebar-color);
            display: flex;
            gap: 1em;
            justify-content: center;
            align-items: center;

            li
            {
                display: flex;
                flex-wrap: nowrap;
                align-items: center;
                justify-content: center;
                margin-bottom: 10px;
            }

            a
            {
                width: auto;
                padding-left: 10px;
                padding-right: 10px;
                

            }
        }


    }

    #sidebar.close
    {
        width: 100%;
        height: 60px;
        border-top: 1px solid var(--border-color);
        padding: 0;
    }
    
    ul li span, #sidebar > ul li:first-child, .dropdown-button svg:last-child
    {
        display: none;
    }

    #theme-switch
    {
        left: unset;

        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 5px;
        background-color: var(--sidebar-color);
        display: flex;
        justify-content: center;
        align-items: center;
        position: fixed;
        bottom: 10px;
        right: 10px;
        border-style: none;
    }
}
