@import './variables.css';
@import './navigator.css';

#divLogo.logo {
    margin-left: 1rem;
    margin-right: auto;
}

/* hide some elements in desktop-mode: */
input[name=optDropdown],
#inpSidebar,
#inpSearch,
.page-title,
.sidebar-open, 
.sidebar-close {
    display: none;
}

#lblSidebarClose {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* only when there is no searchfield inside the label! */
}

#lblSidebarClose input#inpSearch {
    width: 16rem;
    height: var(--icon-size);
    padding-left: var(--icon-size);
    outline: 1px solid whitesmoke;
    border: none;
    background-color: transparent;
    color: var(--menu-color);
}

#imgSearch {
    position: absolute;
    height: calc(var(--icon-size) * 0.75);
    width: calc(var(--icon-size) * 0.75);
    margin-left: 0.25rem;
}

nav.navbar {
    height: var(--navbar-height);
    background-color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: var(--menu-color);
}

nav.navbar-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--navbar-bottom-height);
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.5rem 1.25rem;
    border-top: 1px solid  var(--theme-color);
    z-index: 1000;
}

div.button-bar {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.sidebar {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.dropdown-mnu {
    width: 100%;
    display: none;
}

.menu-item {
    height: 100%;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 1.25rem;
    color: var(--menu-color);
}

.extendable {
    display: inline-block;
    padding: 0 !important;
    font-weight: normal;
}

.menu-item a {
    color: inherit;
    text-decoration: none;
}

.menu-item:hover {
    background-color: var(--hover-color);
    color: var(--darker-background-color);
    filter: brightness(1.25);
}

.sub {
    background-color: var(--darker-background-color);
    border-bottom: 1px solid var(--accent-color);
}

.sidebar .home-link {
    margin-right: auto;
}

nav.navbar img, nav.navbar svg {
    display: none;
    fill: var(--menu-color);
}

img.menu-icon {
    height: var(--icon-size);
    width: var(--icon-size);
}

.mobile {
    display: none;
}

/* ##################################################################################### */
/* ###                                                                               ### */
/* ##################################################################################### */
@media (max-width: 450px) and (orientation: portrait) {
    nav.navbar img, nav.navbar svg, .page-title, #inpSearch {
        display: block;
    }

    nav.navbar {
        justify-content: space-between;
    }

    #divLogo.logo {
        margin-right: unset;
    }

    .page-title {
        margin: 0 auto;
    }

    .sidebar {
        flex-direction: column;
        align-items: flex-start;
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%; /* 85%; */
        z-index: var(--sidebar-z-index);
        background-color: var(--bg-color);
        box-shadow: -6px 0 6px rgba(0,0,0,0.25);
        transition: right 450ms cubic-bezier(0.42, 0, 0.15, 1.33);
    }

    /* @keyframes bounceInRight {
        from, 60%, 75%, 90%, to {
            animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); 
        }      
        from {
            opacity: 0;
            transform: translate3d(3000px, 0, 0); 
        }      
        60% {
            opacity: 1;
            transform: translate3d(-25px, 0, 0); 
        }      
        75% { transform: translate3d(10px, 0, 0); }      
        90% { transform: translate3d(-5px, 0, 0); }      
        to { transform: none; }
    } */
      
    /* .bounceInRight {
        animation-name: bounceInRight;
    } */

    #inpSidebar:checked ~ .sidebar {
        right: 0;
        /* animation-name: bounceInRight; */
    }

    #inpSidebar:checked ~ #lblOverlay {
        background-color: rgba(0, 0, 0, 0.2);
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 100%;
        z-index: calc(var(--sidebar-z-index) - 1);
    }

    .extendable input[type=radio]:checked ~ .dropdown-mnu {
        display: block;
    }

    .extendable input[type=radio]:checked ~ label > img {
        filter: brightness(0.4);
    }

    .menu-item {
        height: auto;
        width: 100%;
        padding: 0.85rem 1.5rem;
    }

    .mobile {
        display: flex;
    }

    .desktop {
        display: none !important;
    }

    .sidebar-open, 
    .sidebar-close {
        display: block;
        padding: 1rem;
    }

    .sidebar-close {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }
}

@media screen and (min-width: 450px) and (max-width: 860px) and (orientation: landscape) {
    nav.navbar {
        width: 100vh;
        justify-content: space-between;
    }

    .page-title {
        margin-right: auto;
    }

    nav.navbar img, nav.navbar svg, .page-title, #inpSearch {
        display: block;
    }
    
    .sidebar {
        flex-direction: column;
        background-color: var(--bg-color);
        z-index: var(--sidebar-z-index);
        position: absolute;
        right: -100%;
        top: var(--navbar-height);
        height: unset;
        width: 80%;
    }

    #inpSidebar:checked ~ .sidebar {
        right: 0;
        /* animation-name: bounceInRight; */
    }

    .sidebar-open, 
    .sidebar-close {
        display: block;
        padding: 1rem;
    }

    .menu-item {
        width: 100%;
        padding: 1.25rem;
    }

    .menu-item.desktop {
        display: none !important;
    }

    .menu-item.mobile {
        display: flex;
    }

    .homescreen-tile {
        max-width: var(--tile-size-landscape);
        max-height: var(--tile-size-landscape);
    }
}