/* ============================================================
   support-nav.css  — Custom forum navbar & search dropdown
   ============================================================ */

:root {
    --nav-height: 62px;
    --fn-bg: rgba(10, 10, 10, 0.96);
    --fn-border: rgba(255, 255, 255, 0.07);
    --fn-primary: #f5a623;
    --fn-primary-rgb: 245, 166, 35;
}

/* ── Navbar shell ─────────────────────────────────────────── */

.forum-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--fn-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--fn-border);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: 1rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Logo ─────────────────────────────────────────────────── */

.fn-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    color: #fff;
    font-weight: 800;
    font-size: 1.125rem;
    letter-spacing: -0.01em;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.fn-brand:hover {
    opacity: 0.85;
}

.fn-brand-icon {
    width: 28px;
    height: 28px;
    color: var(--fn-primary);
    flex-shrink: 0;
}

.fn-brand-text {
    color: #fff;
}

/* ── Divider between logo and tabs ───────────────────────── */

.fn-divider {
    width: 1px;
    height: 22px;
    background: var(--fn-border);
    flex-shrink: 0;
}

/* ── Nav links (optional) ────────────────────────────────── */

.fn-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.fn-link {
    padding: 0.4rem 0.75rem;
    border-radius: 7px;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

.fn-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
}

.fn-link.active {
    color: var(--fn-primary);
}

/* ── Spacer ───────────────────────────────────────────────── */

.fn-spacer {
    flex: 1;
}

/* ── Right section ────────────────────────────────────────── */

.fn-right {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
}

/* Search icon button */
.fn-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    position: relative;
}

.fn-search-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.fn-search-btn.active {
    background: rgba(var(--fn-primary-rgb), 0.12);
    color: var(--fn-primary);
}

.fn-search-btn svg {
    width: 18px;
    height: 18px;
}

/* Auth buttons */
.fn-btn-signup {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.425rem 1rem;
    border-radius: 7px;
    background: var(--fn-primary);
    color: #000;
    font-weight: 700;
    font-size: 0.8375rem;
    font-family: inherit;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: filter 0.15s;
    white-space: nowrap;
}

.fn-btn-signup:hover {
    filter: brightness(1.08);
}

.fn-btn-login {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.425rem 1rem;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    font-size: 0.8375rem;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.fn-btn-login:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* User menu (logged in) */
.fn-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem 0.35rem 0.45rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
}

.fn-user:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.18);
}

.fn-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.fn-user-name {
    font-size: 0.8375rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Search panel ─────────────────────────────────────────── */

/* Wrapper anchored to the right, just below the navbar */
.fn-search-panel {
    position: fixed;
    top: var(--nav-height);
    right: 1rem;
    left: auto;
    width: 460px;
    max-width: calc(100vw - 2rem);
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.fn-search-panel.open {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
}

.fn-search-inner {
    width: 100%;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 20px 50px -8px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

/* Search input row */
.fn-search-input-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.fn-search-input-row svg {
    width: 17px;
    height: 17px;
    color: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

.fn-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    caret-color: var(--fn-primary);
}

.fn-search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.fn-search-clear {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
    border-radius: 4px;
    transition: color 0.15s;
}

.fn-search-clear:hover {
    color: rgba(255, 255, 255, 0.7);
}

.fn-search-clear svg {
    width: 15px;
    height: 15px;
}

/* Results area — single column, Posts then Users stacked */
.fn-search-results {
    display: flex;
    flex-direction: column;
    max-height: 65vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.fn-search-results::-webkit-scrollbar {
    width: 4px;
}

.fn-search-results::-webkit-scrollbar-track {
    background: transparent;
}

.fn-search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
}


.fn-results-col+.fn-results-col {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    border-left: none;
}

.fn-results-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: sticky;
    top: 0;
    background: #111;
    z-index: 1;
}

.fn-results-heading svg {
    width: 12px;
    height: 12px;
}

/* Post result item */
.fn-result-post {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.65rem 1.25rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s;
    border-left: 2px solid transparent;
}

.fn-result-post:hover {
    background: rgba(255, 255, 255, 0.045);
    border-left-color: var(--fn-primary);
}

.fn-result-post-cat {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.1rem;
}

.fn-result-post-cat .cat-dot-xs {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.fn-result-post-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
}

.fn-result-post-meta {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* User result item */
.fn-result-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s;
    border-left: 2px solid transparent;
}

.fn-result-user:hover {
    background: rgba(255, 255, 255, 0.045);
    border-left-color: var(--fn-primary);
}

.fn-result-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.fn-result-user-info {
    min-width: 0;
}

.fn-result-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.fn-result-user-meta {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
}

/* Empty & loading states */
.fn-results-empty {
    padding: 2rem 1.25rem;
    text-align: center;
    font-size: 0.8375rem;
    color: rgba(255, 255, 255, 0.25);
}

.fn-results-loading {
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

/* Search backdrop */
.fn-backdrop {
    position: fixed;
    inset: 0;
    z-index: 998;
    display: none;
}

.fn-backdrop.open {
    display: block;
}

/* ── Left section ─────────────────────────────────────────── */

.fn-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ── Mobile hamburger ─────────────────────────────────────── */

.fn-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    padding: 0;
}

.fn-hamburger:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.fn-hamburger svg {
    width: 22px;
    height: 22px;
}

/* ── Mobile Drawer ───────────────────────────────────────── */

.fn-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: #0f0f0f;
    border-right: 1px solid var(--fn-border);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
}

.fn-drawer.open {
    transform: translateX(0);
}

.fn-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid var(--fn-border);
}

.fn-drawer-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fn-drawer-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.fn-drawer-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.fn-drawer-close svg {
    width: 20px;
    height: 20px;
}

.fn-drawer-body {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
}

.fn-drawer-body::-webkit-scrollbar {
    display: none;
}

.fn-drawer-section {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--fn-border);
}

.fn-drawer-section-title {
    padding: 0 1.25rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.fn-drawer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fn-drawer-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.fn-drawer-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.fn-drawer-link.active {
    color: var(--fn-primary);
    background: rgba(var(--fn-primary-rgb), 0.08);
}

.fn-drawer-link .material-icons {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.25);
}

.fn-drawer-link:hover .material-icons {
    color: var(--fn-primary);
}

.fn-drawer-link .cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Drawer Backdrop */
.fn-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.fn-drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 1024px) {
    .fn-hamburger {
        display: flex;
    }

    .fn-brand-text {
        font-size: 1.1rem;
    }
}

@media (max-width: 640px) {
    .forum-nav {
        padding: 0 0.75rem;
    }

    .fn-btn-signup span,
    .fn-btn-login span {
        display: none;
    }

    .fn-btn-signup,
    .fn-btn-login {
        padding: 0.425rem 0.6rem;
    }

    .fn-user-name {
        display: none;
    }

    .fn-search-panel {
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
        max-width: none;
    }

    .fn-search-inner {
        border-radius: 10px;
    }
}