/* ===============================================
   NETFLIX-STYLE NAVIGATION BAR
   Modern Pill-Style Design with Dark Background
   =============================================== */

/* Wrapper - Sticky with dark background */
.category-nav-wrapper {
    position: -webkit-sticky;
    position: sticky;
    top: 56px; /* Matches header height */
    left: 0;
    right: 0;
    width: 100%;
    z-index: 900;
    background: #141414;  /* Netflix dark background */
    padding: 8px 0 4px;
    margin-bottom: clamp(4px, 1vw, 12px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    overflow: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-sizing: border-box;
    display: flex;
    align-items: center;

}

/* Hide scrollbar but keep functionality */
.category-nav-wrapper::-webkit-scrollbar {
    display: none;
    height: 0;
    width: 0;
}

/* Main navigation container */
.category-nav {
    display: inline-flex;
    align-items: center;
    gap: 12px;  /* Space between pills */
    padding: 0 20px;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-dark-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
}

.category-dark-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.category-dark-toggle:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 3px;
}

/* Individual pill items - Netflix style */
.category-nav-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    min-height: 36px;
    flex-shrink: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-transform: capitalize;  /* Changed from uppercase */
    letter-spacing: 0.3px;
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.1);  /* Semi-transparent pills */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;  /* Full pill shape */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Remove old borders */
.category-nav-item:first-child,
.category-nav-item:last-child {
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Hover effect - Lighter background */
.category-nav-item:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    transform: translateY(0);  /* No vertical movement */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Active/Selected state - White pill */
.category-nav-item.active {
    background: #ffffff;
    color: #000000;
    font-weight: 600;
    border-color: #ffffff;
    box-shadow: 0 2px 12px rgba(255, 255, 255, 0.3);
    transform: translateY(0);
}

/* Remove old active effects */
.category-nav-item.active::before,
.category-nav-item.active::after {
    display: none;
}

/* Icon styling - Simpler approach */
.category-nav-item > *:first-child {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.category-nav-item:hover > *:first-child {
    transform: scale(1.1);
}

.category-nav-item.active > *:first-child {
    transform: scale(1.05);
}

/* Focus state for accessibility */
.category-nav-item:focus {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

/* Section Highlight Blink Animation */
.section-highlight-blink {
    animation: highlightBlink 2s ease-in-out;
    position: relative;
}

@keyframes highlightBlink {
    0%, 100% {
        background-color: transparent;
        box-shadow: none;
    }
    25% {
        background-color: rgba(255, 215, 0, 0.3);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
        transform: scale(1.01);
    }
    50% {
        background-color: rgba(255, 215, 0, 0.15);
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    }
    75% {
        background-color: rgba(255, 215, 0, 0.3);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
        transform: scale(1.01);
    }
}

/* Dark mode highlight */
body.dark-mode .section-highlight-blink {
    animation: highlightBlinkDark 2s ease-in-out;
}

@keyframes highlightBlinkDark {
    0%, 100% {
        background-color: transparent;
        box-shadow: none;
    }
    25% {
        background-color: rgba(255, 215, 0, 0.2);
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.4);
        transform: scale(1.01);
    }
    50% {
        background-color: rgba(255, 215, 0, 0.1);
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
    }
    75% {
        background-color: rgba(255, 215, 0, 0.2);
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.4);
        transform: scale(1.01);
    }
}

/* ===============================================
   LIGHT MODE VARIANT (if needed)
   =============================================== */

body:not(.dark-mode) .category-nav-wrapper {
    background: #f5f5f5;  /* Light gray background */
}

body:not(.dark-mode) .category-nav-item {
    color: #333333;
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body:not(.dark-mode) .category-dark-toggle {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.12);
}

body:not(.dark-mode) .category-dark-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.25);
}

body:not(.dark-mode) .category-nav-item:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
    color: #000000;
}

