.top-nav {
    @apply z-50 relative;
    @include media-breakpoint-down(md) {
        @apply hidden;
    }
    > ul {
        @for $i from 1 through 50 {
            > li:nth-child(#{$i}) {
                & > a {
                    &:not(.top-menu--active) {
                        @apply opacity-0;
                        transform: translateY(50px);
                        animation: 0.4s
                            intro-menu-animation
                            ease-in-out
                            0.33333s;
                        animation-fill-mode: forwards;
                        animation-delay: #{$i * 0.1}s;
                    }
                    &.top-menu--active {
                        animation: 0.4s
                            intro-active-menu-animation
                            ease-in-out
                            0.33333s;
                        animation-fill-mode: forwards;
                    }
                }
            }
        }
        padding: 0px 50px;
        @apply flex flex-wrap;
        @include media-breakpoint-down(xl) {
            @apply px-6;
        }
        li {
            @apply relative;
            &:hover {
                > .top-menu > .top-menu__title > .top-menu__sub-icon {
                    @apply rotate-180;
                }
                > ul {
                    @apply block;
                    li:hover
                        .top-menu
                        > .top-menu__title
                        > .top-menu__sub-icon {
                        @apply -rotate-90;
                    }
                }
            }
            .top-menu {
                height: 55px;
                border-radius: 10px;
                @apply flex items-center px-5 mr-1 text-theme-2 relative;
                @include media-breakpoint-down(xl) {
                    @apply rounded-full;
                }
                &.top-menu--active {
                    @apply bg-theme-24 dark:bg-dark-1;
                    .top-menu__icon {
                        @apply text-white dark:text-white;
                        &:before {
                            @apply bg-dark-1;
                        }
                    }
                    .top-menu__title {
                        @apply text-white font-medium dark:text-white;
                    }
                }
                .top-menu__icon {
                    @apply dark:text-gray-500;
                }
                .top-menu__title {
                    @apply dark:text-gray-500;
                }
                .top-menu__title {
                    @apply ml-3 flex items-center whitespace-nowrap;
                    .top-menu__sub-icon {
                        @apply transition ease-in duration-100 w-4 h-4 ml-2;
                        @include media-breakpoint-down(xl) {
                            @apply hidden;
                        }
                    }
                }
            }
            ul {
                box-shadow: 0px 3px 20px #0000000b;
                @apply bg-theme-6 hidden w-56 absolute rounded-md z-20 px-0 mt-1;
                &:before {
                    content: "";
                    @apply w-full h-1 absolute top-0 left-0 -mt-1 cursor-pointer;
                }
                li {
                    @apply px-5 relative;
                    .top-menu {
                        @apply px-0 mr-0;
                        .top-menu__icon:before {
                            @apply hidden;
                        }
                        .top-menu__title {
                            @apply w-full;
                            .top-menu__sub-icon {
                                @apply ml-auto;
                            }
                        }
                    }
                }
                ul {
                    left: 100%;
                    @apply bg-theme-6 hidden rounded-md mt-0 ml-0 top-0;
                }
            }
        }
        > li:hover > .top-menu:not(.top-menu--active) {
            @apply bg-theme-6 dark:bg-dark-1;
        }
    }
}

@keyframes intro-top-menu-animation {
    100% {
        @apply opacity-100;
        transform: translateY(0px);
    }
}

@keyframes intro-active-top-menu-animation {
    100% {
        @apply z-10;
    }
}

.dark {
    .top-nav {
        > ul {
            li {
                ul {
                    background: #181f29e6;
                }
            }
        }
    }
}
