/* ========================================
   高端筛选弹窗样式 - Premium Filter Modal
   ======================================== */

/* 筛选弹窗整体优化 */
.filter-modal-content {
    max-width: 500px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.filter-header {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    color: white;
    padding: 24px 28px;
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

.filter-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.filter-header .modal-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.3px;
}

.filter-header .modal-title i {
    color: rgba(255, 255, 255, 0.95);
    font-size: 20px;
    margin-right: 10px;
}

.filter-header .close-modal {
    color: rgba(255, 255, 255, 0.85);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.filter-header .close-modal:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.filter-body {
    padding: 24px;
    max-height: 65vh;
    overflow-y: auto;
    background: linear-gradient(to bottom, #FAFBFF 0%, #FFFFFF 100%);
}

/* 筛选区域 */
.filter-section {
    margin-bottom: 24px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

/* 区域标题 */
.filter-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    letter-spacing: -0.2px;
}

.filter-section-title i {
    color: #6366F1;
    font-size: 16px;
    width: 18px;
    text-align: center;
}

/* 选项容器 - Grid 布局 */
.filter-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

/* 单个选项 - 文字+按钮样式 */
.filter-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 6px;
    background: #F9FAFB;
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    min-height: 36px;
}

.filter-option:hover {
    background: white;
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.filter-option.active {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    border-color: #6366F1;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.filter-option span {
    font-size: 12px;
    color: #374151;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    width: 100%;
}

.filter-option.active span {
    color: white;
    font-weight: 600;
}

/* 自定义选择器容器 */
.custom-select-wrapper {
    position: relative;
    margin-bottom: 24px;
}

.custom-select-wrapper:last-child {
    margin-bottom: 0;
}

/* 标签样式 */
.custom-select-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    letter-spacing: -0.2px;
}

.custom-select-label i {
    color: #6366F1;
    font-size: 15px;
    width: 18px;
    text-align: center;
}

/* 触发器样式 */
.custom-select-trigger {
    width: 100%;
    padding: 16px 18px;
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    font-size: 14px;
    color: #1F2937;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.custom-select-trigger::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.custom-select-trigger:hover {
    border-color: #818CF8;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12);
    transform: translateY(-1px);
}

.custom-select-trigger:hover::before {
    opacity: 1;
}

.custom-select-trigger.active {
    border-color: #6366F1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), 0 4px 16px rgba(99, 102, 241, 0.15);
}

.custom-select-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.custom-select-text.placeholder {
    color: #9CA3AF;
    font-weight: 400;
}

.custom-select-arrow {
    color: #9CA3AF;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    position: relative;
    z-index: 1;
}

.custom-select-trigger.active .custom-select-arrow {
    transform: rotate(180deg);
    color: #6366F1;
}

/* 下拉列表容器 */
.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.02);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.98);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* 搜索框 */
.custom-select-search {
    padding: 14px 16px;
    border-bottom: 1px solid #F3F4F6;
    position: sticky;
    top: 0;
    background: white;
    z-index: 2;
    border-radius: 16px 16px 0 0;
}

.custom-select-search input {
    width: 100%;
    padding: 11px 16px 11px 40px;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
    background: #F9FAFB;
    color: #1F2937;
    font-weight: 500;
}

.custom-select-search input::placeholder {
    color: #9CA3AF;
}

.custom-select-search input:focus {
    border-color: #6366F1;
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.custom-select-search {
    position: relative;
}

.custom-select-search::before {
    content: '\f002';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 14px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.custom-select-search input:focus + .search-icon-highlight,
.custom-select-search:focus-within::before {
    color: #6366F1;
}

/* 选项列表 */
.custom-select-options {
    padding: 10px;
}

.custom-option {
    padding: 13px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
}

.custom-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(135deg, #6366F1, #818CF8);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.custom-option:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(99, 102, 241, 0.02));
    color: #4F46E5;
    transform: translateX(2px);
}

.custom-option.selected {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.05));
    color: #4F46E5;
    font-weight: 600;
}

.custom-option.selected::before {
    transform: scaleY(1);
}

.custom-option.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 15px;
    color: #6366F1;
}

.custom-option-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

/* 空状态 */
.custom-select-empty {
    padding: 40px 20px;
    text-align: center;
    color: #9CA3AF;
    font-size: 13px;
}

.custom-select-empty i {
    font-size: 36px;
    margin-bottom: 12px;
    display: block;
    opacity: 0.4;
    color: #D1D5DB;
}

.custom-select-empty p {
    margin: 0;
    font-weight: 500;
}

/* 滚动条美化 */
.custom-select-dropdown::-webkit-scrollbar {
    width: 7px;
}

.custom-select-dropdown::-webkit-scrollbar-track {
    background: transparent;
    margin: 10px 0;
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #D1D5DB, #E5E7EB);
    border-radius: 4px;
    border: 2px solid white;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #9CA3AF, #D1D5DB);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .filter-modal-content {
        max-width: 95%;
        border-radius: 20px;
    }
    
    .filter-header {
        padding: 20px 24px;
    }
    
    .filter-header .modal-title {
        font-size: 18px;
    }
    
    .filter-body {
        padding: 20px 16px;
        max-height: 60vh;
    }
    
    .filter-section {
        margin-bottom: 20px;
    }
    
    .filter-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .filter-option {
        padding: 7px 4px;
        min-height: 32px;
    }
    
    .filter-option span {
        font-size: 11px;
    }
}

/* 动画效果 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.custom-select-dropdown.show {
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-option {
    animation: fadeIn 0.2s ease;
    animation-fill-mode: both;
}

.custom-option:nth-child(1) { animation-delay: 0.02s; }
.custom-option:nth-child(2) { animation-delay: 0.04s; }
.custom-option:nth-child(3) { animation-delay: 0.06s; }
.custom-option:nth-child(4) { animation-delay: 0.08s; }
.custom-option:nth-child(5) { animation-delay: 0.1s; }
.custom-option:nth-child(6) { animation-delay: 0.12s; }
.custom-option:nth-child(7) { animation-delay: 0.14s; }
.custom-option:nth-child(8) { animation-delay: 0.16s; }
.custom-option:nth-child(9) { animation-delay: 0.18s; }
.custom-option:nth-child(10) { animation-delay: 0.2s; }