body:not(.dark-mode) .category-nav-item.active {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* ===============================================
   DARK MODE (Your existing dark mode)
   =============================================== */

body.dark-mode .category-nav-wrapper {
    background: #141414;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

body.dark-mode .category-nav {
    background: transparent;
    border: none;
    box-shadow: none;
}

body.dark-mode .category-nav-item {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

body.dark-mode .category-nav-item:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark-mode .category-nav-item.active {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
    box-shadow: 0 2px 12px rgba(255, 255, 255, 0.3);
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

/* Tablet */
@media (max-width: 1024px) {
    .category-nav-wrapper {
        top: 56px;
        padding: 12px clamp(8px, 2vw, 16px);
    }

    .category-nav {
        padding: 0 16px;
    }
   
    .category-nav {
        gap: 10px;
    }
   
    .category-nav-item {
        padding: 7px 18px;
        font-size: 13px;
        min-height: 36px;
    }
   
    .category-nav-item > *:first-child {
        font-size: 15px;
    }
}
/* Mobile */
@media (max-width: 768px) {
    .category-nav-wrapper {
        position: sticky;
        top: 56px; /* Matches mobile header height */
        padding: 10px 12px;
        z-index: 900;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .category-nav-track {
        width: 100%;
    }

    .category-nav {
        padding: 0 12px;
    }
    
    /* Hide gradients and arrows on mobile */
    .nav-gradient-left,
    .nav-gradient-right,
    .nav-arrow {
        display: none;
    }

    .category-nav {
        gap: 8px;
    }

    .category-nav-item {
        padding: 6px 16px;
        font-size: 12px;
        min-height: 34px;
        flex-shrink: 0;
    }
    
    .category-nav-item > *:first-child {
        font-size: 14px;
    }
    .category-dark-toggle {
        align-self: flex-end;
    }
}



/* Small mobile */
@media (max-width: 480px) {
    .category-nav-wrapper {
        top: 50px; /* Matches small mobile header height */
        padding: 8px 10px;
    }

    .category-nav {
        padding: 0 8px;
    }
   
    .category-nav {
        gap: 6px;
    }
   
    .category-nav-item {
        padding: 6px 14px;
        font-size: 11px;
        border-radius: 20px;
        min-height: 32px;
    }
   
    .category-nav-item > *:first-child {
        font-size: 13px;
    }

    .category-dark-toggle {
        width: 100%;
        justify-content: center;
    }
}

/* ===============================================
   ACCESSIBILITY
   =============================================== */

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .category-nav-item,
    .category-nav-wrapper,
    .category-nav-item > *:first-child {
        transition: none;
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .category-nav-item {
        border-width: 2px;
    }
   
    .category-nav-item.active {
        outline: 3px solid currentColor;
        outline-offset: 2px;
    }
}

/* Focus visible */
.category-nav-item:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.8);
    outline-offset: 3px;
}

/* ===============================================
   NAVIGATION ARROWS WITH GRADIENT FADE
   =============================================== */

/* Gradient fade overlays */
.nav-gradient-left,
.nav-gradient-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.nav-gradient-left {
    left: 0;
    background: linear-gradient(to right, #141414 0%, rgba(20, 20, 20, 0.8) 50%, transparent 100%);
}

.nav-gradient-right {
    right: 0;
    background: linear-gradient(to left, #141414 0%, rgba(20, 20, 20, 0.8) 50%, transparent 100%);
}

/* Light mode gradients */
body:not(.dark-mode) .nav-gradient-left {
    background: linear-gradient(to right, #f5f5f5 0%, rgba(245, 245, 245, 0.8) 50%, transparent 100%);
}

body:not(.dark-mode) .nav-gradient-right {
    background: linear-gradient(to left, #f5f5f5 0%, rgba(245, 245, 245, 0.8) 50%, transparent 100%);
}

/* Navigation arrow buttons */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(20, 20, 20, 0.95);
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
}

.nav-arrow:hover {
    background: rgba(40, 40, 40, 0.95);
    transform: translateY(-50%) scale(1.05);
}

.nav-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.nav-arrow.disabled {
    opacity: 0;
    pointer-events: none;
}

.nav-arrow-prev {
    left: 8px;
}

.nav-arrow-next {
    right: 8px;
}

.nav-arrow svg {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
    stroke-width: 2.5;
    fill: none;
}

/* Light mode arrows */
body:not(.dark-mode) .nav-arrow {
    background: rgba(245, 245, 245, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

body:not(.dark-mode) .nav-arrow:hover {
    background: rgba(230, 230, 230, 0.95);
}

body:not(.dark-mode) .nav-arrow svg {
    stroke: #000000;
}

/* Show arrows on desktop */
@media (min-width: 1025px) {
    .nav-arrow {
        display: flex;
    }
}

/* ===============================================
   SCROLL SNAP (Optional smooth scrolling)
   =============================================== */

.category-nav-wrapper {
    scroll-snap-type: x proximity;
}

.category-nav-item {
    scroll-snap-align: start;
}

/* ===============================================
   LOADING STATE
   =============================================== */

.category-nav.loading {
    position: relative;
    min-height: 40px;
    opacity: 0.5;
}

.category-nav:empty {
    min-height: 0;
    display: none;
}

/* ===============================================
   PRINT STYLES
   =============================================== */

@media print {
    .category-nav-wrapper {
        display: none;
    }
}

/* ===============================================
   FOLLOW TOGGLE STAR
   =============================================== */
.follow-toggle {
    margin-left: 8px;
    cursor: pointer;
    opacity: 0.6;
    font-size: 14px;
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
    display: inline-block;
}

.follow-toggle:hover {
    opacity: 1;
    transform: scale(1.2);
    color: gold;
}

.category-nav-item:hover .follow-toggle {
    opacity: 0.9;
}






