/* ═══════════════════════════════════════════════════════
   BGrade Global Navbar Styles
   ═══════════════════════════════════════════════════════ */

.global-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg, rgba(255,255,255,0.8));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--glass-border, rgba(0,0,0,0.08));
    padding: clamp(0.5rem, 2vw, 0.75rem) clamp(1rem, 4vw, 2rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: background 0.3s, border-color 0.3s;
}

/* ── Left ── */
.nav-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(1.1rem, 3vw, 1.25rem);
    font-weight: 800;
    text-decoration: none;
    color: var(--text-main, #111);
    font-family: 'Outfit', sans-serif;
    white-space: nowrap;
}
.nav-logo span { color: var(--primary, #6366f1); }

/* ── Tools Trigger + Dropdown ── */
.nav-tools-trigger {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-muted, #666);
    transition: color 0.2s;
    position: relative;
    padding: 0.4rem 0;
    user-select: none;
}
.nav-tools-trigger:hover { color: var(--primary, #6366f1); }

.tools-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    background: var(--glass-bg, #fff);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border, rgba(0,0,0,0.1));
    border-radius: 16px;
    padding: 0.75rem;
    width: 260px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    animation: dropdownFade 0.2s ease;
    z-index: 100;
}
.tools-dropdown.show { display: flex; }

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-main, #111);
    transition: background 0.2s, color 0.2s;
    font-size: 0.9rem;
}
.tool-item:hover { background: var(--primary-light, #eef2ff); color: var(--primary, #6366f1); }
.tool-item i { font-size: 1.1rem; flex-shrink: 0; }

/* ── Centre Search ── */
.nav-search {
    flex: 1;
    max-width: 420px;
    position: relative;
}
.nav-search > i {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #888);
    pointer-events: none;
}
.nav-search input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.4rem;
    background: var(--bg-base, #f5f5f5);
    border: 1px solid var(--glass-border, rgba(0,0,0,0.1));
    border-radius: 99px;
    color: var(--text-main, #111);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.nav-search input:focus {
    outline: none;
    border-color: var(--primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* ── Live Search Dropdown ── */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--glass-bg, #fff);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border, rgba(0,0,0,0.1));
    border-radius: 14px;
    padding: 0.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 360px;
    overflow-y: auto;
    animation: dropdownFade 0.2s ease;
    z-index: 200;
}
.search-results-dropdown.show { display: flex; }

.search-result-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-main, #111);
    transition: background 0.2s;
}
.search-result-item:hover { background: var(--primary-light, #eef2ff); }

.search-result-type {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: 99px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}
.search-result-type.tool { background: rgba(99,102,241,0.15); color: var(--primary, #6366f1); }
.search-result-type.blog { background: rgba(168,85,247,0.15); color: #a855f7; }

.search-result-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main, #111);
    line-height: 1.3;
}
.search-result-desc {
    font-size: 0.78rem;
    color: var(--text-muted, #666);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}
.search-no-result {
    padding: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted, #888);
    text-align: center;
}

/* ── Right ── */
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.nav-blog-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--text-muted, #666);
    transition: color 0.2s;
    white-space: nowrap;
}
.nav-blog-link:hover { color: var(--primary, #6366f1); }

/* ── Mobile ── */
@media (max-width: 768px) {
    .nav-search    { max-width: unset; margin: 0; }
    .nav-blog-link span { display: none; }
    .nav-tools-trigger span { display: none; }
    .nav-left { gap: 0.75rem; }
    .tools-dropdown { left: -30px; width: 240px; }
}

@media (max-width: 480px) {
    .nav-search { display: none; }
    .nav-blog-link { 
        display: flex; 
        width: 38px;
        height: 38px;
        justify-content: center;
        background: var(--primary-light, rgba(99,102,241,0.1));
        border-radius: 10px;
        color: var(--primary, #6366f1);
    }
    .nav-blog-link i { font-size: 1.1rem; }
    .nav-right { gap: 0.5rem; }
    #nav-theme-toggle { width: 38px; height: 38px; border-radius: 10px; font-size: 1.1rem; }
}
