/**
 * WP Team Manager - Enhanced Search & Filtering Styles
 */

/* Search Container */
.wtm-enhanced-search {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Search Input */
.wtm-search-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.wtm-search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.wtm-search-input:focus {
    outline: none;
    border-color: #007cba;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.wtm-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

/* Autocomplete Suggestions */
.ui-autocomplete {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.ui-autocomplete .ui-menu-item {
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
}

.ui-autocomplete .ui-menu-item:last-child {
    border-bottom: none;
}

.ui-autocomplete .ui-menu-item-wrapper {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ui-autocomplete .ui-menu-item-wrapper:hover,
.ui-autocomplete .ui-state-active {
    background-color: #f8f9fa;
}

/* Search Suggestions */
.wtm-search-suggestions {
    display: none;
    margin-top: 10px;
    padding: 10px 0;
    border-top: 1px solid #e1e5e9;
}

.wtm-suggestion {
    display: inline-block;
    padding: 5px 12px;
    margin: 2px 5px 2px 0;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 15px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wtm-suggestion:hover {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

/* Filter Controls */
.wtm-filters-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.wtm-filter-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e1e5e9;
}

.wtm-filter-group h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Taxonomy Filters */
.wtm-taxonomy-filter {
    margin-bottom: 15px;
}

.wtm-filter-checkbox-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px 0;
}

.wtm-filter-checkbox {
    margin-right: 8px;
    transform: scale(1.1);
}

.wtm-filter-label {
    font-size: 14px;
    color: #555;
    cursor: pointer;
    flex: 1;
}

.wtm-filter-count {
    font-size: 12px;
    color: #999;
    margin-left: auto;
}

/* Meta Filters */
.wtm-meta-filter {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.wtm-meta-filter:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

/* Date Range Filters */
.wtm-date-range {
    display: flex;
    gap: 10px;
    align-items: center;
}

.wtm-date-from,
.wtm-date-to {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    font-size: 14px;
}

.wtm-date-separator {
    color: #666;
    font-weight: 500;
}

/* Advanced Filters Toggle */
.wtm-advanced-toggle {
    text-align: center;
    margin-bottom: 15px;
}

.wtm-toggle-advanced {
    background: none;
    border: 1px solid #007cba;
    color: #007cba;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.wtm-toggle-advanced:hover {
    background: #007cba;
    color: #fff;
}

.wtm-advanced-filters {
    display: none;
}

/* Filter Actions */
.wtm-filter-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #e1e5e9;
}

.wtm-clear-filters,
.wtm-save-preset {
    padding: 8px 16px;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.wtm-clear-filters:hover {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.wtm-save-preset:hover {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
}

/* Preset Selector */
.wtm-preset-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wtm-preset-select {
    padding: 6px 10px;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
}

/* Results */
.wtm-search-results {
    transition: opacity 0.3s ease;
}

.wtm-search-results.wtm-searching {
    opacity: 0.6;
    pointer-events: none;
}

.wtm-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e5e9;
}

.wtm-results-count {
    font-weight: 600;
    color: #333;
}

.wtm-layout-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.wtm-layout-selector,
.wtm-style-selector,
.wtm-per-page {
    padding: 5px 8px;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    font-size: 12px;
}

/* Loading State */
.wtm-search-loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #666;
}

.wtm-search-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: wtm-spin 1s linear infinite;
    margin-left: 10px;
}

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

/* No Results */
.wtm-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.wtm-error {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* Search Result Items */
.wtm-search-result {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.wtm-search-result:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .wtm-filters-wrapper {
        grid-template-columns: 1fr;
    }
    
    .wtm-filter-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .wtm-results-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .wtm-layout-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .wtm-date-range {
        flex-direction: column;
        gap: 5px;
    }
    
    .wtm-preset-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .wtm-enhanced-search {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .wtm-search-input {
        font-size: 14px;
        padding: 10px 40px 10px 12px;
    }
    
    .wtm-filter-group {
        padding: 12px;
    }
}