/* NerdLore - Header premium separado */

.nerd-header {
    background:
        linear-gradient(180deg, rgba(8, 10, 20, 0.94), rgba(8, 10, 20, 0.88)),
        rgba(8, 10, 20, 0.92);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 34px rgba(0,0,0,0.22);
}

.nerd-header::after {
    content: "";
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(124, 58, 237, 0.42),
        rgba(56, 189, 248, 0.22),
        transparent
    );
}

.nerd-navbar {
    min-height: 78px;
    padding: 10px 0;
}

.nerd-header-container {
    gap: 16px;
}

.nerd-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nerd-site-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.nerd-brand-badge {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    background: linear-gradient(135deg, var(--cor-primaria), var(--cor-secundaria));
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow:
        0 14px 30px rgba(124, 58, 237, 0.24),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

.nerd-menu-collapse {
    min-width: 0;
}

.nerd-nav-list {
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.nerd-nav-link {
    position: relative;
    color: rgba(248, 250, 252, 0.88) !important;
    padding: 9px 11px !important;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
    transition: 0.2s ease;
}

.nerd-nav-link::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 4px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--cor-primaria), var(--cor-secundaria));
    opacity: 0;
    transform: scaleX(0.55);
    transition: 0.2s ease;
}

.nerd-nav-link:hover {
    color: #ffffff !important;
    background: rgba(255,255,255,0.055);
}

.nerd-nav-link:hover::after {
    opacity: 1;
    transform: scaleX(1);
}

.nerd-header-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nerd-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 295px;
    flex-shrink: 0;
}

.nerd-search-input {
    width: 100%;
    height: 42px;
    min-width: 0;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.045);
    color: #ffffff;
    font-size: 0.92rem;
    box-shadow: none;
}

.nerd-search-input:focus {
    border-color: rgba(124, 58, 237, 0.48);
    background: rgba(255,255,255,0.06);
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.nerd-search-input::placeholder {
    color: rgba(203, 213, 225, 0.68);
}

.nerd-search-btn,
.nerd-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 15px;
    border-radius: 14px;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: 0.2s ease;
}

.nerd-search-btn {
    border: 0;
    color: #ffffff;
    background: linear-gradient(135deg, var(--cor-primaria), var(--cor-secundaria));
    box-shadow: 0 12px 24px rgba(124, 58, 237, 0.22);
}

.nerd-search-btn:hover,
.nerd-header-btn-primary:hover {
    color: #ffffff;
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.nerd-user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.nerd-header-btn-outline {
    color: #f8fafc;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.04);
}

.nerd-header-btn-outline:hover {
    color: #ffffff;
    border-color: rgba(196, 181, 253, 0.38);
    background: rgba(124, 58, 237, 0.12);
}

.nerd-header-btn-primary {
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(135deg, var(--cor-primaria), var(--cor-secundaria));
    box-shadow: 0 12px 24px rgba(124, 58, 237, 0.22);
}

.nerd-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 5px 10px 5px 6px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.08);
}

.nerd-user-pill:hover {
    color: #ffffff;
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(124, 58, 237, 0.28);
}

.nerd-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.06);
}

.nerd-user-avatar-fallback {
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--cor-primaria), var(--cor-secundaria));
}

.nerd-user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
    white-space: nowrap;
}

.nerd-menu-toggle {
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 14px;
    padding: 8px 10px;
    box-shadow: none !important;
}

.nerd-menu-toggle:focus {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.16) !important;
}

/* Ajustes para notebooks/tablets */

@media (max-width: 1399px) {
    .nerd-search-form {
        width: 245px;
    }

    .nerd-nav-link {
        padding: 9px 9px !important;
        font-size: 0.88rem;
    }

    .nerd-site-logo {
        width: 58px;
        height: 58px;
        border-radius: 0;
    }
}

@media (max-width: 1199px) {
    .nerd-navbar {
        min-height: 72px;
        padding: 10px 0;
    }

    .nerd-site-logo {
        width: 54px;
        height: 54px;
        border-radius: 0;
    }

    .nerd-brand-badge {
        width: 52px;
        height: 52px;
        border-radius: 16px;
    }

    .nerd-menu-collapse {
        margin-top: 14px;
        padding: 16px;
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 20px;
        background:
            linear-gradient(135deg, rgba(255,255,255,0.035), rgba(124, 58, 237, 0.045)),
            rgba(8, 10, 20, 0.96);
        box-shadow: 0 18px 40px rgba(0,0,0,0.26);
    }

    .nerd-nav-list {
        align-items: stretch;
        justify-content: flex-start;
        gap: 4px;
    }

    .nerd-nav-link {
        display: flex;
        width: 100%;
        padding: 12px 12px !important;
        border-radius: 14px;
        font-size: 0.95rem;
    }

    .nerd-nav-link::after {
        display: none;
    }

    .nerd-header-tools {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid rgba(255,255,255,0.08);
    }

    .nerd-search-form {
        width: 100%;
    }

    .nerd-user-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .nerd-user-pill {
        flex: 1 1 auto;
        justify-content: flex-start;
    }

    .nerd-header-btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 575px) {
    .nerd-navbar {
        padding: 8px 0;
    }

    .nerd-site-logo {
        width: 48px;
        height: 48px;
        border-radius: 0;
    }

    .nerd-brand-badge {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }

    .nerd-menu-collapse {
        padding: 14px;
        border-radius: 18px;
    }

    .nerd-search-form {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .nerd-search-btn {
        width: 100%;
    }

    .nerd-user-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .nerd-user-pill,
    .nerd-header-btn {
        width: 100%;
        justify-content: center;
    }

    .nerd-user-pill {
        justify-content: flex-start;
    }
}

/* Item ativo do menu */

.nerd-nav-link.active {
    color: #ffffff !important;
    background: rgba(255,255,255,0.055);
}

.nerd-nav-link.active::after {
    opacity: 1;
    transform: scaleX(1);
}