/**
 * Top 100 Voting Plugin - Search and Filter Module CSS
 * Clean, modern styling for search and filter functionality
 */

/* Search and Filter Controls Container */
.top100-search-filter-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Search Container */
.search-container {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 12px 48px 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #6D4BE9;
    box-shadow: 0 0 0 3px rgba(109, 75, 233, 0.1);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6c757d;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.search-btn:hover {
    color: #6D4BE9;
}

/* Filter Toggle Button */
.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    transition: all 0.2s ease;
}

.filter-toggle-btn:hover {
    border-color: #6D4BE9;
    color: #6D4BE9;
}

/* Clear Filters Button */
.clear-filters-btn {
    padding: 12px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.clear-filters-btn:hover {
    background: #c82333;
}

/* Filter Panel */
.filter-panel {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.filter-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
}

.close-filter-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.close-filter-btn:hover {
    color: #495057;
}

/* Filter Content */
.filter-content {
    padding: 20px;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.filter-select,
.filter-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: white;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #6D4BE9;
    box-shadow: 0 0 0 3px rgba(109, 75, 233, 0.1);
}

/* Filter Footer */
.filter-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.apply-filters-btn,
.reset-filters-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apply-filters-btn {
    background: #6D4BE9;
    color: white;
}

.apply-filters-btn:hover {
    background: #5a3fc7;
}

.reset-filters-btn {
    background: #6c757d;
    color: white;
}

.reset-filters-btn:hover {
    background: #5a6268;
}

/* Results Counter */
.results-counter {
    padding: 12px 16px;
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: center;
}

.results-count {
    font-weight: 600;
    color: #0066cc;
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 16px;
}

/* Loading State */
.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #6c757d;
}

.search-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #6D4BE9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Track Highlighting */
.track-highlighted {
    background-color: #fff3cd !important;
    border-color: #ffeaa7 !important;
    animation: highlight-pulse 0.6s ease-in-out;
}

@keyframes highlight-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .top100-search-filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container {
        min-width: auto;
    }
    
    .filter-footer {
        flex-direction: column;
    }
    
    .apply-filters-btn,
    .reset-filters-btn {
        flex: none;
    }
}

@media (max-width: 480px) {
    .top100-search-filter-controls {
        padding: 12px;
        gap: 8px;
    }
    
    .search-input {
        padding: 10px 44px 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .filter-toggle-btn,
    .clear-filters-btn {
        padding: 10px 12px;
        font-size: 14px;
    }
}