/* ==========================================================================
   ProudPost - Production Header Styles
   Optimized, Clean, Zero-Lag, Corporate Navigation
   ========================================================================== */

/* Body top padding offset for sticky TopBar (32px / 2rem desktop, 28px mobile) */
body {
    padding-top: 2rem !important;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    body {
        padding-top: 1.75rem !important;
    }
}

/* Sticky Top Bar */
#topBar {
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: 2rem;
    display: flex;
    align-items: center;
}

@media (max-width: 768px) {
    #topBar {
        height: 1.75rem;
    }
}

/* Header Container */
header {
    width: 100%;
    position: relative;
    z-index: 40;
}

header .container {
    padding-top: 0;
    padding-bottom: 0;
}

/* Nav Link Hover Underline Indicator */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #2563eb;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
}

.nav-link:hover::after {
    transform: translateX(0);
}

/* Shared Slide-Down Animation */
@keyframes headerSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-down {
    animation: headerSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Mobile Search Overlay Animation */
#mobileSearchOverlay:not(.hidden) {
    animation: headerSlideDown 0.2s ease-out;
}

/* Prevent body scroll when overlay/search is open */
body.search-open,
body.modal-open {
    overflow: hidden !important;
}

/* Categories Modal Animation */
#categoriesModal:not(.hidden) > div:last-child > div {
    animation: headerSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Categories Modal Scrollbar */
#categoriesModal .overflow-y-auto::-webkit-scrollbar {
    width: 5px;
}

#categoriesModal .overflow-y-auto::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.dark #categoriesModal .overflow-y-auto::-webkit-scrollbar-thumb {
    background: #334155;
}

/* Mobile Menu Overlay */
#mobileMenuOverlay {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#mobileMenuOverlay > div {
    max-height: 100vh;
    overflow-y: auto;
}

/* Keyframe for icon fade */
@keyframes fadeInIcon {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fade-in {
    animation: fadeInIcon 0.25s ease-out;
}