/**
 * Search Results Page Styles
 * Extends city-split-view.css for search functionality
 */

/* Filter Bar */
.search-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border, #E2E8F0);
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-surface, #F8FAFC);
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #1E293B);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    font-family: inherit;
}

.filter-chip:hover {
    border-color: var(--text-primary, #1E293B);
}

.filter-chip.active {
    background: var(--text-primary, #1E293B);
    color: white;
    border-color: var(--text-primary, #1E293B);
}

.filter-chip .chip-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
}

.filter-chip.active .chip-close:hover {
    background: rgba(255, 255, 255, 0.5);
}

.filter-chip svg {
    flex-shrink: 0;
}

.clear-filters {
    font-size: 14px;
    color: var(--text-secondary, #64748B);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    text-decoration: underline;
    font-family: inherit;
}

.clear-filters:hover {
    color: var(--text-primary, #1E293B);
}

/* Results Info */
.search-results-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    font-size: 14px;
    color: var(--text-secondary, #64748B);
}

/* Loading State */
.search-loading {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-secondary, #64748B);
}

.search-loading.active {
    display: flex;
}

.search-loading svg {
    animation: searchSpinner 1s linear infinite;
}

@keyframes searchSpinner {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 64px 24px;
}

.no-results h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary, #1E293B);
}

.no-results p {
    color: var(--text-secondary, #64748B);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.no-results a {
    color: var(--accent, #3B82F6);
    text-decoration: none;
    font-weight: 500;
}

.no-results a:hover {
    text-decoration: underline;
}

/* Load More */
.load-more-container {
    display: flex;
    justify-content: center;
    padding: 24px;
}

.load-more-btn {
    padding: 12px 32px;
    background: var(--text-primary, #1E293B);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: inherit;
}

.load-more-btn:hover {
    background: #0F172A;
}

.load-more-btn:disabled {
    background: var(--text-muted, #94A3B8);
    cursor: not-allowed;
}

/* Infinite scroll sentinel */
.load-more-sentinel {
    height: 1px;
    width: 100%;
}

/* Filter Popups (for future enhancements) */
.filter-popup {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 300px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.filter-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-filter-bar {
        padding: 12px 0;
        gap: 8px;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .search-filter-bar::-webkit-scrollbar {
        display: none;
    }

    .filter-chip {
        padding: 6px 12px;
        font-size: 13px;
    }

    .clear-filters {
        flex-shrink: 0;
    }

    .search-results-info {
        padding: 12px 0;
    }

    .no-results {
        padding: 48px 16px;
    }

    .no-results h2 {
        font-size: 20px;
    }

    .load-more-container {
        padding: 16px;
    }

    .load-more-btn {
        width: 100%;
    }
}

/* Skeleton Loading */
.listing-card.skeleton {
    pointer-events: none;
}

.listing-card.skeleton .listing-gallery {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.listing-card.skeleton .listing-info {
    opacity: 0;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Listing card hover state for map interaction */
.listing-card.map-hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: scale(1.02);
}

.listing-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Save button states */
.listing-save.saved svg {
    fill: #FF385C;
    stroke: #FF385C;
}

/* Virtual scrolling container */
.city-listings-grid.virtual-scroll {
    position: relative;
}

.city-listings-grid.virtual-scroll .listing-card {
    position: absolute;
    width: calc(33.333% - 16px);
}

@media (max-width: 1024px) {
    .city-listings-grid.virtual-scroll .listing-card {
        width: calc(50% - 12px);
    }
}

@media (max-width: 640px) {
    .city-listings-grid.virtual-scroll .listing-card {
        width: 100%;
        position: relative;
    }
}

/* Active filter badge count */
.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    background: var(--accent, #3B82F6);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    margin-left: 4px;
}

/* Map panel states */
.city-map-panel.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Date range display */
.filter-chip .date-range {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.filter-chip .date-range .date-separator {
    color: rgba(255, 255, 255, 0.6);
}

/* Guest counter display */
.filter-chip .guest-count {
    display: inline-flex;
    align-items: center;
}
