/* Site-wide predictive search modal */
.search-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    z-index: 20000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 16px 24px;
    animation: searchFadeIn 0.2s ease;
}

@keyframes searchFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.search-modal {
    width: 100%;
    max-width: 640px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    animation: searchSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes searchSlideIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.search-modal-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #f1f5f9;
}

.search-modal-input-wrap > .bi-search {
    font-size: 18px;
    color: #24b25a;
    flex-shrink: 0;
}

.search-modal-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 500;
    color: #0f172a;
    background: transparent;
    min-width: 0;
}

.search-modal-input::placeholder {
    color: #94a3b8;
}

.search-modal-clear {
    border: none;
    background: none;
    color: #94a3b8;
    font-size: 16px;
    padding: 0;
    cursor: pointer;
    line-height: 1;
}

.search-modal-kbd {
    font-size: 10px;
    color: #94a3b8;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: inherit;
}

.search-modal-body {
    max-height: min(58vh, 480px);
    overflow-y: auto;
    padding: 8px 0 12px;
}

.search-modal-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px;
    font-size: 13px;
    color: #64748b;
}

.search-modal-hint {
    padding: 16px 18px;
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}

.search-modal-empty {
    text-align: center;
    padding: 32px 20px;
    color: #64748b;
}

.search-modal-empty i {
    font-size: 32px;
    color: #cbd5e1;
    display: block;
    margin-bottom: 10px;
}

.search-modal-cta {
    margin-top: 12px;
    border: none;
    background: #24b25a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
}

.search-modal-group h4,
.search-modal-quick h4 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin: 12px 18px 8px;
}

.search-modal-group ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-result-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.search-result-item:hover {
    background: #f0fdf4;
}

.search-result-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f5f9;
}

.search-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-result-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-sub {
    font-size: 11.5px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    font-size: 12px;
    font-weight: 700;
    color: #16a34a;
    flex-shrink: 0;
}

.search-result-type-icon {
    font-size: 14px;
    color: #cbd5e1;
    flex-shrink: 0;
}

.search-modal-quick-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 18px 8px;
}

.search-quick-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}

.search-quick-chip:hover {
    border-color: #24b25a;
    background: #f0fdf4;
    color: #16a34a;
}

.search-quick-chip i {
    font-size: 13px;
    color: #24b25a;
}

.search-modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 18px;
    border-top: 1px solid #f1f5f9;
    font-size: 11px;
    color: #94a3b8;
    background: #fafbfc;
}

.search-modal-footer kbd {
    font-size: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 1px 4px;
    margin: 0 1px;
}

@media (max-width: 900px) {
    .search-modal-overlay {
        padding: 0;
        align-items: flex-end;
        justify-content: center;
    }

    .search-modal {
        width: 100%;
        max-width: none;
        height: 75vh;
        max-height: 75vh;
        min-height: 0;
        border-radius: 18px 18px 0 0;
        display: flex;
        flex-direction: column;
        animation: searchSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.15);
    }

    @keyframes searchSlideUp {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .search-modal-input-wrap {
        flex-shrink: 0;
        padding-top: 12px;
    }

    .search-modal-input-wrap::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #e2e8f0;
        border-radius: 4px;
        margin: 0 auto 12px;
    }

    .search-modal-body {
        flex: 1;
        max-height: none;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .search-modal-footer {
        flex-shrink: 0;
    }

    .search-modal-kbd {
        display: none !important;
    }
}
