/* Advanced Search Page Styles */

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0 3rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="rgba(255,255,255,0.1)"><polygon points="1000,100 1000,0 0,100"/></svg>');
    background-size: cover;
    background-position: bottom;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-title i {
    margin-left: 1rem;
    color: var(--accent-color);
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Search Layout */
.search-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin-top: 2rem;
    align-items: start;
}

/* Search Sidebar */
.search-sidebar {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.sidebar-header h3 i {
    margin-left: 0.5rem;
    color: var(--primary-color);
}

/* Search Form */
.search-form {
    margin-bottom: 1.5rem;
}

.search-input-group {
    position: relative;
    display: flex;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px 0 0 8px;
    background: var(--background-color);
    color: var(--text-color);
    font-family: inherit;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color-light);
}

.search-btn {
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: var(--primary-color-dark);
}

/* Filter Sections */
.filter-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-section h4 {
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.filter-section h4 i {
    margin-left: 0.5rem;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.filter-group {
    margin-bottom: 0.75rem;
}

.filter-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--background-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color-light);
}

/* Checkbox and Radio Groups */
.checkbox-group,
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-item,
.radio-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.25rem 0;
    transition: all 0.3s ease;
}

.checkbox-item:hover,
.radio-item:hover {
    background: var(--surface-hover);
    border-radius: 4px;
    padding-left: 0.25rem;
}

.checkbox-item input,
.radio-item input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark,
.radiomark {
    height: 18px;
    width: 18px;
    background-color: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: 3px;
    margin-left: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.radiomark {
    border-radius: 50%;
}

.checkbox-item input:checked ~ .checkmark,
.radio-item input:checked ~ .radiomark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after,
.radiomark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-item input:checked ~ .checkmark:after {
    display: block;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.radio-item input:checked ~ .radiomark:after {
    display: block;
    top: 4px;
    left: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

/* Rating Filter */
.rating-filter {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rating-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rating-option:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
}

.rating-option.active {
    background: var(--primary-color-light);
    border-color: var(--primary-color);
}

.stars {
    display: flex;
    gap: 2px;
}

.stars i {
    color: var(--warning-color);
    font-size: 0.8rem;
}

.rating-option span {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Filter Actions */
.filter-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-block {
    width: 100%;
    text-align: center;
}

/* Search Content */
.search-content {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 500px;
}

/* Results Header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.results-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.results-info span {
    font-size: 0.9rem;
    color: var(--text-light);
}

.results-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-options label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.sort-options select {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--background-color);
    color: var(--text-color);
    font-size: 0.9rem;
}

.view-options {
    display: flex;
    gap: 0.25rem;
}

.view-btn {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--background-color);
    color: var(--text-light);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn:hover,
.view-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Search Results */
.search-results {
    margin-bottom: 2rem;
}

.result-item {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.result-item:hover {
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color-light);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.result-title {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.result-title:hover {
    color: var(--primary-color-dark);
}

.result-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.meta-item i {
    font-size: 0.75rem;
}

.result-excerpt {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.result-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--background-color);
    color: var(--text-light);
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Grid View */
.search-results.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.search-results.grid-view .result-item {
    margin-bottom: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-content i {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.empty-content h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.empty-content p {
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.pagination {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.page-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--background-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.page-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .search-layout {
        grid-template-columns: 280px 1fr;
        gap: 1.5rem;
    }
    
    .hero-stats {
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .search-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .search-sidebar {
        position: static;
        max-height: none;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .results-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .results-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .sort-options,
    .view-options {
        justify-content: center;
    }
    
    .search-results.grid-view {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .search-sidebar {
        padding: 1rem;
    }
    
    .search-content {
        padding: 1rem;
    }
    
    .result-item {
        padding: 1rem;
    }
    
    .result-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .result-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .result-actions {
        flex-wrap: wrap;
    }
}

/* Dark Theme Adjustments */
.dark-theme .hero-section {
    background: linear-gradient(135deg, var(--primary-color-dark) 0%, var(--secondary-color-dark) 100%);
}

.dark-theme .search-sidebar,
.dark-theme .search-content {
    background: var(--surface-color);
    border-color: var(--border-color);
}

.dark-theme .result-item {
    background: var(--background-color);
    border-color: var(--border-color);
}

.dark-theme .form-input,
.dark-theme .form-select {
    background: var(--background-color);
    border-color: var(--border-color);
    color: var(--text-color);
}

.dark-theme .checkmark,
.dark-theme .radiomark {
    background-color: var(--background-color);
    border-color: var(--border-color);
}

.dark-theme .rating-option {
    border-color: var(--border-color);
}

.dark-theme .rating-option:hover {
    background: var(--surface-hover);
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-large);
}

.loading-spinner i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.loading-spinner span {
    color: var(--text-color);
    font-weight: 500;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    animation: fadeInUp 0.6s ease-out;
}

.result-item:nth-child(1) { animation-delay: 0.1s; }
.result-item:nth-child(2) { animation-delay: 0.2s; }
.result-item:nth-child(3) { animation-delay: 0.3s; }
.result-item:nth-child(4) { animation-delay: 0.4s; }
.result-item:nth-child(5) { animation-delay: 0.5s; }