:root {
    --nav-indigo: #6366f1;
    --nav-indigo-deep: #4f46e5;
    --nav-surface: rgba(15, 23, 42, 0.96);
    --nav-menu-solid: rgba(15, 23, 42, 0.98);
    --nav-item-bg: rgba(30, 41, 59, 0.72);
    --nav-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --nav-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --nav-radius: 12px;
}

.nav-chip {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    min-height: 44px;
    border-radius: var(--nav-radius);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    color: #f8fafc;
    letter-spacing: 0.01em;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(30, 41, 59, 0.88);
    cursor: pointer;
    font-family: inherit;
    line-height: 1.2;
    transition: background 0.18s var(--nav-ease), border-color 0.18s var(--nav-ease), color 0.18s var(--nav-ease);
    -webkit-user-select: none;
    user-select: none;
}

.nav-chip svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-chip--video,
.nav-chip--popular {
    background: rgba(51, 65, 85, 0.92);
    box-shadow: none;
}

.nav-chip:hover {
    border-color: rgba(165, 180, 252, 0.45);
    background: rgba(51, 65, 85, 0.98);
}

.nav-chip--popular.nav-chip--active {
    border-color: rgba(34, 211, 238, 0.5);
    background: rgba(99, 102, 241, 0.28);
}

.sections-dropdown__details[open] .sections-dropdown__summary.nav-chip--video,
.sections-dropdown__details[open] .sections-dropdown__summary.nav-chip--popular {
    border-color: rgba(165, 180, 252, 0.5);
    background: rgba(99, 102, 241, 0.32);
}

.nav-chip.nav-chip--active:not(.sections-dropdown__summary) {
    border-color: rgba(165, 180, 252, 0.45);
    background: rgba(99, 102, 241, 0.25);
}

.sections-dropdown {
    position: relative;
    display: inline-block;
    isolation: isolate;
}

.sections-dropdown__details {
    position: relative;
}

.sections-dropdown__details[open] {
    z-index: 10060;
}

.sections-dropdown__summary {
    list-style: none;
    user-select: none;
    position: relative;
    padding-right: 38px;
}

.sections-dropdown__summary::-webkit-details-marker {
    display: none;
}

.sections-dropdown__summary::marker {
    content: '';
}

.sections-dropdown__summary::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid rgba(248, 250, 252, 0.9);
    border-bottom: 2px solid rgba(248, 250, 252, 0.9);
    transform: translateY(-65%) rotate(45deg);
    transition: transform 0.2s var(--nav-ease-out);
}

.sections-dropdown__details[open] .sections-dropdown__summary::after {
    transform: translateY(-20%) rotate(-135deg);
}

.sections-dropdown__menu {
    box-sizing: border-box;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    display: grid;
    gap: 4px;
    padding: 6px;
    border-radius: var(--nav-radius);
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: var(--nav-menu-solid);
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.55);
    z-index: 5000;
    opacity: 0;
    transform: scale(0.98);
    transform-origin: top center;
    pointer-events: none;
    transition: opacity 0.18s var(--nav-ease), transform 0.2s var(--nav-ease);
}

.sections-dropdown__details[open] .sections-dropdown__menu {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.sections-dropdown__item {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    background: var(--nav-item-bg);
    border: 1px solid transparent;
    transition: background 0.15s var(--nav-ease), color 0.15s var(--nav-ease), border-color 0.15s var(--nav-ease);
    -webkit-user-select: none;
    user-select: none;
}

.sections-dropdown__item:hover {
    background: rgba(99, 102, 241, 0.18);
    color: #fff;
    border-color: rgba(148, 163, 184, 0.2);
}

.sections-dropdown__item.is-active {
    background: rgba(99, 102, 241, 0.28);
    color: #fff;
    border-color: rgba(129, 140, 248, 0.4);
    box-shadow: inset 3px 0 0 #818cf8;
}

a.nav-btn-login,
button.nav-btn-login {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    min-height: 44px;
    border-radius: var(--nav-radius);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    color: #fff;
    border: 1px solid rgba(129, 140, 248, 0.45);
    font-family: inherit;
    line-height: 1.2;
    box-sizing: border-box;
    cursor: pointer;
    background: var(--nav-indigo);
    box-shadow: none;
    transition: background 0.18s var(--nav-ease), border-color 0.18s var(--nav-ease);
    -webkit-user-select: none;
    user-select: none;
}

a.nav-btn-login:hover,
button.nav-btn-login:hover {
    background: var(--nav-indigo-deep);
    border-color: rgba(165, 180, 252, 0.55);
}

a.nav-btn-login svg,
button.nav-btn-login svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    min-height: 44px;
    border-radius: var(--nav-radius);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    color: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-sizing: border-box;
    background: rgba(51, 65, 85, 0.88);
    box-shadow: none;
    transition: background 0.18s var(--nav-ease), border-color 0.18s var(--nav-ease);
    -webkit-user-select: none;
    user-select: none;
}

.nav-btn-secondary:hover {
    background: rgba(51, 65, 85, 0.98);
    border-color: rgba(165, 180, 252, 0.4);
}

.feed-topbar .sections-dropdown {
    position: relative;
    z-index: 80;
}

.sections-dropdown__summary:focus-visible {
    outline: 2px solid rgba(165, 180, 252, 0.85);
    outline-offset: 2px;
}

.sections-dropdown__item:focus-visible {
    outline: 2px solid rgba(165, 180, 252, 0.85);
    outline-offset: 1px;
}

a.nav-btn-login:focus-visible,
button.nav-btn-login:focus-visible,
.nav-btn-secondary:focus-visible {
    outline: 2px solid rgba(165, 180, 252, 0.9);
    outline-offset: 2px;
}
