.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    /* Higher than header */
    display: grid;
    place-items: start center;
    padding: clamp(1rem, 4vw, 4rem) 1rem;
    background: rgba(1, 4, 9, 0.72);
    backdrop-filter: blur(8px);
}

.search-overlay[hidden] {
    display: none !important;
}

.search-panel {
    width: min(760px, 100%);
    border: 1px solid rgba(55, 120, 218, 0.55);
    border-radius: 18px;
    background: linear-gradient(165deg, rgba(11, 15, 22, 0.97), rgba(5, 8, 12, 0.97));
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    padding: 1rem;
    animation: modalEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.search-overlay.is-closing .search-panel {
    animation: modalExit 0.2s ease-in forwards;
}

@keyframes modalExit {
    to {
        opacity: 0;
        transform: translateY(-10px) scale(1);
    }
}

.search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.7rem;
}

.search-input {
    width: 100%;
    border: 1px solid rgba(82, 151, 255, 0.35);
    border-radius: 12px;
    background: #0d141d;
    color: #e7f0ff;
    font: inherit;
    font-size: 1rem;
    padding: 0.8rem 0.9rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    border-color: rgba(82, 151, 255, 0.8);
    box-shadow: 0 0 0 4px rgba(82, 151, 255, 0.1);
}

.search-close {
    border: 1px solid rgba(87, 148, 241, 0.45);
    background: #0e1622;
    color: #dce7fb;
    border-radius: 12px;
    padding: 0.72rem 0.9rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.search-close:hover {
    background: #1a2432;
    border-color: rgba(87, 148, 241, 0.8);
}

.search-results {
    margin-top: 0.75rem;
    max-height: min(55vh, 420px);
    overflow: auto;
    display: grid;
    gap: 0.35rem;
    padding-right: 4px;
}

/* Custom Scrollbar */
.search-results::-webkit-scrollbar {
    width: 6px;
}

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

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

.search-results a {
    display: block;
    text-decoration: none;
    color: #dce7f9;
    padding: 0.8rem 0.9rem;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.search-results a:hover,
.search-results a:focus-visible {
    border-color: rgba(74, 157, 255, 0.4);
    background: rgba(18, 56, 99, 0.25);
    color: #7ec3ff;
    transform: translateX(4px);
}

.search-empty {
    margin: 0.6rem 0.5rem 0;
    color: #9eb0c9;
    font-size: 0.92rem;
}