/* Wiki Search Bar */
.wiki-search {
    position: relative;
    margin: 0 1rem;
    flex: 0 1 320px;
}

.wiki-search-input {
    width: 100%;
    padding: 0.5rem 2.2rem 0.5rem 0.85rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
}

.wiki-search-input::placeholder {
    color: rgba(255,255,255,0.4);
}

.wiki-search-input:focus {
    background: rgba(255,255,255,0.12);
    border-color: rgba(88,101,242,0.5);
    box-shadow: 0 0 0 2px rgba(88,101,242,0.15);
}

.wiki-search-icon {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    opacity: 0.4;
    pointer-events: none;
}

.wiki-search-clear {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.2rem;
    display: none;
    line-height: 1;
}

.wiki-search-clear:hover {
    color: rgba(255,255,255,0.8);
}

.wiki-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1a1d23;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.wiki-search-results.active {
    display: block;
}

.wiki-search-result {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    text-decoration: none;
    color: #e0e0e0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
}

.wiki-search-result:last-child {
    border-bottom: none;
}

.wiki-search-result:hover {
    background: rgba(88,101,242,0.12);
    color: #fff;
}

.wiki-search-result-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.wiki-search-result-info {
    flex: 1;
    min-width: 0;
}

.wiki-search-result-title {
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wiki-search-result-meta {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.4);
    margin-top: 0.1rem;
}

.wiki-search-empty {
    padding: 1.2rem 1rem;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
}

.wiki-search-loading {
    padding: 1rem;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
}

/* Mobile: search moves to full-width below navbar */
@media (max-width: 900px) {
    .wiki-search {
        display: none;
    }

    .wiki-search-mobile {
        display: block;
        padding: 0.5rem 1rem;
        background: rgba(0,0,0,0.2);
    }

    .wiki-search-mobile .wiki-search {
        display: block;
        margin: 0;
        flex: none;
    }
}

@media (min-width: 901px) {
    .wiki-search-mobile {
        display: none;
    }
}
