/* =============================================
   Search Page Styles
   Modern, clean design consistent with other pages
   ============================================= */

/* Hero Section */
.search-hero {
    position: relative;
    padding: 3rem 0;
    margin-bottom: 2rem;
    overflow: hidden;
}

.search-hero-background {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-color, #00a7ff) 0%, var(--primary-dark, #0077cc) 100%);
    z-index: 0;
}

.search-hero-overlay {
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 1;
}

.search-hero-container {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: calc(80px + .5rem) 1.5rem 1.5rem;
}

.search-hero-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    backdrop-filter: blur(10px);
}

.search-hero-icon i {
    font-size: 2.5rem;
    color: white;
}

.search-hero-title {
    color: white;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.search-hero-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin: 0 0 2rem;
}

/* Search Input in Hero */
.search-input-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.search-input-wrapper i.search-icon {
    color: var(--text-secondary, #6b7280);
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    padding: 0.75rem 0;
    outline: none;
    color: var(--text-primary, #212529);
}

.search-input::placeholder {
    color: var(--text-muted, #9ca3af);
}

.search-clear-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.search-clear-btn:hover {
    color: var(--text-primary, #374151);
}

/* Main Content */
.search-content {
    padding: 0 1.5rem 3rem;
}

.search-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Filters */
.search-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--card-background, #ffffff);
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.search-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.search-filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color, #00a7ff);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-filter-select {
    padding: 0.625rem 2rem 0.625rem 0.875rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.5rem;
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-primary, #212529);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-filter-select:hover {
    border-color: var(--primary-color, #00a7ff);
}

.search-filter-select:focus {
    outline: none;
    border-color: var(--primary-color, #00a7ff);
    box-shadow: 0 0 0 3px rgba(0, 167, 255, 0.1);
}

/* Results Summary */
.search-results-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #e9ecef);
}

.search-results-count {
    font-size: 0.9rem;
    color: var(--text-secondary, #6c757d);
}

.search-results-count strong {
    color: var(--text-primary, #212529);
}

.search-results-time {
    font-size: 0.8rem;
    color: var(--text-muted, #9ca3af);
}

/* Result Cards */
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-result-card {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    background: var(--card-background, #ffffff);
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.search-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color, #00a7ff);
}

.search-result-image {
    width: 80px;
    height: 80px;
    border-radius: 0.75rem;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-secondary, #f3f4f6);
}

.search-result-image-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 0.75rem;
    background: var(--bg-secondary, #f3f4f6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-result-image-placeholder i {
    font-size: 2rem;
    color: var(--text-muted, #9ca3af);
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-type {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-color, #00a7ff);
    margin-bottom: 0.5rem;
}

.search-result-type i {
    font-size: 0.875rem;
}

.search-result-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #212529);
    margin: 0 0 0.375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary, #6c757d);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Empty State */
.search-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-background, #ffffff);
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.search-empty-state i {
    font-size: 4rem;
    color: var(--text-muted, #adb5bd);
    margin-bottom: 1.5rem;
}

.search-empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary, #212529);
    margin-bottom: 0.5rem;
}

.search-empty-state p {
    color: var(--text-secondary, #6c757d);
    margin: 0;
}

/* Loading */
.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
}

.search-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color, #e9ecef);
    border-top-color: var(--primary-color, #00a7ff);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Load More Button */
.search-load-more {
    display: flex;
    justify-content: center;
    padding-top: 2rem;
}

.btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: transparent;
    color: var(--primary-color, #00a7ff);
    font-weight: 600;
    border: 2px solid var(--primary-color, #00a7ff);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-load-more:hover:not(:disabled) {
    background: var(--primary-color, #00a7ff);
    color: white;
}

.btn-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .search-hero-title {
        font-size: 2rem;
    }
    
    .search-filters {
        flex-direction: column;
    }
    
    .search-filter-group {
        width: 100%;
    }
    
    .search-result-card {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-result-image,
    .search-result-image-placeholder {
        width: 100%;
        height: 120px;
    }
    
    .search-results-summary {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* =============================================
   Dark Mode Support
   ============================================= */

body.dark-mode .search-input-wrapper {
    background: rgba(30, 30, 30, 0.95);
}

body.dark-mode .search-input {
    color: var(--text-primary, #e0e0e0);
}

body.dark-mode .search-filters {
    background: var(--card-background, #1e1e1e);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .search-filter-select {
    background-color: var(--bg-secondary, #2a2a2a);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #e0e0e0);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
}

body.dark-mode .search-results-count strong {
    color: var(--text-primary, #e0e0e0);
}

body.dark-mode .search-result-card {
    background: var(--card-background, #1e1e1e);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.dark-mode .search-result-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

body.dark-mode .search-result-title {
    color: var(--text-primary, #e0e0e0);
}

body.dark-mode .search-result-subtitle {
    color: var(--text-secondary, #9ca3af);
}

body.dark-mode .search-result-image-placeholder {
    background: rgba(30, 30, 30, 0.7);
}

body.dark-mode .search-empty-state {
    background: var(--card-background, #1e1e1e);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .search-empty-state h3 {
    color: var(--text-primary, #e0e0e0);
}

body.dark-mode .search-empty-state p {
    color: var(--text-secondary, #9ca3af);
}

body.dark-mode .search-loading-spinner {
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary-color, #00a7ff);
}
