/* ---------------------------------------------------------------
   Sidebar search input
--------------------------------------------------------------- */

.wiki-search {
    flex-shrink: 0;
    padding: calc(0.6 * var(--behnke-basic)) var(--behnke-basic) 0;
}

/* Header search — mobile only */

.wiki-search--header {
    display: none;
    padding: 0;
    flex: 1;
    min-width: 0;
    margin: 0 8px;
}

.wiki-search--header .wiki-search-input {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.82rem;
}

.wiki-search--header .wiki-search-input:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 700px) {
    .wiki-search--header {
        display: flex;
        align-items: center;
    }

    /* Hide sidebar search on mobile — sidebar is not accessible */
    .wiki-search:not(.wiki-search--header) {
        display: none;
    }
}

.wiki-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: calc(0.4 * var(--behnke-basic)) calc(0.6 * var(--behnke-basic));
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: calc(0.4 * var(--behnke-basic));
    color: #fff;
    font-size: var(--behnke-normal-font-size, 0.875rem);
    outline: none;
    transition: background 0.15s, border-color 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

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

.wiki-search-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.wiki-search-input::-webkit-search-cancel-button {
    filter: invert(1) opacity(0.6);
    cursor: pointer;
}

/* ---------------------------------------------------------------
   Search results page (rendered inside .wiki-main)
--------------------------------------------------------------- */

.sr-page {
    padding: calc(2 * var(--behnke-basic)) calc(1.5 * var(--behnke-basic)) calc(1.5 * var(--behnke-basic));
    width: 100%;
    box-sizing: border-box;
}

.sr-heading {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 calc(1.25 * var(--behnke-basic));
    padding-bottom: calc(0.6 * var(--behnke-basic));
    border-bottom: 2px solid #e8e8e8;
    line-height: 1.3;
}

.sr-heading em {
    font-style: normal;
    color: var(--behnke-design, #0066cc);
}

.sr-count {
    font-size: 0.8rem;
    color: #aaa;
    margin: calc(-0.75 * var(--behnke-basic)) 0 calc(0.75 * var(--behnke-basic));
}

/* Result grid */

.sr-grid {
    display: flex;
    flex-direction: column;
    gap: calc(0.5 * var(--behnke-basic));
}

/* Result card */

.sr-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: calc(0.75 * var(--behnke-basic));
    padding: calc(0.6 * var(--behnke-basic)) calc(0.9 * var(--behnke-basic));
    border: 1px solid #e8e8e8;
    border-radius: calc(0.5 * var(--behnke-basic));
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    cursor: pointer;
}

.sr-card:hover {
    border-color: var(--behnke-design, #0066cc);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.sr-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: calc(0.15 * var(--behnke-basic));
}

.sr-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sr-card-path {
    font-size: 0.72rem;
    color: #bbb;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Confidence bar — vertical strip on the right */

.sr-card-bar {
    flex-shrink: 0;
    width: 36px;
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
    align-self: center;
}

.sr-card-bar-fill {
    height: 100%;
    background: var(--behnke-design, #0066cc);
    border-radius: 2px;
}

/* Empty state */

.sr-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(0.5 * var(--behnke-basic));
    padding: calc(3 * var(--behnke-basic)) var(--behnke-basic);
    color: #999;
    text-align: center;
}

.sr-empty-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.sr-empty-text {
    font-size: 1rem;
    font-weight: 500;
    color: #555;
}

.sr-empty-hint {
    font-size: 0.85rem;
}

/* Error state */

.sr-error {
    padding: var(--behnke-basic);
    color: #c0392b;
    font-size: 0.875rem;
}

/* ---------------------------------------------------------------
   GitLab extended search results section
--------------------------------------------------------------- */

.sr-gitlab {
    margin-top: calc(0.75 * var(--behnke-basic));
    margin-bottom: calc(1.25 * var(--behnke-basic));
}

.sr-gitlab .search-container {
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    overflow: hidden;
}

.sr-gitlab .search-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #e2e6ea;
    font-weight: 600;
    font-size: .82rem;
    color: #495057;
}

.sr-gitlab .search-header::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23E24329' d='M16 31.4l4.2-13H11.8z'/%3E%3Cpath fill='%23FC6D26' d='M16 31.4L11.8 18.4H3.1z'/%3E%3Cpath fill='%23FCA326' d='M3.1 18.4l-2.5-7.8a.9.9 0 0 1 .3-1l15.1 11z'/%3E%3Cpath fill='%23E24329' d='M3.1 18.4h8.7L8.2 8.3z'/%3E%3Cpath fill='%23FC6D26' d='M16 31.4l4.2-13h8.7z'/%3E%3Cpath fill='%23FCA326' d='M28.9 18.4l2.5-7.8a.9.9 0 0 0-.3-1L16 20.6z'/%3E%3Cpath fill='%23E24329' d='M28.9 18.4h-8.7l3.6-10.1z'/%3E%3C/svg%3E") center/contain no-repeat;
    flex-shrink: 0;
}

