:root {
    --boxwidth: 11vw;
    --logo-boxwidth: 12vw;
}

body {
    padding: 0;
    margin: 0;
}

nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99;

    background-color: #02090e;
    width: 100vw;
    height: 2.5vw;
    padding: 0;
    margin: 0;
    font-family: 'Blender-Pro-Book';
}

nav .menu-main-container {
    display: inline;
}

nav>a,
nav .menu-main-container>a,
.dropdown {
    display: block;
    background-color: #00000020;
    float: left;
    height: 100%;
    width: var(--boxwidth);
    text-decoration: none;
    color: #fff;
    font-size: 0.8rem;
    /* 讓它不要被浮動箱子擋住 */
    position: relative;
    z-index: 1;
}

nav>a {
    width: var(--logo-boxwidth);
}


nav .menu-main-container>a {
    display: flex;
    justify-content: center;
    align-items: center;
}

nav .menu-main-container>a:hover {
    color: #fff;
}

.anchor-center {
    color: #fff;
}

.dropbtn {
    /* background-color: inherit; */
    background-color: rgba(0, 0, 0, 0%);
    color: inherit;
    font-family: inherit;
    font-size: inherit;

    border: none;
    outline: none;
    width: 100%;
    height: 100%;
}

.dropdown-content {
    position: absolute;
    top: 2.5vw;
    display: none;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content>a {
    display: block;
    line-height: 2.5vw;

    font-size: inherit;
    text-decoration: none;
    font-family: inherit;
    color: #000;
    background-color: grey;
    width: var(--boxwidth);

    box-sizing: border-box;
    padding: 0 10px;
}

.dropdown-content>a:hover {
    color: #000;
}

.dropdown-content>a:hover {
    background-color: white;
}

/* animation box */
nav .animation {
    position: absolute;
    height: 100%;
    top: 0;
    background: #24BFA3;
    opacity: 50%;
    border: 0px solid black;
    box-sizing: border-box;
    transition: all .8s ease-in-out 0s;
}

nav .start-home {
    width: 0;
    left: 0;
}

nav .menu-main-container>.dropdown:hover~.animation,
nav .menu-main-container>a:hover~.animation {
    width: var(--boxwidth);
}

nav a:first-child:hover~.animation {
    width: var(--boxwidth);
    left: 0;
}

/* 每個位置 */
nav .menu-main-container>a:nth-child(1):hover~.animation {
    left: var(--logo-boxwidth);
}

nav .menu-main-container>.dropdown:nth-child(2):hover~.animation {
    left: calc(var(--logo-boxwidth) + var(--boxwidth));
}

nav .menu-main-container>.dropdown:nth-child(3):hover~.animation {
    left: calc(var(--logo-boxwidth) + var(--boxwidth)*2);
}

nav .menu-main-container>a:nth-child(4):hover~.animation {
    left: calc(var(--logo-boxwidth) + var(--boxwidth)*3);
}

nav .menu-main-container>.dropdown:nth-child(5):hover~.animation {
    left: calc(var(--logo-boxwidth) + var(--boxwidth)*4);
}

nav .menu-main-container>.dropdown:nth-child(6):hover~.animation {
    left: calc(var(--logo-boxwidth) + var(--boxwidth)*5);
}

nav .menu-main-container>a:nth-child(7):hover~.animation {
    left: calc(var(--logo-boxwidth) + var(--boxwidth)*6);
}

nav .menu-main-container>a:nth-child(8):hover~.animation {
    left: calc(var(--logo-boxwidth) + var(--boxwidth)*7);
}

/* logo iamge */
#logo {
    margin-left: 10px;
    height: 100%;
    width: 2.5vw;
    color: #fff;
    background-image: url("https://static.igem.wiki/teams/4377/wiki/common/logo.svg");
    background-size: cover;
}

#navBtn {
    display: none;
    padding: 0.25rem 0.75rem;
    font-size: 1.25rem;
    line-height: 1;
    color: rgba(255, 255, 255, .5);
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 0.25rem;
    margin-right: 1.5rem;
    height: 3rem;
}

#navBtn .navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    content: "";
    background: no-repeat center center;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

@media screen and (max-width: 480px) {
    nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 5rem;
    }

    nav .animation {
        display: none;
    }

    nav button {
        text-align: left;
    }

    nav * {
        font-size: 1rem !important;
        background-color: #02090e !important;
        /* #02090e */
    }

    .dropdown-content {
        position: unset;
        width: 100%;
    }

    .dropdown-content>a {
        background-color: grey !important;
        width: 90%;
        line-height: unset;
    }

    nav>a:nth-child(1) {
        width: 25vw;
        display: flex;
        align-items: center;
    }

    nav .menu-main-container {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-left: unset;
        position: absolute;
        top: 5rem;
        background: gray;
    }

    nav .menu-main-container a {
        text-decoration: none;
    }

    nav .menu-main-container>a,
    nav .menu-main-container>div {
        width: 100%;
        padding-left: 1rem;
        line-height: 2;
        border-bottom: 2px solid white;
        justify-content: left;
    }

    nav>a:last-of-type,
    nav .menu-main-container>a:last-of-type {
        border-bottom: unset;
    }


    #logo {
        height: 80%;
        width: 80%;
        background-size: contain;
        background-repeat: no-repeat;
    }

    #navBtn {
        display: unset;
    }
}
