#filter-wrapper {
    overflow: hidden;
    transition: max-height 0.5s ease-out;
}
.advanced-filter-container {
    background: #0f172a;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 40px;
    border: 1px solid rgba(255,255,255,0.05);
}

/* Filter header */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}
.filter-main-title {
    margin: 0;
    font-size: 24px;
    color: var(--accent);
}
.filter-header-btns {
    display: flex;
    gap: 10px;
}
.btn-reset-all {
    background: #450a0a;
    color: #f87171;
    border: 1px solid #7f1d1d;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.btn-close-filter {
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

/* Filter group */
.filter-group {
    margin-bottom: 25px;
}
.group-title {
    display: block;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #94a3b8;
}
.tile-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}
.filter-tile {
    cursor: pointer;
    background: #1e293b;
    border: 1px solid #334155;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 14px;
    color: #cbd5e1;
    transition: all 0.2s ease;
    user-select: none;
}
.filter-tile input {
    display: none;
}
.filter-tile:has(input:checked),
.filter-tile.linked-active {
    background: var(--accent);
    color: #0b0f19;
    border-color: var(--accent);
    font-weight: bold;
}
.filter-tile:hover {
    border-color: var(--accent);
    color: #fff;
}
.filter-tile:has(input:checked) {
    background: var(--accent);
    color: #0b0f19;
    border-color: var(--accent);
    font-weight: bold;
}

/* Genres */
.scrollable, .countries-list-scroll {
    max-height: 180px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
}
.scrollable::-webkit-scrollbar {
    width: 4px;
}
.scrollable::-webkit-scrollbar-thumb {
    background: var(--accent); border-radius: 10px;
}

/* Year */
.period-btn.active {
    background: var(--accent) !important;
    color: #0b0f19 !important;
    border-color: var(--accent) !important;
}
.range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-muted);
}
.range-inputs input {
    background: #1e293b;
    border: 1px solid #334155;
    color: #fff;
    padding: 5px;
    border-radius: 5px;
    width: 70px;
}

/* Bottom */
.filter-bottom-panel {
    display: flex;
    gap: 30px;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.panel-section {
    flex: 1;
}

/* Sort */
.sort-controls-compact {
    display: flex;
    gap: 8px;
}
.filter-select {
    flex: 1;
    background: #1e293b;
    color: #fff;
    border: 1px solid #334155;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
}
.filter-select.mini {
    width: 110px;
    flex-shrink: 0;
}

/* Mode */
.mode-selector-compact {
    display: flex;
    background: #1e293b;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid #334155;
}
.mode-btn {
    flex: 1;
    text-align: center;
    cursor: pointer;
    position: relative;
}
.mode-btn input {
    display: none;
}
.mode-btn span {
    display: block;
    padding: 8px 12px;
    border-radius: 7px;
    font-size: 13px;
    color: #94a3b8;
    transition: 0.2s;
}
.mode-btn input:checked + span {
    background: var(--accent);
    color: #0b0f19;
    font-weight: bold;
}

/* Button */
.btn-apply-filter {
    background: var(--accent);
    color: #0b0f19;
    border: none;
    padding: 14px 40px;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
    width: auto;
    min-width: 250px;
    font-size: 15px;
    margin-top: 20px;
    display: block;
    margin-left: auto;
}

/* Show-hide button */
.filter-controls {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-start;
}
.btn-toggle-filter {
    background: #1e293b;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}
.btn-toggle-filter:hover {
    background: var(--accent);
    color: #0b0f19;
}
.btn-toggle-filter.active {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

/* Mobile */
@media (max-width: 768px) {
    .filter-bottom-panel {
        flex-direction: column;
        gap: 20px;
    }
    .btn-apply-filter {
        width: 100%;
    }
}