.sr-gitlab .search-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sr-gitlab .search-entry {
    border-bottom: 1px solid #f1f3f5;
}

.sr-gitlab .search-entry:last-child {
    border-bottom: none;
}

.sr-gitlab .search-link {
    display: block;
    padding: 10px 14px;
    text-decoration: none;
    color: #212529;
    transition: background .1s;
    cursor: pointer;
}

.sr-gitlab .search-link:hover {
    background: #f8f9fa;
}

.sr-gitlab .search-title {
    font-size: .88rem;
    font-weight: 500;
    color: #212529;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sr-gitlab .search-subtext {
    font-size: .75rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.sr-gitlab .gitlab-milestone {
    color: #1a6bb5;
    font-weight: 500;
}

.sr-gitlab .gitlab-labelcontainer-feature    { color: #1a6bb5; font-weight: 600; }
.sr-gitlab .gitlab-labelcontainer-improvement { color: #1a7a5c; font-weight: 600; }
.sr-gitlab .gitlab-labelcontainer-bug        { color: #c0392b; font-weight: 600; }

/* Milestone filter tags */

.sr-ms-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 14px;
    border-bottom: 1px solid #e2e6ea;
    background: #f8f9fa;
}

.sr-ms-tag {
    padding: 3px 11px;
    border-radius: 20px;
    border: 1px solid #dee2e6;
    background: #fff;
    font-size: .76rem;
    color: #495057;
    cursor: pointer;
    transition: background .1s, border-color .1s, color .1s;
    font-family: inherit;
    line-height: 1.5;
}

.sr-ms-tag:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.sr-ms-tag--active {
    background: var(--behnke-design, #0066cc);
    border-color: var(--behnke-design, #0066cc);
    color: #fff;
}

.sr-ms-tag--active:hover {
    opacity: .88;
}

/* Load-more */

.sr-page-hidden {
    display: none !important;
}

.sr-load-more {
    display: block;
    width: 100%;
    padding: 9px 14px;
    border: none;
    border-top: 1px solid #e2e6ea;
    background: #f8f9fa;
    color: var(--behnke-design, #0066cc);
    font-size: .82rem;
    font-weight: 500;
    font-family: inherit;
    text-align: center;
    cursor: pointer;
    transition: background .1s;
}

.sr-load-more:hover {
    background: #eef0f2;
}

/* When used outside .sr-gitlab (wiki grid) */
.sr-grid + .sr-load-more {
    border: 1px solid #e8e8e8;
    border-top: none;
    border-radius: 0 0 calc(0.5 * var(--behnke-basic)) calc(0.5 * var(--behnke-basic));
    background: #fafafa;
}

/* ---------------------------------------------------------------
   Skeleton loading cards
--------------------------------------------------------------- */

@keyframes sr-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}

.sr-card--skeleton {
    border: 1px solid #eeeeee;
    border-radius: calc(0.5 * var(--behnke-basic));
    padding: calc(0.6 * var(--behnke-basic)) calc(0.9 * var(--behnke-basic));
    display: flex;
    flex-direction: column;
    gap: calc(0.35 * var(--behnke-basic));
    background: #fff;
    pointer-events: none;
}

.sr-skel {
    background: linear-gradient(90deg, #f0f0f0 25%, #e4e4e4 50%, #f0f0f0 75%);
    background-size: 800px 100%;
    animation: sr-shimmer 1.4s infinite linear;
    border-radius: 4px;
}

.sr-skel--title {
    height: 14px;
    width: 80%;
}

.sr-skel--url {
    height: 10px;
    width: 55%;
}
