/* SmartSearch Component Styles */

.smart-search-wrapper {
    position: relative;
    width: 100%;
    /* Participate in the topbar's layout exactly like the plain MudPaper it replaced:
       flex so .home_height (flex: 1 0 0) fills this wrapper, and flex sizing so the
       wrapper itself stretches when its parent is a flex row. With the paper filling
       the wrapper, the dropdown (left:0/right:0 below) always matches the bar's width. */
    display: flex;
    flex: 1 0 0;
    min-width: 0;
}

.smart-search-wrapper > .mud-paper {
    flex: 1 0 0;
    min-width: 0;
}

/* Suggestions dropdown overlay */
.smart-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 360px;
    overflow-y: auto;
    animation: smartSearchSlideDown 0.15s ease-out;
}

@keyframes smartSearchSlideDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section headers */
.smart-search-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.smart-search-clear-btn {
    background: none;
    border: none;
    color: #003776;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    font-weight: 500;
}

.smart-search-clear-btn:hover {
    text-decoration: underline;
}

/* Suggestion items */
.smart-search-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    gap: 10px;
    transition: background-color 0.1s ease;
}

.smart-search-item:hover,
.smart-search-item.active {
    background-color: #f0f4fa;
}

.smart-search-item-icon {
    color: #8c8c8c;
    font-size: 14px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.smart-search-item-text {
    flex: 1;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smart-search-item-meta {
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
}

.smart-search-item-count {
    font-size: 11px;
    color: #666;
    background: #e8eef6;
    padding: 1px 8px;
    border-radius: 10px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Category chips */
.smart-search-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px 12px;
}

.smart-search-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: #e8eef6;
    color: #003776;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.15s ease;
    white-space: nowrap;
}

.smart-search-chip:hover {
    background: #d0ddef;
}

/* Chip whose category is already applied in the sidebar filter */
.smart-search-chip.selected {
    background: #003776;
    color: #ffffff;
}

.smart-search-chip.selected:hover {
    background: #00499c;
}

/* Per-entry remove (✕) on recent-search rows */
.smart-search-item-remove {
    flex-shrink: 0;
    color: #8c8c8c;
    font-size: 12px;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 4px;
    line-height: 1;
}

.smart-search-item-remove:hover {
    color: #b0503f;
    background: #f2e4e1;
}

.smart-search-chip i {
    font-size: 10px;
}

/* Intent banner shown on results page */
.smart-search-intent-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f0f4fa;
    border: 1px solid #d0ddef;
    border-radius: 6px;
    margin: 8px 16px;
    font-size: 13px;
    color: #333;
}

.smart-search-intent-banner i {
    color: #003776;
}

/* Divider between sections */
.smart-search-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 4px 16px;
}

/* No suggestions state */
.smart-search-empty {
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* Keyboard navigation highlight */
.smart-search-item.keyboard-active {
    background-color: #e8eef6;
    outline: 2px solid #003776;
    outline-offset: -2px;
}

/* Home inline search results header */
.home-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 8px;
}

.home-search-query {
    font-weight: 600;
    color: #003776;
    font-size: 16px;
}
