/* ============================================================
   SEARCH MODAL — Premium Overlay Panel
   ============================================================ */

/* Modal wrapper — fullscreen overlay */
.search-modal-panel {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}
.search-modal-panel.active { display: flex; }

/* Dark backdrop behind the modal */
.search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Modal card */
.search-modal {
    position: relative;
    width: 100%;
    max-width: 580px;
    background: var(--color-bg-surface);
    border-radius: var(--radius-xl);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--color-border);
    animation: searchModalIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Entrance animation */
@keyframes searchModalIn {
    from { transform: translateY(30px) scale(0.96); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Header — sticky with input + close button */
.search-modal-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 2px solid var(--color-secondary);
    flex-shrink: 0;
    background: var(--color-bg-surface);
}

/* Inline search input inside the modal */
.search-modal-header .search-input-inline {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    height: 2.6rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 0.9rem;
    background: var(--color-bg-surface-2);
    color: var(--color-text-main);
    outline: none;
    transition: all 0.3s ease;
}
.search-modal-header .search-input-inline:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--shadow-primary);
    background: var(--color-bg-body);
}

/* Close button — circle with X */
.search-modal-close-btn {
    background: var(--color-bg-surface-2);
    border: 1px solid var(--color-border);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.search-modal-close-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: rotate(90deg);
}

/* Results count — shows "X results found" */
.search-results-count {
    padding: var(--space-3) var(--space-5);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    background: var(--color-bg-surface-2);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.search-results-count i {
    color: var(--color-secondary);
    font-size: 0.75rem;
}

/* Scrollable results area */
.search-results-container {
    flex: 1;
    overflow-y: auto;
    min-height: 120px;
    max-height: 50vh;
}
.search-results-content {
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Individual result item */
.search-item {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: var(--color-bg-surface);
}
.search-item:hover {
    background: var(--color-bg-surface-2);
    border-color: var(--color-primary-light);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

/* Icon on the left of each result */
.item-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--color-bg-surface-2), var(--color-bg-body));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 1.1rem;
    border: 1px solid var(--color-border);
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.search-item:hover .item-icon {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Result text content */
.item-info { flex: 1; min-width: 0; }

/* Title + type badge row */
.item-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: 3px;
}
.item-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--color-text-main);
    line-height: 1.2;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-type {
    font-size: 0.6rem;
    text-transform: uppercase;
    background: var(--color-bg-surface-2);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    color: var(--color-text-muted);
    letter-spacing: 0.5px;
    flex-shrink: 0;
    font-weight: 500;
}

/* Description line */
.item-desc {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

/* Price + location row */
.item-meta {
    display: flex;
    gap: var(--space-3);
    font-size: 0.78rem;
    align-items: center;
}
.item-price { color: var(--color-secondary); font-weight: 600; }
.item-loc {
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
}

/* Arrow on the right of each result */
.item-arrow {
    color: var(--color-border);
    transition: all 0.2s ease;
    opacity: 0;
    flex-shrink: 0;
    font-size: 0.8rem;
}
.search-item:hover .item-arrow {
    opacity: 1;
    color: var(--color-primary);
    transform: translateX(3px);
}

/* Load more button at bottom */
.load-more-container {
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: center;
}
.load-more-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.load-more-btn:hover {
    background: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Empty state — no results found */
.no-results {
    padding: var(--space-12) var(--space-6);
    text-align: center;
    color: var(--color-text-muted);
}
.no-results i {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    opacity: 0.2;
    display: block;
}
.no-results h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--color-primary);
    margin-bottom: var(--space-2);
}
.no-results p {
    font-size: 0.85rem;
    opacity: 0.7;
}
