/**
 * Episode Search Component Styles
 * Minimal styles - leverages existing theme styles for episode cards
 */

/* Container */
.episode-search-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Loading State */
.loading-state,
.error-state {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-state {
    color: #e74c3c;
}

/* Search Controls */
.search-controls {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.episode-search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

.episode-search-input:focus {
    outline: none;
    border-color: #3498db;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    pointer-events: none;
}

/* Sort Dropdown */
.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.sort-wrapper label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.episode-sort-select {
    flex: 1;
    max-width: 300px;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.episode-sort-select:hover {
    border-color: #3498db;
}

.episode-sort-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Filter Row */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #555;
}

.filter-select {
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-select:hover,
.filter-select:focus {
    border-color: #3498db;
    outline: none;
}

.clear-filters-btn {
    padding: 0.625rem 1.25rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: auto;
}

.clear-filters-btn:hover {
    background: #c0392b;
}

/* Results Meta */
.search-results-meta {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.results-count {
    font-size: 1rem;
    font-weight: 600;
    color: #555;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.no-results p {
    font-size: 1.125rem;
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-primary:hover {
    background: #2980b9;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 0;
    margin-top: 2rem;
}

.pagination-btn {
    padding: 0.75rem 1.5rem;
    background: #142544;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #2980b9;
}

.pagination-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-info {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e2e2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .episode-search-container {
        padding: 1rem;
    }
    
    .search-controls {
        padding: 1rem;
    }
    
    .sort-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .sort-wrapper label {
        font-size: 0.875rem;
    }
    
    .episode-sort-select {
        max-width: 100%;
        width: 100%;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .clear-filters-btn {
        width: 100%;
        margin-top: 1rem;
    }
    
    .pagination {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .pagination-btn {
        width: 100%;
    }
}
