/* ════════════════════════════════════════════════════════
   public/assets/css/search.css
   Wyszukiwarka frontendowa — style
════════════════════════════════════════════════════════ */

/* ── Podświetlenie frazy ── */
.search-highlight,
mark.search-highlight {
    background: #fef08a;
    color: #713f12;
    border-radius: 2px;
    padding: 0 2px;
    font-weight: 600;
}

/* ────────────────────────────────
   NAVBAR — wyszukiwarka
──────────────────────────────── */
.nav-search-item {
    position: relative;
    display: flex;
    align-items: center;
}

/* Przycisk lupy — tej samej wysokości co nav-link */
.nav-search-toggle {
    display: flex;
    align-items: center;
    padding: 8px 10px;         /* identyczny padding co .nav-link */
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;             /* kolor jak nieaktywny nav-link Bootstrap */
    font-size: 16px;
    border-radius: 6px;
    line-height: 1;
    transition: color .15s, background .15s;
    text-decoration: none;
}
.nav-search-toggle:hover {
    color: #212529;
    background: rgba(0,0,0,.04);
}

/* Pole wyszukiwania — ukryte domyślnie */
.nav-search-form {
    display: none;
    align-items: center;
    gap: 6px;
}
.nav-search-form.open {
    display: flex;
}

.nav-search-input-wrap {
    position: relative;
}
.nav-search-input-wrap .bi-search {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 13px;
    pointer-events: none;
}
.nav-search-input {
    border: 1.5px solid #dee2e6;
    border-radius: 8px;
    padding: 7px 12px 7px 32px;
    font-size: 14px;
    outline: none;
    width: 190px;
    transition: border-color .15s, width .22s cubic-bezier(.4,0,.2,1);
    background: #fff;
}
.nav-search-input:focus {
    border-color: #0d6efd;
    width: 230px;
}
.nav-search-btn {
    background: #0d6efd;
    color: #fff;
    border: none;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
    line-height: 1.5;
}
.nav-search-btn:hover { background: #0b5ed7; }

/* Live dropdown navbara */
.nav-live-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.12);
    z-index: 9999;
    overflow: hidden;
}
.nav-live-dropdown.show { display: block; }

.nav-live-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none;
    color: #212529;
    border-bottom: 1px solid #f8f9fa;
    transition: background .1s;
}
.nav-live-item:last-of-type { border-bottom: none; }
.nav-live-item:hover { background: #f8f9fa; color: #212529; }

.nav-live-thumb {
    width: 36px;
    height: 28px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
}
.nav-live-icon {
    width: 36px;
    height: 28px;
    border-radius: 5px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #adb5bd;
    font-size: 14px;
}
.nav-live-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-live-excerpt {
    font-size: 11px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-live-more {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #0d6efd;
    background: #f8f9fa;
    text-decoration: none;
    border-top: 1px solid #f1f5f9;
}
.nav-live-more:hover { background: #e9f0ff; color: #0b5ed7; }
.nav-live-empty {
    padding: 16px;
    text-align: center;
    color: #adb5bd;
    font-size: 14px;
}

/* Mobile — pełna szerokość */
@media (max-width: 991px) {
    .nav-search-form.open {
        width: 100%;
    }
    .nav-search-input {
        width: 100% !important;
        flex: 1;
    }
    .nav-live-dropdown {
        width: 100%;
        right: auto;
        left: 0;
    }
}

/* ────────────────────────────────
   STRONA WYNIKÓW /szukaj
──────────────────────────────── */

/* Formularz na stronie wyników */
.search-page-form {
    max-width: 640px;
    margin: 0 auto 40px;
}
.search-page-input-wrap {
    display: flex;
    gap: 8px;
}
.search-page-input-inner {
    position: relative;
    flex: 1;
}
.search-page-input-inner .bi-search {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 16px;
    pointer-events: none;
}
.search-page-input {
    width: 100%;
    padding: 13px 14px 13px 44px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color .15s;
}
.search-page-input:focus { border-color: #0d6efd; }
.search-page-btn {
    background: #0d6efd;
    color: #fff;
    border: none;
    padding: 13px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}
.search-page-btn:hover { background: #0b5ed7; }

/* Filtry */
.search-filters {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.search-filter-btn {
    border: 1px solid #dee2e6;
    background: #fff;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
}
.search-filter-btn:hover { border-color: #0d6efd; color: #0d6efd; }
.search-filter-btn.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

/* Live dropdown na stronie wyników */
.search-live-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.12);
    z-index: 1000;
    overflow: hidden;
    margin-top: 6px;
    display: none;
}
.search-live-dropdown.show { display: block; }

/* Karta wyniku */
.search-result {
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    background: #fff;
    transition: box-shadow .15s, border-color .15s;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.search-result:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    border-color: #bfdbfe;
}
.search-result-thumb {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.search-result-icon {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 24px;
    flex-shrink: 0;
}
.search-result-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
    line-height: 1.4;
    display: block;
}
.search-result-title:hover { color: #0d6efd; }
.search-result-excerpt {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.6;
    margin: 6px 0 0;
}
.search-result-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.search-type-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 2px 8px;
    border-radius: 20px;
}
.search-type-page { background: #e7f1ff; color: #0d47a1; }
.search-type-post { background: #e8f5e9; color: #1b5e20; }
.search-result-arrow {
    color: #dee2e6;
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 4px;
    align-self: center;
}

/* Stany pustego ekranu */
.search-empty {
    text-align: center;
    padding: 60px 20px;
    color: #adb5bd;
}
.search-empty-icon {
    font-size: 56px;
    opacity: .25;
    display: block;
    margin-bottom: 16px;
}

/* Paginacja */
.search-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
    flex-wrap: wrap;
}
.search-page-link {
    padding: 8px 14px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    color: #374151;
    transition: all .15s;
}
.search-page-link:hover { border-color: #0d6efd; color: #0d6efd; }
.search-page-link.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}
