/* Advanced Filters Panel Styles */

.filters-panel {
    background: linear-gradient(135deg, var(--surface), var(--background));
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    overflow: visible;
    border: 1px solid var(--border);
}

.filters-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: transparent;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    position: relative;
    border-bottom: 1px solid #2a2a2a;
}

.filters-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(156, 136, 255, 0.1), transparent);
    opacity: 1;
}

.filter-icon {
    color: #9c88ff;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.filters-header span {
    flex: 1;
    text-align: left;
    position: relative;
    z-index: 1;
}

.filters-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}

.filters-toggle::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(156, 136, 255, 0.1), transparent);
    opacity: 1;
    pointer-events: none;
}

.filters-toggle:hover {
    background: rgba(156, 136, 255, 0.05);
}

.filters-toggle span {
    flex: 1;
    text-align: left;
    position: relative;
    z-index: 1;
}

.toggle-arrow {
    color: #9c88ff;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: transform 0.3s;
}

.filters-toggle.active .toggle-arrow {
    transform: rotate(180deg);
}

.filters-content {
    overflow: visible;
    padding: 20px;
    position: relative;
    display: none;
}

.filters-content.active {
    display: block;
}

.filters-content-always-open {
    /* Allow dropdowns to extend beyond container while maintaining structure */
    overflow: visible;
    padding: 20px;
    /* Contain only the grid layout, not the dropdown menus */
    position: relative;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-item label {
    color: #ccc;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-item label::before {
    content: '';
    width: 3px;
    height: 14px;
    background: linear-gradient(180deg, #9c88ff, #b8a7ff);
    border-radius: 2px;
}

.filters-actions {
    display: flex;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid #2a2a2a;
}

.btn-apply-filters,
.btn-clear-filters {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-apply-filters {
    background: linear-gradient(135deg, #9c88ff, #8a76f0);
    color: #fff;
    box-shadow: 0 4px 12px rgba(156, 136, 255, 0.3);
}

.btn-apply-filters::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-apply-filters:hover::before {
    left: 100%;
}

.btn-apply-filters:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(156, 136, 255, 0.4);
}

.btn-apply-filters:active {
    transform: translateY(0);
}

.btn-clear-filters {
    background: linear-gradient(135deg, #2a2a2a, #353535);
    color: #fff;
}

.btn-clear-filters:hover {
    background: linear-gradient(135deg, #353535, #404040);
    transform: translateY(-2px);
}

.btn-clear-filters:active {
    transform: translateY(0);
}

/* Filter active indicator */
.filters-toggle .active-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #9c88ff;
    border-radius: 50%;
    margin-left: auto;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .filters-actions {
        flex-direction: column;
    }
    
    .btn-apply-filters,
    .btn-clear-filters {
        width: 100%;
    }
    
    .filters-toggle {
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .filters-content {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .filters-toggle {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .filter-item label {
        font-size: 13px;
    }
    
    .filters-content {
        padding: 12px;
    }
    
    .filters-grid {
        gap: 12px;
    }
}

/* Animation for filter application */
@keyframes filterApplied {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.btn-apply-filters.applying {
    background: linear-gradient(270deg, #9c88ff, #b8a7ff, #9c88ff);
    background-size: 200% 200%;
    animation: filterApplied 1s ease;
    pointer-events: none;
}
