/**
 * Search and Archive Page Styles
 * Enhanced search functionality with filters and results
 */

/* Search Hero Section */
.search-results-page,
.archive-page {
    min-height: 100vh;
    background: var(--background-color);
}

.search-hero,
.archive-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 60px 0;
    position: relative;
}

.search-hero::before,
.archive-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.1);
    z-index: 1;
}

.search-hero-content,
.archive-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.search-title,
.archive-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-weight: 600;
}

.search-term {
    color: #fff;
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: normal;
}

/* Enhanced Search Form */
.search-form-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.enhanced-search-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.search-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.search-field label {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 500;
}

.search-input,
.search-select,
.price-input {
    padding: 12px 15px;
    border: 2px solid var(--background-color-200);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus,
.search-select:focus,
.price-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(75,156,181,0.1);
}

.price-range {
    min-width: 150px;
}

.search-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    padding-top: 10px;
}

.search-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-submit:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.search-reset {
    color: var(--accent-color);
    text-decoration: none;
    padding: 15px 20px;
    border-radius: 8px;
    border: 2px solid var(--background-color-300);
    transition: all 0.3s ease;
}

.search-reset:hover {
    background: var(--background-color-100);
    border-color: var(--accent-color);
}

/* Search Results Section */
.search-results-section,
.archive-content {
    padding: 60px 0;
}

.search-results-header,
.archive-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--background-color-200);
}

.results-count {
    font-size: 1.2rem;
    color: var(--text-color);
    font-weight: 600;
}

.sort-select,
.archive-sort {
    padding: 10px 15px;
    border: 2px solid var(--background-color-200);
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

/* Active Filters */
.active-filters {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--background-color-200);
}

.filters-label {
    font-weight: 600;
    color: var(--text-color);
    margin-left: 10px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    background: var(--primary-color);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    margin: 5px;
    font-size: 0.9rem;
}

.filter-type {
    font-weight: 600;
    margin-left: 5px;
}

.filter-value {
    margin-left: 8px;
}

.remove-filter {
    background: rgba(255,255,255,0.3);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-right: 8px;
    font-size: 14px;
    line-height: 1;
}

.remove-filter:hover {
    background: rgba(255,255,255,0.5);
    color: white;
}

.clear-all-filters {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    margin-right: 15px;
    font-size: 0.9rem;
}

.clear-all-filters:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Search Results Grid */
.search-results-grid,
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* Project Card Styles */
.project-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    height: fit-content;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.project-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.view-project {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.project-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-content {
    padding: 25px;
}

.project-title {
    margin-bottom: 10px;
}

.project-title a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.3;
}

.project-title a:hover {
    color: var(--primary-color);
}

.project-developer {
    color: var(--accent-color);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 15px;
}

.project-details {
    margin-bottom: 15px;
}

.project-location,
.project-area {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--accent-color);
    font-size: 0.95rem;
}

.location-detail {
    color: var(--background-color-500);
    font-size: 0.9rem;
}

.project-excerpt p {
    color: var(--background-color-500);
    line-height: 1.6;
    margin-bottom: 20px;
}

.project-pricing {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--background-color-100);
    border-radius: 8px;
}

.price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 10px;
}

.price-label {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.price-value {
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 700;
}

.price-currency {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.payment-details {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.down-payment,
.installment {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--background-color-500);
    font-size: 0.85rem;
}

.project-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Search Result Item (for non-project posts) */
.search-result-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.search-result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.search-result-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.search-result-image {
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    border-radius: 6px;
    overflow: hidden;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-content {
    flex: 1;
}

.search-result-title a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
}

.search-result-title a:hover {
    color: var(--primary-color);
}

.search-result-meta {
    display: flex;
    gap: 15px;
    margin: 8px 0;
    font-size: 0.85rem;
    color: var(--accent-color);
}

.search-result-excerpt {
    color: var(--background-color-500);
    line-height: 1.6;
    margin-bottom: 15px;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.read-more:hover {
    color: var(--secondary-color);
}

/* No Results */
.no-results,
.no-projects {
    text-align: center;
    padding: 80px 20px;
}

.no-results-content,
.no-projects-content {
    max-width: 600px;
    margin: 0 auto;
}

.no-results-icon,
.no-projects-icon {
    font-size: 4rem;
    color: var(--background-color-400);
    margin-bottom: 30px;
}

.no-results h2,
.no-projects h3 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 2rem;
}

.no-results p,
.no-projects p {
    color: var(--background-color-500);
    line-height: 1.6;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.search-suggestions,
.popular-searches,
.browse-alternatives {
    text-align: right;
    margin-bottom: 30px;
}

.search-suggestions h3,
.popular-searches h3,
.browse-alternatives h4 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.search-suggestions ul {
    list-style: none;
    padding: 0;
}

.search-suggestions li {
    color: var(--background-color-500);
    margin-bottom: 8px;
    padding-right: 20px;
    position: relative;
}

.search-suggestions li::before {
    content: '✓';
    position: absolute;
    right: 0;
    color: var(--primary-color);
}

.popular-terms,
.alternative-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.popular-term,
.category-link {
    background: var(--background-color-100);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.popular-term:hover,
.category-link:hover {
    background: var(--primary-color);
    color: white;
}

/* Archive Description */
.archive-description {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Archive Search Form */
.archive-search-form {
    margin-top: 30px;
}

/* Pagination */
.search-pagination,
.archive-pagination {
    display: flex;
    justify-content: center;
    margin-top: 50px;
}

.navigation.pagination {
    display: flex;
    gap: 10px;
}

.page-numbers {
    padding: 10px 15px;
    border: 2px solid var(--background-color-200);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.page-numbers:hover,
.page-numbers.current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-hero,
    .archive-hero {
        padding: 40px 0;
    }
    
    .search-title,
    .archive-title {
        font-size: 1.8rem;
    }
    
    .search-form-container {
        margin: 0 15px;
        padding: 20px;
    }
    
    .search-fields {
        grid-template-columns: 1fr;
    }
    
    .search-actions {
        flex-direction: column;
    }
    
    .search-results-header,
    .archive-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .search-results-grid,
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .project-actions {
        flex-direction: column;
    }
    
    .search-result-container {
        flex-direction: column;
    }
    
    .search-result-image {
        width: 100%;
        height: 200px;
    }
    
    .popular-terms,
    .alternative-links {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .search-form-container {
        margin: 0 10px;
        padding: 15px;
    }
    
    .search-title {
        font-size: 1.5rem;
    }
    
    .project-content {
        padding: 20px;
    }
}
