/* Sticky header fixes */
#sticky-header {
    position: fixed;
    left: 0;
    margin: auto;
    top: 0;
    width: 100%;
    z-index: 99; /* Lower than sidebar */
    transition: all 0.3s ease;
    background: transparent;
}

/* Menu wrap should always have its background */
#sticky-header .menu-wrap {
    background: var(--header-background-color);
    box-shadow: 0 10px 15px rgba(25, 25, 25, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
    margin: 7px 9px;
    padding: 0 25px;
}

/* Dark mode for menu wrap */
.dark-mode #sticky-header .menu-wrap {
    background: var(--header-background-color);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

/* Dark mode floating border fix */
.dark-mode .menu-wrap::before {
    border-color: var(--header-border-color);
    border-width: 1px;
    opacity: 1;
}

/* Outer container only shows on scroll */
.menu-area {
    margin-top: 30px;
    margin-bottom: -130px;
    background: transparent;
    transition: all 0.3s ease;
    z-index: 99;
}

/* Add outer container background only when scrolled */
#sticky-header.sticky-menu {
    background: var(--header-background-color);
    animation: 300ms ease-in-out 0s normal none 1 running fadeInDown;
}

/* Show/hide based on user login state and screen size */
@media (min-width: 992px) {
    body:not(.user-logged-in) #sticky-header.sticky-menu {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

@media (max-width: 991.98px) {
    body.user-logged-in #sticky-header.sticky-menu {
        display: none !important;
    }
}

/* Dark mode support */
.dark-mode #sticky-header.sticky-menu {
    background: var(--header-background-color);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

/* Animation */
@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
